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

Side by Side Diff: extensions/renderer/api_binding_js_util.h

Issue 2768093002: [Reland][Extensions Bindings] Add support for filtered events (Closed)
Patch Set: Fix Created 3 years, 9 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 unified diff | Download patch
« no previous file with comments | « extensions/renderer/api_binding.cc ('k') | extensions/renderer/api_binding_js_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef EXTENSIONS_RENDERER_API_BINDING_JS_UTIL_H_ 5 #ifndef EXTENSIONS_RENDERER_API_BINDING_JS_UTIL_H_
6 #define EXTENSIONS_RENDERER_API_BINDING_JS_UTIL_H_ 6 #define EXTENSIONS_RENDERER_API_BINDING_JS_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 const std::vector<v8::Local<v8::Value>>& request_args); 44 const std::vector<v8::Local<v8::Value>>& request_args);
45 45
46 // A handler to register an argument massager for a specific event. 46 // A handler to register an argument massager for a specific event.
47 // Replacement for event_bindings.registerArgumentMassager. 47 // Replacement for event_bindings.registerArgumentMassager.
48 void RegisterEventArgumentMassager(gin::Arguments* arguments, 48 void RegisterEventArgumentMassager(gin::Arguments* arguments,
49 const std::string& event_name, 49 const std::string& event_name,
50 v8::Local<v8::Function> massager); 50 v8::Local<v8::Function> massager);
51 51
52 // A handler to allow custom bindings to create custom extension API event 52 // A handler to allow custom bindings to create custom extension API event
53 // objects (e.g. foo.onBar). 53 // objects (e.g. foo.onBar).
54 // TODO(devlin): Currently, we ignore schema and options. We'll need to take 54 // Note: The JS version allows for constructing declarative events; it's
55 // at least options into account. 55 // unclear if we'll need to support this.
56 // TODO(devlin): Currently, we ignore schema. We may want to take it into
57 // account.
56 void CreateCustomEvent(gin::Arguments* arguments, 58 void CreateCustomEvent(gin::Arguments* arguments,
57 v8::Local<v8::Value> v8_event_name, 59 v8::Local<v8::Value> v8_event_name,
58 v8::Local<v8::Value> unused_schema, 60 v8::Local<v8::Value> unused_schema,
59 v8::Local<v8::Value> unused_event_options); 61 bool supports_filters);
60 62
61 // Invalidates an event, removing its listeners and preventing any more from 63 // Invalidates an event, removing its listeners and preventing any more from
62 // being added. 64 // being added.
63 void InvalidateEvent(gin::Arguments* arguments, v8::Local<v8::Object> event); 65 void InvalidateEvent(gin::Arguments* arguments, v8::Local<v8::Object> event);
64 66
65 // Type references. Guaranteed to outlive this object. 67 // Type references. Guaranteed to outlive this object.
66 const APITypeReferenceMap* type_refs_; 68 const APITypeReferenceMap* type_refs_;
67 69
68 // The request handler. Guaranteed to outlive this object. 70 // The request handler. Guaranteed to outlive this object.
69 APIRequestHandler* request_handler_; 71 APIRequestHandler* request_handler_;
70 72
71 // The event handler. Guaranteed to outlive this object. 73 // The event handler. Guaranteed to outlive this object.
72 APIEventHandler* event_handler_; 74 APIEventHandler* event_handler_;
73 75
74 DISALLOW_COPY_AND_ASSIGN(APIBindingJSUtil); 76 DISALLOW_COPY_AND_ASSIGN(APIBindingJSUtil);
75 }; 77 };
76 78
77 } // namespace extensions 79 } // namespace extensions
78 80
79 #endif // EXTENSIONS_RENDERER_API_BINDING_JS_UTIL_H_ 81 #endif // EXTENSIONS_RENDERER_API_BINDING_JS_UTIL_H_
OLDNEW
« no previous file with comments | « extensions/renderer/api_binding.cc ('k') | extensions/renderer/api_binding_js_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698