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

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

Issue 12180015: Revert 180370 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 10 months 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_manager.cc
===================================================================
--- content/browser/renderer_host/media/media_stream_manager.cc (revision 180458)
+++ content/browser/renderer_host/media/media_stream_manager.cc (working copy)
@@ -32,6 +32,10 @@
#include "base/win/scoped_com_initializer.h"
#endif
+namespace {
+const char kExtensionScheme[] = "chrome-extension";
+} // namespace
+
namespace content {
// Creates a random label used to identify requests.
@@ -241,17 +245,18 @@
int target_render_process_id = -1;
int target_render_view_id = -1;
- // We will post the request to the render view that is the target of the
- // capture.
+ // We will post the request to the target render view, not the source (i.e.
+ // source is an extension, and target is the tab we want to capture).
bool has_valid_device_id = WebContentsCaptureUtil::ExtractTabCaptureTarget(
device_id, &target_render_process_id, &target_render_view_id);
if (!has_valid_device_id ||
+ !security_origin.SchemeIs(kExtensionScheme) ||
(options.audio_type != MEDIA_TAB_AUDIO_CAPTURE &&
options.audio_type != MEDIA_NO_SERVICE) ||
(options.video_type != MEDIA_TAB_VIDEO_CAPTURE &&
options.video_type != MEDIA_NO_SERVICE)) {
- LOG(ERROR) << "Invalid request.";
+ LOG(ERROR) << "Invalid request or used tab capture outside extension API.";
return std::string();
}
« 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