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

Unified Diff: content/browser/media/capture/web_contents_video_capture_device.cc

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/browser/media/capture/web_contents_video_capture_device.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc
index 093703e145c051b790873ae35219ea0e7fab8114..9e9c6da39810d3510a5e52545b565217470415d0 100644
--- a/content/browser/media/capture/web_contents_video_capture_device.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device.cc
@@ -309,7 +309,9 @@ class WebContentsCaptureMachine
// oracle, and initiating captures accordingly.
scoped_ptr<ContentCaptureSubscription> subscription_;
- // Weak pointer factory used to invalidate callbacks.
+ // Weak pointer factory used to invalidate callbacks. NOTE: This must always
+ // be last so it's invalidated before other member variables might be
+ // accessed.
base::WeakPtrFactory<WebContentsCaptureMachine> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(WebContentsCaptureMachine);

Powered by Google App Engine
This is Rietveld 408576698