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

Unified Diff: extensions/browser/event_listener_map.cc

Issue 898743002: When an extension is unloaded, unregister all event listeners, not just the lazy ones. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2272
Patch Set: Created 5 years, 11 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/browser/event_listener_map.h ('k') | extensions/browser/event_listener_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/event_listener_map.cc
diff --git a/extensions/browser/event_listener_map.cc b/extensions/browser/event_listener_map.cc
index d6e7d2d80094e29f6209b21c98abfb42852ca5c5..8d1f5cad73f9f1118ec3f6bd77ce2b0e695f864c 100644
--- a/extensions/browser/event_listener_map.cc
+++ b/extensions/browser/event_listener_map.cc
@@ -176,15 +176,17 @@ bool EventListenerMap::HasProcessListener(content::RenderProcessHost* process,
return false;
}
-void EventListenerMap::RemoveLazyListenersForExtension(
+void EventListenerMap::RemoveListenersForExtension(
const std::string& extension_id) {
for (ListenerMap::iterator it = listeners_.begin(); it != listeners_.end();
it++) {
for (ListenerList::iterator it2 = it->second.begin();
it2 != it->second.end();) {
- if ((*it2)->IsLazy() && (*it2)->extension_id() == extension_id) {
- CleanupListener(it2->get());
+ if ((*it2)->extension_id() == extension_id) {
+ linked_ptr<EventListener> listener(*it2);
+ CleanupListener(listener.get());
it2 = it->second.erase(it2);
+ delegate_->OnListenerRemoved(listener.get());
} else {
it2++;
}
« no previous file with comments | « extensions/browser/event_listener_map.h ('k') | extensions/browser/event_listener_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698