diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 22:24:51 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-28 22:24:51 +0000 |
commit | 2960ff9c5710d87b8008f493db48f7766d7264c6 (patch) | |
tree | 5dd5763899198d562635a31b20a47dbbf4bff8a8 /chrome/renderer/extensions | |
parent | 61b5fd31696961d51a7f0dc51d926ef1c0502f84 (diff) | |
download | chromium_src-2960ff9c5710d87b8008f493db48f7766d7264c6.zip chromium_src-2960ff9c5710d87b8008f493db48f7766d7264c6.tar.gz chromium_src-2960ff9c5710d87b8008f493db48f7766d7264c6.tar.bz2 |
Make a bunch of backlogged breaking changes to the extensions API in prep for dev:
* Enforce permissions on cross-origin XHR
* Enforce module-level permissions
* Decided not to completely remove chrome.self since it is so widely used, but removed all references to it from samples and docs.
BUG=16356,12129,12140
TEST=Sample extensions on http://dev.chromium.org/developers/design-documents/extensions/samples should still work
Review URL: http://codereview.chromium.org/179027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24816 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/extensions')
-rw-r--r-- | chrome/renderer/extensions/extension_process_bindings.cc | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc index 7fc6bda..0b019ae 100644 --- a/chrome/renderer/extensions/extension_process_bindings.cc +++ b/chrome/renderer/extensions/extension_process_bindings.cc @@ -250,11 +250,7 @@ class ExtensionImpl : public ExtensionBase { } if (!ExtensionProcessBindings::CurrentContextHasPermission(name)) { -#if EXTENSION_TIME_TO_BREAK_API return ExtensionProcessBindings::ThrowPermissionDeniedException(name); -#else - ExtensionProcessBindings::ThrowPermissionDeniedException(name); -#endif } std::string json_args = *v8::String::Utf8Value(args[1]); @@ -373,7 +369,7 @@ bool ExtensionProcessBindings::CurrentContextHasPermission( PermissionsMap::iterator it = permissions_map.find(permission_name); // We explicitly check if the permission entry is present and false, because - // some APIs do not have a required permission entry (ie, "chrome.self"). + // some APIs do not have a required permission entry (ie, "chrome.extension"). return (it == permissions_map.end() || it->second); } @@ -387,28 +383,6 @@ v8::Handle<v8::Value> std::string permission_name = GetPermissionName(function_name); std::string error_msg = StringPrintf(kMessage, permission_name.c_str()); -#if EXTENSION_TIME_TO_BREAK_API return v8::ThrowException(v8::Exception::Error( v8::String::New(error_msg.c_str()))); -#else - // Call console.error for now. - - v8::HandleScope scope; - - v8::Local<v8::Value> console = - v8::Context::GetCurrent()->Global()->Get(v8::String::New("console")); - v8::Local<v8::Value> console_error; - if (!console.IsEmpty() && console->IsObject()) - console_error = console->ToObject()->Get(v8::String::New("error")); - if (console_error.IsEmpty() || !console_error->IsFunction()) - return v8::Undefined(); - - v8::Local<v8::Function> function = - v8::Local<v8::Function>::Cast(console_error); - v8::Local<v8::Value> argv[] = { v8::String::New(error_msg.c_str()) }; - if (!function.IsEmpty()) - function->Call(console->ToObject(), arraysize(argv), argv); - - return v8::Undefined(); -#endif } |