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

Unified Diff: extensions/renderer/api_event_handler.h

Issue 2722463006: [Extensions Bindings] Notify of event unregistration on invalidation (Closed)
Patch Set: . Created 3 years, 10 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 fbf9b42a7ea742f1accc48e10775af037a6b8e0b..a06f3fddc637147475b165e3b5b6063822d00f18 100644
--- a/extensions/renderer/api_event_handler.h
+++ b/extensions/renderer/api_event_handler.h
@@ -48,6 +48,11 @@ 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.
jbroman 2017/03/01 17:49:47 Because it's gone from the ScriptContextSet, right
Devlin 2017/03/01 19:03:50 Correct (and the ScriptContext wrapper is deleted)
+ void InvalidateContext(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