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

Unified Diff: content/renderer/gpu/compositor_output_surface.h

Issue 11044008: Dont let messages hit CompositorOutputSurface after it is destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 | « no previous file | content/renderer/gpu/compositor_output_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/compositor_output_surface.h
diff --git a/content/renderer/gpu/compositor_output_surface.h b/content/renderer/gpu/compositor_output_surface.h
index 50461a505d1a38aff88a27118d40f52967631414..edff94064aee127323f93fcb50577908adf6852e 100644
--- a/content/renderer/gpu/compositor_output_surface.h
+++ b/content/renderer/gpu/compositor_output_surface.h
@@ -7,8 +7,8 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
-#include "base/memory/scoped_ptr.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/threading/non_thread_safe.h"
#include "base/time.h"
#include "third_party/WebKit/Source/Platform/chromium/public/WebCompositorOutputSurface.h"
@@ -48,12 +48,33 @@ class CompositorOutputSurface
const WebKit::WebCompositorFrame&) OVERRIDE;
private:
+ class CompositorOutputSurfaceProxy :
+ public base::RefCountedThreadSafe<CompositorOutputSurfaceProxy> {
+ public:
+ explicit CompositorOutputSurfaceProxy(
+ CompositorOutputSurface* output_surface)
+ : output_surface_(output_surface) {}
+ void ClearOutputSurface() { output_surface_ = NULL; }
+ void OnMessageReceived(const IPC::Message& message) {
+ if (output_surface_)
+ output_surface_->OnMessageReceived(message);
+ }
+
+ private:
+ friend class base::RefCountedThreadSafe<CompositorOutputSurfaceProxy>;
+ ~CompositorOutputSurfaceProxy() {}
+ CompositorOutputSurface* output_surface_;
+
+ DISALLOW_COPY_AND_ASSIGN(CompositorOutputSurfaceProxy);
+ };
+
void OnMessageReceived(const IPC::Message& message);
void OnUpdateVSyncParameters(
base::TimeTicks timebase, base::TimeDelta interval);
scoped_refptr<IPC::ForwardingMessageFilter> output_surface_filter_;
WebKit::WebCompositorOutputSurfaceClient* client_;
+ scoped_refptr<CompositorOutputSurfaceProxy> output_surface_proxy_;
int routing_id_;
Capabilities capabilities_;
scoped_ptr<WebKit::WebGraphicsContext3D> context3D_;
« no previous file with comments | « no previous file | content/renderer/gpu/compositor_output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698