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

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

Issue 11451006: Make TabCapture requests use the target render process and render view id's for UI permissions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove early return Created 8 years 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/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 3fe78916049898a10ed252d66703ba338d9f9ed6..5aab3e50babe9869133861db0b00b1568a879f02 100644
--- a/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/media_stream_dispatcher_host.cc
@@ -142,15 +142,15 @@ void MediaStreamDispatcherHost::OnGenerateStream(
std::string label;
if (components.audio_type == MEDIA_TAB_AUDIO_CAPTURE ||
components.video_type == MEDIA_TAB_VIDEO_CAPTURE) {
- DCHECK(!components.video_device_id.empty());
-
- // Append our tab capture device id scheme.
+ // Append our tab capture device id scheme. It's OK if both device_id's
+ // are empty since we check their validity in GenerateStreamForDevice.
// TODO(justinlin): This is kind of a hack, but the plumbing for audio
// streams is too complicated to plumb in by type. Will revisit once it's
// refactored. http://crbug.com/163100
const std::string& device_id =
WebContentsCaptureUtil::AppendWebContentsDeviceScheme(
- components.video_device_id);
+ components.video_device_id.empty() ?
+ components.video_device_id : components.audio_device_id);
// TODO(justinlin): Cleanup/get rid of GenerateStreamForDevice and merge
// with the regular GenerateStream.

Powered by Google App Engine
This is Rietveld 408576698