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

Unified Diff: extensions/renderer/bindings/api_event_handler.h

Issue 2973903002: [Extensions Bindings] Introduce a supportsLazyListeners property (Closed)
Patch Set: onMessage event fix Created 3 years, 5 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/bindings/api_event_handler.h
diff --git a/extensions/renderer/bindings/api_event_handler.h b/extensions/renderer/bindings/api_event_handler.h
index edb744a3adba04afe92d546ec9d08f78ba1dd5ac..2e48fe84c2dfc30f1a700192540e05d74b4fa847 100644
--- a/extensions/renderer/bindings/api_event_handler.h
+++ b/extensions/renderer/bindings/api_event_handler.h
@@ -28,15 +28,17 @@ struct EventFilteringInfo;
// single thread.
class APIEventHandler {
public:
- // The callback to be called when event listeners change. |was_manual|
- // indicates that the change was due to an extension calling addListener or
- // removeListener, rather than through something like context destruction.
+ // The callback to be called when event listeners change.
+ // |update_lazy_listeners| indicates that the change was due to an extension
+ // calling addListener or removeListener on an event that supports lazy
+ // listeners, rather than through something like context destruction or
+ // removing a listener from an event that doesn't support lazy listeners.
// See also APIEventListeners.
using EventListenersChangedMethod =
base::Callback<void(const std::string& event_name,
binding::EventListenersChanged,
const base::DictionaryValue* filter,
- bool was_manual,
+ bool update_lazy_listeners,
v8::Local<v8::Context>)>;
APIEventHandler(const binding::RunJSFunction& call_js,
@@ -47,8 +49,11 @@ class APIEventHandler {
// Returns a new v8::Object for an event with the given |event_name|. If
// |notify_on_change| is true, notifies whenever listeners state is changed.
+ // TODO(devlin): Maybe worth creating a Params struct to hold the event
+ // information?
v8::Local<v8::Object> CreateEventInstance(const std::string& event_name,
bool supports_filters,
+ bool supports_lazy_listeners,
int max_listeners,
bool notify_on_change,
v8::Local<v8::Context> context);
« no previous file with comments | « extensions/renderer/bindings/api_binding_js_util.cc ('k') | extensions/renderer/bindings/api_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698