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

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: 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: 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 b672409b8c36b5f6307f181a30f8b3946e9496b5..7b1070a5ae571b3ea9cc296f592abb01bdbfff92 100644
--- a/media/video/capture/mac/video_capture_device_mac.h
+++ b/media/video/capture/mac/video_capture_device_mac.h
@@ -72,13 +72,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: This must always be last so it's
+ // invalidated before other member variables might be accessed.
+ base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac);
};

Powered by Google App Engine
This is Rietveld 408576698