Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: content/plugin/webplugin_proxy.h

Issue 10855141: Fix race condition with windowless plugin buffers. The problem, which is already fixed for Mac, is … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/plugin_browsertest.cc ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/plugin/webplugin_proxy.h
===================================================================
--- content/plugin/webplugin_proxy.h (revision 151213)
+++ content/plugin/webplugin_proxy.h (working copy)
@@ -19,6 +19,7 @@
#include "base/timer.h"
#include "googleurl/src/gurl.h"
#include "ipc/ipc_message.h"
+#include "third_party/skia/include/core/SkRefCnt.h"
#if defined(USE_X11)
#include "ui/base/x/x11_util.h"
#endif
@@ -199,6 +200,17 @@
#endif
private:
+ class SharedTransportDIB : public base::RefCounted<SharedTransportDIB> {
+ public:
+ explicit SharedTransportDIB(TransportDIB* dib);
+ TransportDIB* dib() { return dib_.get(); }
+ private:
+ friend class base::RefCounted<SharedTransportDIB>;
+ ~SharedTransportDIB();
+
+ scoped_ptr<TransportDIB> dib_;
+ };
+
bool Send(IPC::Message* msg);
// Handler for sending over the paint event to the plugin.
@@ -207,7 +219,7 @@
#if defined(OS_WIN)
void CreateCanvasFromHandle(const TransportDIB::Handle& dib_handle,
const gfx::Rect& window_rect,
- scoped_ptr<skia::PlatformCanvas>* canvas_out);
+ SkAutoTUnref<skia::PlatformCanvas>* canvas);
#elif defined(OS_MACOSX)
static void CreateDIBAndCGContextFromHandle(
const TransportDIB::Handle& dib_handle,
@@ -218,8 +230,8 @@
static void CreateDIBAndCanvasFromHandle(
const TransportDIB::Handle& dib_handle,
const gfx::Rect& window_rect,
- scoped_ptr<TransportDIB>* dib_out,
- scoped_ptr<skia::PlatformCanvas>* canvas_out);
+ scoped_refptr<SharedTransportDIB>* dib_out,
+ SkAutoTUnref<skia::PlatformCanvas>* canvas);
static void CreateShmPixmapFromDIB(
TransportDIB* dib,
@@ -279,12 +291,12 @@
base::mac::ScopedCFTypeRef<CGContextRef> background_context_;
scoped_ptr<WebPluginAcceleratedSurfaceProxy> accelerated_surface_;
#else
- scoped_ptr<skia::PlatformCanvas> windowless_canvases_[2];
- scoped_ptr<skia::PlatformCanvas> background_canvas_;
+ SkAutoTUnref<skia::PlatformCanvas> windowless_canvases_[2];
+ SkAutoTUnref<skia::PlatformCanvas> background_canvas_;
#if defined(USE_X11)
- scoped_ptr<TransportDIB> windowless_dibs_[2];
- scoped_ptr<TransportDIB> background_dib_;
+ scoped_refptr<SharedTransportDIB> windowless_dibs_[2];
+ scoped_refptr<SharedTransportDIB> background_dib_;
// If we can use SHM pixmaps for windowless plugin painting or not.
bool use_shm_pixmap_;
// The SHM pixmaps for windowless plugin painting.
« no previous file with comments | « content/browser/plugin_browsertest.cc ('k') | content/plugin/webplugin_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698