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

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 944033002: PPAPI: Whitelist PPB_CameraDevice_Private for some apps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix permission check Created 5 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 | « chrome/renderer/chrome_content_renderer_client.h ('k') | content/public/renderer/content_renderer_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/chrome_content_renderer_client.cc
diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
index ab0212949f54ab8b8919fab25b5b128df0a4146d..c7d5c90c8bc89e4dbd9f8ef0c28f2912753b3a28 100644
--- a/chrome/renderer/chrome_content_renderer_client.cc
+++ b/chrome/renderer/chrome_content_renderer_client.cc
@@ -181,6 +181,11 @@ namespace {
ChromeContentRendererClient* g_current_client;
#if defined(ENABLE_PLUGINS)
+const char* const kPredefinedAllowedCameraDeviceOrigins[] = {
+ "6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see crbug.com/383937
+ "4EB74897CB187C7633357C2FE832E0AD6A44883A" // see crbug.com/383937
Nico 2015/02/21 22:24:12 can we please stop whitelisting random extension i
Justin Chuang 2015/02/22 12:06:26 I don't know the whole story. Dave, would it hel
dmichael (off chromium) 2015/02/24 18:24:09 Sorry, Nico. This is born of wanting to provide AP
Justin Chuang 2015/02/25 03:59:02 I can do that only if it's not urgent. I may not b
+};
+
const char* const kPredefinedAllowedCompositorOrigins[] = {
"6EAED1924DB611B6EEF2A664BD077BE7EAD33B8F", // see crbug.com/383937
"4EB74897CB187C7633357C2FE832E0AD6A44883A" // see crbug.com/383937
@@ -1553,6 +1558,26 @@ bool ChromeContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
#endif
}
+bool ChromeContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI(
+ const GURL& url) {
+#if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS)
+ if (base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnablePepperTesting))
+ return true;
+
+ std::set<std::string> allowed_origins;
+ for (size_t i = 0; i < arraysize(kPredefinedAllowedCameraDeviceOrigins); ++i)
+ allowed_origins.insert(kPredefinedAllowedCameraDeviceOrigins[i]);
Nico 2015/02/21 23:21:02 (fwiw, the other whitelists build the set once in
Justin Chuang 2015/02/22 12:06:26 Done.
+ if (IsExtensionOrSharedModuleWhitelisted(url, allowed_origins))
+ return true;
+
+ chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel();
+ return channel <= chrome::VersionInfo::CHANNEL_DEV;
+#else
+ return false;
+#endif
+}
+
bool ChromeContentRendererClient::IsPluginAllowedToUseCompositorAPI(
const GURL& url) {
#if defined(ENABLE_PLUGINS) && defined(ENABLE_EXTENSIONS)
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.h ('k') | content/public/renderer/content_renderer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698