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

Unified Diff: content/renderer/pepper/pepper_device_enumeration_host_helper.cc

Issue 48743008: Pepper: specify the security origin when enumerating media devices. (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
Index: content/renderer/pepper/pepper_device_enumeration_host_helper.cc
diff --git a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
index 9ec6373a096b88704ac2b648b52716becb6a8893..70a2876a96d6d40f1a9b538b601329b56b6c69ed 100644
--- a/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
+++ b/content/renderer/pepper/pepper_device_enumeration_host_helper.cc
@@ -34,6 +34,9 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest
requested_(false),
request_id_(0),
sync_call_(false) {
+ if (!owner_->document_url_.is_valid())
+ return;
+
requested_ = true;
// Note that the callback passed into
@@ -46,6 +49,7 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest
sync_call_ = true;
request_id_ = owner_->delegate_->EnumerateDevices(
owner_->device_type_,
+ owner_->document_url_,
base::Bind(&ScopedRequest::EnumerateDevicesCallbackBody, AsWeakPtr()));
sync_call_ = false;
}
@@ -91,10 +95,12 @@ class PepperDeviceEnumerationHostHelper::ScopedRequest
PepperDeviceEnumerationHostHelper::PepperDeviceEnumerationHostHelper(
ppapi::host::ResourceHost* resource_host,
Delegate* delegate,
- PP_DeviceType_Dev device_type)
+ PP_DeviceType_Dev device_type,
+ const GURL& document_url)
: resource_host_(resource_host),
delegate_(delegate),
- device_type_(device_type) {
+ device_type_(device_type),
+ document_url_(document_url) {
}
PepperDeviceEnumerationHostHelper::~PepperDeviceEnumerationHostHelper() {

Powered by Google App Engine
This is Rietveld 408576698