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

Unified Diff: extensions/renderer/api_event_handler.h

Issue 2909673003: [Extensions Bindings] Request JS execution from messaging bindings (Closed)
Patch Set: . Created 3 years, 7 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_event_handler.h
diff --git a/extensions/renderer/api_event_handler.h b/extensions/renderer/api_event_handler.h
index 13451d4b5cbec6f218d32cdd633b19d6f9659ed7..e3e4ce9c2f36198096717cd6b504dedbb7e0dfbf 100644
--- a/extensions/renderer/api_event_handler.h
+++ b/extensions/renderer/api_event_handler.h
@@ -75,9 +75,10 @@ class APIEventHandler {
const std::string& event_name,
v8::Local<v8::Function> function);
- // Returns the EventListeners for a given |event_name| and |context|.
- size_t GetNumEventListenersForTesting(const std::string& event_name,
- v8::Local<v8::Context> context);
+ // Returns true if there is a listener for the given |event_name| in the
+ // given |context|.
+ bool HasListenerForEvent(const std::string& event_name,
+ v8::Local<v8::Context> context);
// Invalidates listeners for the given |context|. It's a shame we have to
// have this separately (as opposed to hooking into e.g. a PerContextData
@@ -85,6 +86,10 @@ class APIEventHandler {
// (because the associated extension ScriptContext needs to be valid).
void InvalidateContext(v8::Local<v8::Context> context);
+ // Returns the EventListeners for a given |event_name| and |context|.
lazyboy 2017/06/05 18:18:32 the number of EventListeners
Devlin 2017/06/09 20:18:02 Done.
+ size_t GetNumEventListenersForTesting(const std::string& event_name,
+ v8::Local<v8::Context> context);
+
private:
// Method to run a given v8::Function. Curried in for testing.
binding::RunJSFunction call_js_;

Powered by Google App Engine
This is Rietveld 408576698