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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // MacOSX implementation of generic VideoCaptureDevice, using either QTKit or 5 // MacOSX implementation of generic VideoCaptureDevice, using either QTKit or
6 // AVFoundation as native capture API. QTKit is used in OSX versions 10.6 and 6 // AVFoundation as native capture API. QTKit is used in OSX versions 10.6 and
7 // previous, and AVFoundation is used in the rest. 7 // previous, and AVFoundation is used in the rest.
8 8
9 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ 9 #ifndef MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_
10 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ 10 #define MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // the device is first started with no configuration and the captured frames 69 // the device is first started with no configuration and the captured frames
70 // are inspected to check if the camera really supports HD. AVFoundation does 70 // are inspected to check if the camera really supports HD. AVFoundation does
71 // not need this process so |final_resolution_selected_| is false then. 71 // not need this process so |final_resolution_selected_| is false then.
72 bool final_resolution_selected_; 72 bool final_resolution_selected_;
73 bool tried_to_square_pixels_; 73 bool tried_to_square_pixels_;
74 74
75 // Only read and write state_ from inside this loop. 75 // Only read and write state_ from inside this loop.
76 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 76 const scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
77 InternalState state_; 77 InternalState state_;
78 78
79 // Used with Bind and PostTask to ensure that methods aren't called 79 id<PlatformVideoCapturingMac> capture_device_;
80 // after the VideoCaptureDeviceMac is destroyed. 80
81 // Used with Bind and PostTask to ensure that methods aren't called after the
82 // VideoCaptureDeviceMac is destroyed.
83 // NOTE: Weak pointers must be invalidated before all other member variables.
81 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_; 84 base::WeakPtrFactory<VideoCaptureDeviceMac> weak_factory_;
82 base::WeakPtr<VideoCaptureDeviceMac> weak_this_;
83
84 id<PlatformVideoCapturingMac> capture_device_;
85 85
86 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac); 86 DISALLOW_COPY_AND_ASSIGN(VideoCaptureDeviceMac);
87 }; 87 };
88 88
89 } // namespace media 89 } // namespace media
90 90
91 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_ 91 #endif // MEDIA_VIDEO_CAPTURE_MAC_VIDEO_CAPTURE_DEVICE_MAC_H_
OLDNEW
« 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