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

Unified Diff: content/browser/renderer_host/media/video_capture_host.cc

Issue 2673373003: getUserMeida: report device starting states (Closed)
Patch Set: address comments on PS#8 Created 3 years, 10 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: content/browser/renderer_host/media/video_capture_host.cc
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc
index 44286425747ce054da13965b243de000de33dc42..c37b8b7dedf69598ed7a4ae36adb0640ce6f75b7 100644
--- a/content/browser/renderer_host/media/video_capture_host.cc
+++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -108,6 +108,18 @@ void VideoCaptureHost::OnEnded(VideoCaptureControllerID controller_id) {
controller_id));
}
+void VideoCaptureHost::OnStarted(VideoCaptureControllerID controller_id) {
+ DVLOG(1) << __func__;
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ if (controllers_.find(controller_id) == controllers_.end())
+ return;
+
+ if (base::ContainsKey(device_id_to_observer_map_, controller_id)) {
+ device_id_to_observer_map_[controller_id]->OnStateChanged(
+ mojom::VideoCaptureState::STARTED);
+ }
+}
+
void VideoCaptureHost::Start(int32_t device_id,
int32_t session_id,
const media::VideoCaptureParams& params,
@@ -296,11 +308,6 @@ void VideoCaptureHost::OnControllerAdded(
return;
}
- if (base::ContainsKey(device_id_to_observer_map_, controller_id)) {
- device_id_to_observer_map_[device_id]->OnStateChanged(
- mojom::VideoCaptureState::STARTED);
- }
-
DCHECK(!it->second);
it->second = controller;
}

Powered by Google App Engine
This is Rietveld 408576698