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

Unified Diff: content/common/gpu/gpu_channel.h

Issue 565833002: Refactoring the weak_ptr_factory order in src/content/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
Index: content/common/gpu/gpu_channel.h
diff --git a/content/common/gpu/gpu_channel.h b/content/common/gpu/gpu_channel.h
index 49b1078e6e1d050f054f025deff39bf32bd0c838..6b6dffb2199b26c3d0161799add9054b1ac1805b 100644
--- a/content/common/gpu/gpu_channel.h
+++ b/content/common/gpu/gpu_channel.h
@@ -217,8 +217,6 @@ class GpuChannel : public IPC::Listener, public IPC::Sender {
bool handle_messages_scheduled_;
IPC::Message* currently_processing_message_;
- base::WeakPtrFactory<GpuChannel> weak_factory_;
-
scoped_refptr<GpuChannelMessageFilter> filter_;
scoped_refptr<base::MessageLoopProxy> io_message_loop_;
scoped_ptr<DevToolsGpuAgent> devtools_gpu_agent_;
@@ -227,6 +225,11 @@ class GpuChannel : public IPC::Listener, public IPC::Sender {
bool allow_future_sync_points_;
+ // Member variables should appear before the WeakPtrFactory, to ensure
+ // that any WeakPtrs to Controller are invalidated before its members
+ // variable's destructors are executed, rendering them invalid.
+ base::WeakPtrFactory<GpuChannel> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GpuChannel);
};
« no previous file with comments | « content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc ('k') | content/common/gpu/gpu_channel.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698