Chromium Code Reviews| 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; |