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

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

Issue 63673006: Fix cancelling of device enumeration requests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_stream_dispatcher_host.cc
diff --git a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
index e235d806df09e6f82b658b68389df90f2deba761..366ca3bd7977b9f3587a1c7734efa15da8598d0f 100644
--- a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
@@ -95,6 +95,8 @@ bool MediaStreamDispatcherHost::OnMessageReceived(
OnStopStreamDevice)
IPC_MESSAGE_HANDLER(MediaStreamHostMsg_EnumerateDevices,
OnEnumerateDevices)
+ IPC_MESSAGE_HANDLER(MediaStreamHostMsg_CancelEnumerateDevices,
+ OnCancelEnumerateDevices)
IPC_MESSAGE_HANDLER(MediaStreamHostMsg_OpenDevice,
OnOpenDevice)
IPC_MESSAGE_HANDLER(MediaStreamHostMsg_CloseDevice,
@@ -192,6 +194,11 @@ void MediaStreamDispatcherHost::OnCancelEnumerateDevices(
<< render_view_id << ", "
<< label << ")";
+ if (streams_.find(label) == streams_.end()) {
+ // According to the comments in MediaStreamDispatcher::OnDevicesEnumerated,
+ // OnCancelEnumerateDevices can be called several times with the same label.
tommi (sloooow) - chröme 2013/11/18 10:01:50 is this worth a DVLOG(1)?
+ return;
+ }
media_stream_manager_->CancelRequest(label);
PopRequest(label);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698