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

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

Issue 11298006: Browser-wide audio mirroring for TabCapture API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
Index: content/browser/renderer_host/media/web_contents_video_capture_device.cc
diff --git a/content/browser/renderer_host/media/web_contents_video_capture_device.cc b/content/browser/renderer_host/media/web_contents_video_capture_device.cc
index cfb1e8e539d9e597454f6a2754e90459f7bf3701..e22e7b85c2f9e0b83f612704091a7f4fc5232ce9 100644
--- a/content/browser/renderer_host/media/web_contents_video_capture_device.cc
+++ b/content/browser/renderer_host/media/web_contents_video_capture_device.cc
@@ -52,6 +52,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/string_number_conversions.h"
#include "base/string_piece.h"
+#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/synchronization/lock.h"
#include "base/threading/thread.h"
@@ -62,6 +63,7 @@
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_observer.h"
+#include "content/public/common/media_stream_request.h"
#include "media/base/bind_to_loop.h"
#include "media/video/capture/video_capture_types.h"
#include "skia/ext/image_operations.h"
@@ -970,7 +972,13 @@ WebContentsVideoCaptureDevice::~WebContentsVideoCaptureDevice() {
// static
media::VideoCaptureDevice* WebContentsVideoCaptureDevice::Create(
- const std::string& device_id) {
+ const std::string& device_id_param) {
+ DCHECK(StartsWithASCII(device_id_param,
+ content::kMediaStreamTabDeviceScheme, true));
+ const std::string device_id = device_id_param.substr(
+ strlen(content::kMediaStreamTabDeviceScheme),
+ device_id_param.length());
+
// Parse device_id into render_process_id and render_view_id.
const size_t sep_pos = device_id.find(':');
if (sep_pos == std::string::npos) {

Powered by Google App Engine
This is Rietveld 408576698