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

Unified Diff: content/renderer/pepper/pepper_video_capture_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_video_capture_host.cc
diff --git a/content/renderer/pepper/pepper_video_capture_host.cc b/content/renderer/pepper/pepper_video_capture_host.cc
index 9143aa932d76fff0cfc3364aef41d3dee69b63d4..86a7da4165ea7e70f730e1694896aacba89e6279 100644
--- a/content/renderer/pepper/pepper_video_capture_host.cc
+++ b/content/renderer/pepper/pepper_video_capture_host.cc
@@ -17,9 +17,6 @@
#include "ppapi/shared_impl/host_resource.h"
#include "ppapi/thunk/enter.h"
#include "ppapi/thunk/ppb_buffer_api.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"
using ppapi::HostResource;
using ppapi::TrackedCallback;
@@ -46,7 +43,8 @@ PepperVideoCaptureHost::PepperVideoCaptureHost(RendererPpapiHostImpl* host,
this,
PepperMediaDeviceManager::GetForRenderView(
host->GetRenderViewForInstance(pp_instance())),
- PP_DEVICETYPE_DEV_VIDEOCAPTURE) {
+ PP_DEVICETYPE_DEV_VIDEOCAPTURE,
+ host->GetDocumentURL(instance)) {
}
PepperVideoCaptureHost::~PepperVideoCaptureHost() {
@@ -275,9 +273,8 @@ int32_t PepperVideoCaptureHost::OnOpen(
SetRequestedInfo(requested_info, buffer_count);
- PepperPluginInstance* instance =
- renderer_ppapi_host_->GetPluginInstance(pp_instance());
- if (!instance)
+ GURL document_url = renderer_ppapi_host_->GetDocumentURL(pp_instance());
+ if (!document_url.is_valid())
return PP_ERROR_FAILED;
RenderViewImpl* render_view = static_cast<RenderViewImpl*>(
@@ -285,7 +282,7 @@ int32_t PepperVideoCaptureHost::OnOpen(
platform_video_capture_ = new PepperPlatformVideoCapture(
render_view->AsWeakPtr(), device_id,
- instance->GetContainer()->element().document().url(), this);
+ document_url, this);
open_reply_context_ = context->MakeReplyMessageContext();
« no previous file with comments | « content/renderer/pepper/pepper_media_device_manager.cc ('k') | content/renderer/pepper/renderer_ppapi_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698