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

Unified Diff: content/common/gpu/gpu_channel_manager.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
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel_manager.h
diff --git a/content/common/gpu/gpu_channel_manager.h b/content/common/gpu/gpu_channel_manager.h
index 4d18306a38f297bad502ebbb4429438b8d3a4443..4ea32bb4b8553c5f2dcaa3d73affed76dc9dfe27 100644
--- a/content/common/gpu/gpu_channel_manager.h
+++ b/content/common/gpu/gpu_channel_manager.h
@@ -81,8 +81,6 @@ class GpuChannelManager : public IPC::Listener,
void LoseAllContexts();
- base::WeakPtrFactory<GpuChannelManager> weak_factory_;
-
int GenerateRouteID();
void AddRoute(int32 routing_id, IPC::Listener* listener);
void RemoveRoute(int32 routing_id);
@@ -153,6 +151,11 @@ class GpuChannelManager : public IPC::Listener,
IPC::SyncChannel* channel_;
scoped_refptr<IPC::MessageFilter> filter_;
+ // 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<GpuChannelManager> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(GpuChannelManager);
};
« no previous file with comments | « content/common/gpu/gpu_channel.cc ('k') | content/common/gpu/gpu_channel_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698