diff options
author | jiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 02:17:17 +0000 |
---|---|---|
committer | jiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-30 02:17:17 +0000 |
commit | 9b953806467ee96c401de78c6b2cb8be8ef626c0 (patch) | |
tree | f76ff894f8078dd8ebce0ab0f8afee306308f5bd /content/browser/renderer_host/media/video_capture_host.cc | |
parent | 673b8465ee28cc492b2328f29668efb2a788c42d (diff) | |
download | chromium_src-9b953806467ee96c401de78c6b2cb8be8ef626c0.zip chromium_src-9b953806467ee96c401de78c6b2cb8be8ef626c0.tar.gz chromium_src-9b953806467ee96c401de78c6b2cb8be8ef626c0.tar.bz2 |
Fix for closing the desktop sharing notification bar when the shared window is closed.
Previously MediaStreamManager is not notified when a video capturing device has stopped due to error (e.g. the shared window is closed), so the notification UI is still shown when the stream already stopped.
This change fixes it by populating the state to MediaStreamManager through VideoCaptureHost --> VidoeCaptureManager --> MediaStreamProviderListner.
BUG=360181
Review URL: https://codereview.chromium.org/248113003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@267045 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/renderer_host/media/video_capture_host.cc')
-rw-r--r-- | content/browser/renderer_host/media/video_capture_host.cc | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc index f261995..43bc404 100644 --- a/content/browser/renderer_host/media/video_capture_host.cc +++ b/content/browser/renderer_host/media/video_capture_host.cc @@ -27,7 +27,7 @@ void VideoCaptureHost::OnChannelClosing() { if (controller) { VideoCaptureControllerID controller_id(it->first); media_stream_manager_->video_capture_manager()->StopCaptureForClient( - controller.get(), controller_id, this); + controller.get(), controller_id, this, false); ++it; } else { // Remove the entry for this controller_id so that when the controller @@ -177,7 +177,7 @@ void VideoCaptureHost::DoHandleErrorOnIOThread( Send(new VideoCaptureMsg_StateChanged(controller_id.device_id, VIDEO_CAPTURE_STATE_ERROR)); - DeleteVideoCaptureControllerOnIOThread(controller_id); + DeleteVideoCaptureControllerOnIOThread(controller_id, true); } void VideoCaptureHost::DoEndedOnIOThread( @@ -189,7 +189,7 @@ void VideoCaptureHost::DoEndedOnIOThread( Send(new VideoCaptureMsg_StateChanged(controller_id.device_id, VIDEO_CAPTURE_STATE_ENDED)); - DeleteVideoCaptureControllerOnIOThread(controller_id); + DeleteVideoCaptureControllerOnIOThread(controller_id, false); } /////////////////////////////////////////////////////////////////////////////// @@ -261,7 +261,7 @@ void VideoCaptureHost::DoControllerAddedOnIOThread( if (it == entries_.end()) { if (controller) { media_stream_manager_->video_capture_manager()->StopCaptureForClient( - controller.get(), controller_id, this); + controller.get(), controller_id, this, false); } return; } @@ -285,7 +285,7 @@ void VideoCaptureHost::OnStopCapture(int device_id) { Send(new VideoCaptureMsg_StateChanged(device_id, VIDEO_CAPTURE_STATE_STOPPED)); - DeleteVideoCaptureControllerOnIOThread(controller_id); + DeleteVideoCaptureControllerOnIOThread(controller_id, false); } void VideoCaptureHost::OnPauseCapture(int device_id) { @@ -344,7 +344,7 @@ void VideoCaptureHost::OnGetDeviceFormatsInUse( } void VideoCaptureHost::DeleteVideoCaptureControllerOnIOThread( - const VideoCaptureControllerID& controller_id) { + const VideoCaptureControllerID& controller_id, bool on_error) { DCHECK_CURRENTLY_ON(BrowserThread::IO); EntryMap::iterator it = entries_.find(controller_id); @@ -353,7 +353,7 @@ void VideoCaptureHost::DeleteVideoCaptureControllerOnIOThread( if (it->second) { media_stream_manager_->video_capture_manager()->StopCaptureForClient( - it->second.get(), controller_id, this); + it->second.get(), controller_id, this, on_error); } entries_.erase(it); } |