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

Unified Diff: extensions/renderer/api_binding_js_util.h

Issue 2912883004: [Extensions Bindings] Don't allow `event` module with native bindings (Closed)
Patch Set: jbroman'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
Index: extensions/renderer/api_binding_js_util.h
diff --git a/extensions/renderer/api_binding_js_util.h b/extensions/renderer/api_binding_js_util.h
index e4b4aadf58755fade2b7f896858bb0584979ce2b..ba94fd518e44edf73f2f4a4b504f4e1235933f13 100644
--- a/extensions/renderer/api_binding_js_util.h
+++ b/extensions/renderer/api_binding_js_util.h
@@ -26,7 +26,7 @@ class APITypeReferenceMap;
// some of our JS bindings, we can reduce or remove this class.
class APIBindingJSUtil final : public gin::Wrappable<APIBindingJSUtil> {
public:
- APIBindingJSUtil(const APITypeReferenceMap* type_refs,
+ APIBindingJSUtil(APITypeReferenceMap* type_refs,
APIRequestHandler* request_handler,
APIEventHandler* event_handler,
const binding::RunJSFunction& run_js);
@@ -55,8 +55,6 @@ class APIBindingJSUtil final : public gin::Wrappable<APIBindingJSUtil> {
// A handler to allow custom bindings to create custom extension API event
// objects (e.g. foo.onBar).
- // Note: The JS version allows for constructing declarative events; it's
- // unclear if we'll need to support this.
// TODO(devlin): Currently, we ignore schema. We may want to take it into
// account.
void CreateCustomEvent(gin::Arguments* arguments,
@@ -64,6 +62,14 @@ class APIBindingJSUtil final : public gin::Wrappable<APIBindingJSUtil> {
v8::Local<v8::Value> unused_schema,
bool supports_filters);
+ // Creates a new declarative event.
+ void CreateCustomDeclarativeEvent(
+ gin::Arguments* arguments,
+ const std::string& event_name,
+ const std::vector<std::string>& actions_list,
+ const std::vector<std::string>& conditions_list,
+ int webview_id);
lazyboy 2017/06/13 17:46:00 nit: webview_instance_id
Devlin 2017/06/13 22:30:53 Done.
+
// Invalidates an event, removing its listeners and preventing any more from
// being added.
void InvalidateEvent(gin::Arguments* arguments, v8::Local<v8::Object> event);
@@ -84,7 +90,7 @@ class APIBindingJSUtil final : public gin::Wrappable<APIBindingJSUtil> {
v8::Local<v8::Function> callback);
// Type references. Guaranteed to outlive this object.
- const APITypeReferenceMap* type_refs_;
+ APITypeReferenceMap* type_refs_;
// The request handler. Guaranteed to outlive this object.
APIRequestHandler* request_handler_;

Powered by Google App Engine
This is Rietveld 408576698