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

Unified Diff: chrome/renderer/extensions/chrome_private_custom_bindings.cc

Issue 9317013: Add a centralized mechanism for whitelisting access to extension permissions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: update CanSpecifyAPIPermission logic Created 8 years, 11 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
Index: chrome/renderer/extensions/chrome_private_custom_bindings.cc
diff --git a/chrome/renderer/extensions/chrome_private_custom_bindings.cc b/chrome/renderer/extensions/chrome_private_custom_bindings.cc
index 223f197f9b82aa67234e4ca3aedadfba43d35de3..a1e4fbb796ccc25f306a21c7f33a40536ca5638c 100644
--- a/chrome/renderer/extensions/chrome_private_custom_bindings.cc
+++ b/chrome/renderer/extensions/chrome_private_custom_bindings.cc
@@ -31,25 +31,12 @@ ChromePrivateCustomBindings::ChromePrivateCustomBindings(
// static
v8::Handle<v8::Value> ChromePrivateCustomBindings::DecodeJPEG(
const v8::Arguments& args) {
- static const char* kAllowedIds[] = {
- "haiffjcadagjlijoggckpgfnoeiflnem",
- "gnedhmakppccajfpfiihfcdlnpgomkcf",
- "fjcibdnjlbfnbfdjneajpipnlcppleek",
- "oflbaaikkabfdfkimeclgkackhdkpnip" // Testing extension.
- };
- const std::vector<std::string> allowed_ids(
- kAllowedIds, kAllowedIds + arraysize(kAllowedIds));
-
ChromePrivateCustomBindings* v8_extension =
GetFromArguments<ChromePrivateCustomBindings>(args);
const ::Extension* extension =
v8_extension->GetExtensionForCurrentRenderView();
if (!extension)
return v8::Undefined();
- if (allowed_ids.end() == std::find(
- allowed_ids.begin(), allowed_ids.end(), extension->id())) {
- return v8::Undefined();
- }
DCHECK(args.Length() == 1);
DCHECK(args[0]->IsArray());

Powered by Google App Engine
This is Rietveld 408576698