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

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

Issue 2882133002: Block insecure pepper media requests in the renderer (Closed)
Patch Set: Block insecure pepper media requests Created 3 years, 7 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 | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/pepper/renderer_ppapi_host_impl.cc
diff --git a/content/renderer/pepper/renderer_ppapi_host_impl.cc b/content/renderer/pepper/renderer_ppapi_host_impl.cc
index 32bf18f46d4756c202029adbe1d56ca29e360584..0e4274a98999ab1dcdd1e347c03deef5b57dc656 100644
--- a/content/renderer/pepper/renderer_ppapi_host_impl.cc
+++ b/content/renderer/pepper/renderer_ppapi_host_impl.cc
@@ -11,6 +11,7 @@
#include "base/process/process_handle.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "content/public/common/origin_util.h"
#include "content/renderer/pepper/fullscreen_container.h"
#include "content/renderer/pepper/host_globals.h"
#include "content/renderer/pepper/pepper_browser_connection.h"
@@ -278,6 +279,14 @@ GURL RendererPpapiHostImpl::GetDocumentURL(PP_Instance pp_instance) const {
return instance->document_url();
}
+bool RendererPpapiHostImpl::IsSecureContext(PP_Instance pp_instance) const {
+ PepperPluginInstanceImpl* instance = GetAndValidateInstance(pp_instance);
+ if (!instance)
+ return false;
+ return instance->GetContainer()->GetDocument().IsSecureContext() &&
+ content::IsOriginSecure(instance->GetPluginURL());
+}
+
PepperPluginInstanceImpl* RendererPpapiHostImpl::GetAndValidateInstance(
PP_Instance pp_instance) const {
PepperPluginInstanceImpl* instance =
« no previous file with comments | « content/renderer/pepper/renderer_ppapi_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698