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

Unified Diff: Source/core/dom/EventHandlerRegistry.cpp

Issue 235113002: Oilpan: Remove guardRef and guardDeref from TreeScope. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address comments. Created 6 years, 8 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 | « Source/core/dom/EventHandlerRegistry.h ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/EventHandlerRegistry.cpp
diff --git a/Source/core/dom/EventHandlerRegistry.cpp b/Source/core/dom/EventHandlerRegistry.cpp
index b72b465ffaadc0a31187c14559227570e38b81e7..668c46eab92692c58db55abd29f15241d093f599 100644
--- a/Source/core/dom/EventHandlerRegistry.cpp
+++ b/Source/core/dom/EventHandlerRegistry.cpp
@@ -199,4 +199,22 @@ void EventHandlerRegistry::notifyHasHandlersChanged(EventHandlerClass handlerCla
}
}
+void EventHandlerRegistry::clearWeakMembers(Visitor* visitor)
+{
+ Vector<EventTarget*> deadNodeTargets;
+ for (size_t i = 0; i < EventHandlerClassCount; ++i) {
+ EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i);
+ const EventTargetSet* targets = eventHandlerTargets(handlerClass);
+ if (!targets)
+ continue;
+ for (EventTargetSet::const_iterator it = targets->begin(); it != targets->end(); ++it) {
+ Node* node = it->key->toNode();
+ if (node && !visitor->isAlive(node))
+ deadNodeTargets.append(node);
+ }
+ }
+ for (size_t i = 0; i < deadNodeTargets.size(); ++i)
+ didRemoveAllEventHandlers(*deadNodeTargets[i]);
+}
+
} // namespace WebCore
« no previous file with comments | « Source/core/dom/EventHandlerRegistry.h ('k') | Source/core/dom/Node.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698