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

Unified Diff: extensions/renderer/api_bindings_system.cc

Issue 2891123002: [Extensions Bindings] Handle updating context permissions (Closed)
Patch Set: jbroman's 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 | « extensions/renderer/api_bindings_system.h ('k') | extensions/renderer/api_bindings_system_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_bindings_system.cc
diff --git a/extensions/renderer/api_bindings_system.cc b/extensions/renderer/api_bindings_system.cc
index 358eb6605856fc60a17dc724e60862cd50273476..552e8919f560cf1a896b371dcd71d77e52f2ccdb 100644
--- a/extensions/renderer/api_bindings_system.cc
+++ b/extensions/renderer/api_bindings_system.cc
@@ -15,6 +15,7 @@ APIBindingsSystem::APIBindingsSystem(
const binding::RunJSFunction& call_js,
const binding::RunJSFunctionSync& call_js_sync,
const GetAPISchemaMethod& get_api_schema,
+ const APIBinding::AvailabilityCallback& is_available,
const APIRequestHandler::SendRequestMethod& send_request,
const APIEventHandler::EventListenersChangedMethod& event_listeners_changed,
APILastError last_error)
@@ -24,21 +25,21 @@ APIBindingsSystem::APIBindingsSystem(
event_handler_(call_js, event_listeners_changed),
call_js_(call_js),
call_js_sync_(call_js_sync),
- get_api_schema_(get_api_schema) {}
+ get_api_schema_(get_api_schema),
+ is_available_(is_available) {}
APIBindingsSystem::~APIBindingsSystem() {}
v8::Local<v8::Object> APIBindingsSystem::CreateAPIInstance(
const std::string& api_name,
v8::Local<v8::Context> context,
- const APIBinding::AvailabilityCallback& is_available,
APIBindingHooks** hooks_out) {
std::unique_ptr<APIBinding>& binding = api_bindings_[api_name];
if (!binding)
binding = CreateNewAPIBinding(api_name);
if (hooks_out)
*hooks_out = binding->hooks();
- return binding->CreateInstance(context, is_available);
+ return binding->CreateInstance(context);
}
std::unique_ptr<APIBinding> APIBindingsSystem::CreateNewAPIBinding(
@@ -71,7 +72,7 @@ std::unique_ptr<APIBinding> APIBindingsSystem::CreateNewAPIBinding(
api_name, function_definitions, type_definitions, event_definitions,
property_definitions,
base::Bind(&APIBindingsSystem::CreateCustomType, base::Unretained(this)),
- std::move(hooks), &type_reference_map_, &request_handler_,
+ is_available_, std::move(hooks), &type_reference_map_, &request_handler_,
&event_handler_);
}
« no previous file with comments | « extensions/renderer/api_bindings_system.h ('k') | extensions/renderer/api_bindings_system_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698