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

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

Issue 248113003: Fix for closing the desktop sharing notification bar when the shared window is closed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 8 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_manager.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index a7cca9c22665fb08cd80f97f94c23d3908098d92..7d27f36acd1eaaee0e0acd2c2692455c88ae97a4 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -333,6 +333,32 @@ void VideoCaptureManager::StopCaptureForClient(
DestroyDeviceEntryIfNoClients(entry);
}
+void VideoCaptureManager::AbortCaptureForDeviceError(
+ VideoCaptureController* controller,
+ VideoCaptureControllerID client_id,
+ VideoCaptureControllerEventHandler* client_handler) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ DCHECK(controller);
+ DCHECK(client_handler);
+
+ DeviceEntry* entry = GetDeviceEntryForController(controller);
+ if (!entry) {
+ NOTREACHED();
+ return;
+ }
+
+ std::map<media::VideoCaptureSessionId, MediaStreamDevice>::iterator it;
mcasas 2014/04/24 11:09:47 nit: This data type std::map<media::VideoCaptureSe
jiayl 2014/04/24 18:11:13 Done.
+ for (it = sessions_.begin(); it != sessions_.end(); ++it) {
+ if (it->second.type == entry->stream_type &&
+ it->second.id == entry->id)
+ break;
+ }
+
mcasas 2014/04/24 11:09:47 nit: no blank line?
jiayl 2014/04/24 18:11:13 Done.
+ listener_->Aborted(it->second.type, it->first);
mcasas 2014/04/24 11:09:47 What happens if it->second.{id,type} has not been
jiayl 2014/04/24 18:11:13 Done.
+
+ StopCaptureForClient(controller, client_id, client_handler);
mcasas 2014/04/24 11:09:47 StopCaptureForClient() has overlapping boilerplate
jiayl 2014/04/24 18:11:13 Done.
+}
+
bool VideoCaptureManager::GetDeviceSupportedFormats(
media::VideoCaptureSessionId capture_session_id,
media::VideoCaptureFormats* supported_formats) {
@@ -567,9 +593,9 @@ VideoCaptureManager::GetDeviceEntryForMediaStreamDevice(
VideoCaptureManager::DeviceEntry*
VideoCaptureManager::GetDeviceEntryForController(
- const VideoCaptureController* controller) {
+ const VideoCaptureController* controller) const {
// Look up |controller| in |devices_|.
- for (DeviceEntries::iterator it = devices_.begin();
+ for (DeviceEntries::const_iterator it = devices_.begin();
it != devices_.end(); ++it) {
if ((*it)->video_capture_controller.get() == controller) {
return *it;

Powered by Google App Engine
This is Rietveld 408576698