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

Unified Diff: media/capture/video/android/video_capture_device_android.h

Issue 2186043002: VideoCaptureDeviceAndroid: add ThreadChecker, lock access to |client_|, mini cleanup (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added more |lock_| protections for |client_| accessing Created 4 years, 5 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 | « no previous file | media/capture/video/android/video_capture_device_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/capture/video/android/video_capture_device_android.h
diff --git a/media/capture/video/android/video_capture_device_android.h b/media/capture/video/android/video_capture_device_android.h
index 8845c33e740fbbb2a701ad18e457b14c3beee853..5b33e62961a1f44891e7e64d58b8096c06679093 100644
--- a/media/capture/video/android/video_capture_device_android.h
+++ b/media/capture/video/android/video_capture_device_android.h
@@ -12,6 +12,7 @@
#include "base/macros.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
+#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "media/capture/capture_export.h"
#include "media/capture/video/video_capture_device.h"
@@ -103,15 +104,18 @@ class CAPTURE_EXPORT VideoCaptureDeviceAndroid : public VideoCaptureDevice {
void SetErrorState(const tracked_objects::Location& from_here,
const std::string& reason);
+ base::ThreadChecker thread_checker_;
+
// Prevent racing on accessing |state_| and |client_| since both could be
// accessed from different threads.
base::Lock lock_;
InternalState state_;
+ std::unique_ptr<VideoCaptureDevice::Client> client_;
+
bool got_first_frame_;
base::TimeTicks expected_next_frame_time_;
base::TimeTicks first_ref_time_;
base::TimeDelta frame_interval_;
- std::unique_ptr<VideoCaptureDevice::Client> client_;
// List of |photo_callbacks_| in flight, being served in Java side.
base::Lock photo_callbacks_lock_;
« no previous file with comments | « no previous file | media/capture/video/android/video_capture_device_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698