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

Unified Diff: media/video/capture/mac/video_capture_device_mac.h

Issue 193303002: WeakPtr destruction order cleanup: media edition. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. 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
« no previous file with comments | « media/midi/usb_midi_device_factory_android.cc ('k') | media/video/capture/mac/video_capture_device_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/video/capture/mac/video_capture_device_mac.h
diff --git a/media/video/capture/mac/video_capture_device_mac.h b/media/video/capture/mac/video_capture_device_mac.h
index d1bdf278749d2276c289f10362f69a4a6798469c..3b12d83a2c5f40fa4d42e04b61698b17f129f826 100644
--- a/media/video/capture/mac/video_capture_device_mac.h
+++ b/media/video/capture/mac/video_capture_device_mac.h
@@ -76,13 +76,13 @@ class VideoCaptureDeviceMac : public VideoCaptureDevice {
const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
InternalState state_;
- // Used with Bind and PostTask to ensure that methods aren't called
- // after the VideoCaptureDeviceMac is destroyed.
- base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_;
- base::WeakPtr<VideoCaptureDeviceMac> weak_this_;
-
id<PlatformVideoCapturingMac> capture_device_;
+ // Used with Bind and PostTask to ensure that methods aren't called after the
+ // VideoCaptureDeviceMac is destroyed.
+ // NOTE: Weak pointers must be invalidated before all other member variables.
+ base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac);
};
« no previous file with comments | « media/midi/usb_midi_device_factory_android.cc ('k') | media/video/capture/mac/video_capture_device_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698