Index: extensions/renderer/api_event_handler.h |
diff --git a/extensions/renderer/api_event_handler.h b/extensions/renderer/api_event_handler.h |
index fbf9b42a7ea742f1accc48e10775af037a6b8e0b..8c4d3280e19f839acbc036a562b5dfbc6a41b256 100644 |
--- a/extensions/renderer/api_event_handler.h |
+++ b/extensions/renderer/api_event_handler.h |
@@ -48,6 +48,12 @@ class APIEventHandler { |
size_t GetNumEventListenersForTesting(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 |
+ // destructor), but we need to do this before the context is fully removed |
+ // (because the associated extension ScriptContext needs to be valid). |
+ void InvalidateContext(v8::Local<v8::Context> context); |
+ |
private: |
// Method to run a given v8::Function. Curried in for testing. |
binding::RunJSFunction call_js_; |