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

Unified Diff: extensions/renderer/api_binding.h

Issue 2947843004: [Extensions Bindings] Introduce BindingAccessChecker (Closed)
Patch Set: lazyboy's Created 3 years, 6 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/BUILD.gn ('k') | extensions/renderer/api_binding.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_binding.h
diff --git a/extensions/renderer/api_binding.h b/extensions/renderer/api_binding.h
index 27d0926535a389ceaa828f038b4bc69b3fd8fd35..8cd3e81942388debab461a3866302f7776278dce 100644
--- a/extensions/renderer/api_binding.h
+++ b/extensions/renderer/api_binding.h
@@ -30,6 +30,7 @@ class APIEventHandler;
class APIRequestHandler;
class APISignature;
class APITypeReferenceMap;
+class BindingAccessChecker;
namespace binding {
enum class RequestThread;
@@ -51,11 +52,6 @@ class APIBinding {
const std::string& property_name,
const base::ListValue* property_values)>;
- // The callback for determining if a given API feature (specified by |name|)
- // is available in the given context.
- using AvailabilityCallback =
- base::Callback<bool(v8::Local<v8::Context>, const std::string& name)>;
-
// The callback type for handling an API call.
using HandlerCallback = base::Callback<void(gin::Arguments*)>;
@@ -68,11 +64,11 @@ class APIBinding {
const base::ListValue* event_definitions,
const base::DictionaryValue* property_definitions,
const CreateCustomType& create_custom_type,
- const AvailabilityCallback& is_available,
std::unique_ptr<APIBindingHooks> binding_hooks,
APITypeReferenceMap* type_refs,
APIRequestHandler* request_handler,
- APIEventHandler* event_handler);
+ APIEventHandler* event_handler,
+ BindingAccessChecker* access_checker);
~APIBinding();
// Returns a new v8::Object for the API this APIBinding represents.
@@ -135,9 +131,6 @@ class APIBinding {
// The callback for constructing a custom type.
CreateCustomType create_custom_type_;
- // The callback for checking availability of an API feature.
- AvailabilityCallback is_available_;
-
// The registered hooks for this API.
std::unique_ptr<APIBindingHooks> binding_hooks_;
@@ -152,6 +145,9 @@ class APIBinding {
// Required to outlive this object.
APIEventHandler* event_handler_;
+ // The associated access checker; required to outlive this object.
+ const BindingAccessChecker* const access_checker_;
+
// The template for this API. Note: some methods may only be available in
// certain contexts, but this template contains all methods. Those that are
// unavailable are removed after object instantiation.
« no previous file with comments | « extensions/renderer/BUILD.gn ('k') | extensions/renderer/api_binding.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698