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

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

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/video/capture/mac/video_capture_device_mac.h ('k') | no next file » | 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.mm
diff --git a/media/video/capture/mac/video_capture_device_mac.mm b/media/video/capture/mac/video_capture_device_mac.mm
index 1ae1ba284eca4790fc0e5d42a7e149e88ccd4725..7b880377e5e83b632ffb21bd957f060b7bf35440 100644
--- a/media/video/capture/mac/video_capture_device_mac.mm
+++ b/media/video/capture/mac/video_capture_device_mac.mm
@@ -125,9 +125,8 @@ VideoCaptureDeviceMac::VideoCaptureDeviceMac(const Name& device_name)
tried_to_square_pixels_(false),
task_runner_(base::MessageLoopProxy::current()),
state_(kNotInitialized),
- weak_factory_(this),
- weak_this_(weak_factory_.GetWeakPtr()),
- capture_device_(nil) {
+ capture_device_(nil),
+ weak_factory_(this) {
final_resolution_selected_ = AVFoundationGlue::IsAVFoundationSupported();
}
@@ -313,8 +312,9 @@ void VideoCaptureDeviceMac::ReceiveFrame(
void VideoCaptureDeviceMac::ReceiveError(const std::string& reason) {
task_runner_->PostTask(FROM_HERE,
- base::Bind(&VideoCaptureDeviceMac::SetErrorState, weak_this_,
- reason));
+ base::Bind(&VideoCaptureDeviceMac::SetErrorState,
+ weak_factory_.GetWeakPtr(),
+ reason));
}
void VideoCaptureDeviceMac::SetErrorState(const std::string& reason) {
« no previous file with comments | « media/video/capture/mac/video_capture_device_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698