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

Unified Diff: content/renderer/pepper/pepper_audio_input_host.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_audio_input_host.cc
diff --git a/content/renderer/pepper/pepper_audio_input_host.cc b/content/renderer/pepper/pepper_audio_input_host.cc
index 59b4f98e0cd5be364a3d48013336dd255d243fec..19aa2b1b285ffe9835c4ce1b994915de413d3248 100644
--- a/content/renderer/pepper/pepper_audio_input_host.cc
+++ b/content/renderer/pepper/pepper_audio_input_host.cc
@@ -17,9 +17,6 @@
#include "ppapi/host/ppapi_host.h"
#include "ppapi/proxy/ppapi_messages.h"
#include "ppapi/proxy/serialized_structs.h"
-#include "third_party/WebKit/public/web/WebDocument.h"
-#include "third_party/WebKit/public/web/WebElement.h"
-#include "third_party/WebKit/public/web/WebPluginContainer.h"
namespace content {
@@ -53,7 +50,8 @@ PepperAudioInputHost::PepperAudioInputHost(
this,
PepperMediaDeviceManager::GetForRenderView(
host->GetRenderViewForInstance(pp_instance())),
- PP_DEVICETYPE_DEV_AUDIOCAPTURE) {
+ PP_DEVICETYPE_DEV_AUDIOCAPTURE,
+ host->GetDocumentURL(instance)) {
}
PepperAudioInputHost::~PepperAudioInputHost() {
@@ -99,9 +97,8 @@ int32_t PepperAudioInputHost::OnOpen(
if (audio_input_)
return PP_ERROR_FAILED;
- PepperPluginInstanceImpl* instance =
- renderer_ppapi_host_->GetPluginInstanceImpl(pp_instance());
- if (!instance)
+ GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance());
+ if (!document_url.is_valid())
return PP_ERROR_FAILED;
// When it is done, we'll get called back on StreamCreated() or
@@ -111,7 +108,7 @@ int32_t PepperAudioInputHost::OnOpen(
audio_input_ = PepperPlatformAudioInput::Create(
render_view->AsWeakPtr(), device_id,
- instance->container()->element().document().url(),
+ document_url,
static_cast<int>(sample_rate),
static_cast<int>(sample_frame_count), this);
if (audio_input_) {
« no previous file with comments | « content/renderer/pepper/mock_renderer_ppapi_host.cc ('k') | content/renderer/pepper/pepper_device_enumeration_host_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698