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

Unified Diff: extensions/renderer/api_event_handler.h

Issue 2722463006: [Extensions Bindings] Notify of event unregistration on invalidation (Closed)
Patch Set: Rebase Created 3 years, 9 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
« no previous file with comments | « extensions/renderer/api_bindings_system_unittest.cc ('k') | extensions/renderer/api_event_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/api_event_handler.h
diff --git a/extensions/renderer/api_event_handler.h b/extensions/renderer/api_event_handler.h
index 36046c8c23e6a831212f8f0d3b02d6b55ee8b234..fbd329a7844aa8662866a5759c168e676fd873a6 100644
--- a/extensions/renderer/api_event_handler.h
+++ b/extensions/renderer/api_event_handler.h
@@ -57,6 +57,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_;
« no previous file with comments | « extensions/renderer/api_bindings_system_unittest.cc ('k') | extensions/renderer/api_event_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698