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

Unified Diff: content/child/resource_dispatcher.h

Issue 567873003: Refactoring the weak_ptr_factory order in src/content/child (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 | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/resource_dispatcher.h
diff --git a/content/child/resource_dispatcher.h b/content/child/resource_dispatcher.h
index cd965a5dfb6e21dd27c434487404fc1a4719b723..3ec6f3fe8a1bb778c42986da83127348933c01ed 100644
--- a/content/child/resource_dispatcher.h
+++ b/content/child/resource_dispatcher.h
@@ -210,13 +210,16 @@ class CONTENT_EXPORT ResourceDispatcher : public IPC::Listener {
// All pending requests issued to the host
PendingRequestList pending_requests_;
- base::WeakPtrFactory<ResourceDispatcher> weak_factory_;
-
ResourceDispatcherDelegate* delegate_;
// IO thread timestamp for ongoing IPC message.
base::TimeTicks io_timestamp_;
+ // 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<ResourceDispatcher> weak_factory_;
Avi (use Gerrit) 2014/09/12 05:55:01 You don't need that explanatory comment. That's tr
MRV 2014/09/12 06:06:32 Done.
+
DISALLOW_COPY_AND_ASSIGN(ResourceDispatcher);
};
« no previous file with comments | « no previous file | content/child/resource_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698