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

Unified Diff: extensions/renderer/api_binding.h

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month 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 480877c98c72501eee7d22c5f73bc2fedb8b51b3..4a4663681e68df0875d22b5807b896d71a75d68a 100644
--- a/extensions/renderer/api_binding.h
+++ b/extensions/renderer/api_binding.h
@@ -25,6 +25,7 @@ class Arguments;
}
namespace extensions {
+class APIEventHandler;
// A class that vends v8::Objects for extension APIs. These APIs have function
// interceptors for all exposed methods, which call back into the APIBinding.
@@ -54,10 +55,12 @@ class APIBinding {
using HandlerCallback = base::Callback<void(gin::Arguments*)>;
// The ArgumentSpec::RefMap is required to outlive this object.
- // |type_definitions| may be null if the API does not specify any types.
+ // |type_definitions| and |event_definitions| may be null if the API does not
+ // specify any types or events.
APIBinding(const std::string& name,
const base::ListValue& function_definitions,
const base::ListValue* type_definitions,
+ const base::ListValue* event_definitions,
const APIMethodCallback& callback,
ArgumentSpec::RefMap* type_refs);
~APIBinding();
@@ -66,6 +69,7 @@ class APIBinding {
v8::Local<v8::Object> CreateInstance(
v8::Local<v8::Context> context,
v8::Isolate* isolate,
+ APIEventHandler* event_handler,
const AvailabilityCallback& is_available);
private:
@@ -93,6 +97,9 @@ class APIBinding {
// A map from method name to expected signature.
std::map<std::string, std::unique_ptr<APISignature>> signatures_;
+ // The names of all events associated with this API.
+ std::vector<std::string> event_names_;
+
// The callback to use when an API is invoked with valid arguments.
APIMethodCallback method_callback_;
« 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