summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/renderer/extensions/event_bindings.cc7
-rw-r--r--chrome/renderer/extensions/extension_process_bindings.cc7
2 files changed, 12 insertions, 2 deletions
diff --git a/chrome/renderer/extensions/event_bindings.cc b/chrome/renderer/extensions/event_bindings.cc
index fcc0bcf..5003b82 100644
--- a/chrome/renderer/extensions/event_bindings.cc
+++ b/chrome/renderer/extensions/event_bindings.cc
@@ -79,10 +79,15 @@ class ExtensionImpl : public ExtensionBase {
std::string event_name(*v8::String::AsciiValue(args[0]));
bool has_permission =
ExtensionProcessBindings::CurrentContextHasPermission(event_name);
+#if EXTENSION_TIME_TO_BREAK_API
+ bool allow_api = has_permission;
+#else
+ bool allow_api = true;
+#endif
// Increment the count even if the caller doesn't have permission, so that
// refcounts stay balanced.
- if (EventIncrementListenerCount(event_name) == 1 && has_permission) {
+ if (EventIncrementListenerCount(event_name) == 1 && allow_api) {
EventBindings::GetRenderThread()->Send(
new ViewHostMsg_ExtensionAddListener(event_name));
}
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc
index 78afca5..cf0f344 100644
--- a/chrome/renderer/extensions/extension_process_bindings.cc
+++ b/chrome/renderer/extensions/extension_process_bindings.cc
@@ -202,8 +202,13 @@ class ExtensionImpl : public ExtensionBase {
return v8::Undefined();
}
- if (!ExtensionProcessBindings::CurrentContextHasPermission(name))
+ 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]);
int request_id = args[2]->Int32Value();