| 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_;
|
|
|