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

Unified Diff: extensions/renderer/api_event_handler.h

Issue 2909673003: [Extensions Bindings] Request JS execution from messaging bindings (Closed)
Patch Set: lazyboy'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_event_handler.h
diff --git a/extensions/renderer/api_event_handler.h b/extensions/renderer/api_event_handler.h
index 35278bba8a2f2fce6487eb733ae8d5d2ab448c70..6530f9a929e4e2fbc49ab165b1724f0ff5747b9e 100644
--- a/extensions/renderer/api_event_handler.h
+++ b/extensions/renderer/api_event_handler.h
@@ -77,9 +77,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
@@ -87,6 +88,11 @@ class APIEventHandler {
// (because the associated extension ScriptContext needs to be valid).
void InvalidateContext(v8::Local<v8::Context> context);
+ // Returns the number of event listeners for a given |event_name| and
+ // |context|.
+ 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_;
« no previous file with comments | « chrome/renderer/extensions/chrome_extensions_renderer_client.cc ('k') | extensions/renderer/api_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698