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

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

Issue 255983003: Oilpan: Move all supplements of Page, Document, and WorkerClients to the managed heap. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: review 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
Index: Source/core/dom/EventHandlerRegistry.cpp
diff --git a/Source/core/dom/EventHandlerRegistry.cpp b/Source/core/dom/EventHandlerRegistry.cpp
index 668c46eab92692c58db55abd29f15241d093f599..e00c22af849029a0ab5ab85081794219a738f483 100644
--- a/Source/core/dom/EventHandlerRegistry.cpp
+++ b/Source/core/dom/EventHandlerRegistry.cpp
@@ -44,7 +44,7 @@ EventHandlerRegistry* EventHandlerRegistry::from(Document& document)
EventHandlerRegistry* registry = static_cast<EventHandlerRegistry*>(DocumentSupplement::from(document, supplementName()));
if (!registry) {
registry = new EventHandlerRegistry(document);
- DocumentSupplement::provideTo(document, supplementName(), adoptPtr(registry));
+ DocumentSupplement::provideTo(document, supplementName(), adoptPtrWillBeNoop(registry));
}
return registry;
}
@@ -199,6 +199,15 @@ void EventHandlerRegistry::notifyHasHandlersChanged(EventHandlerClass handlerCla
}
}
+void EventHandlerRegistry::trace(Visitor* visitor)
+{
+ // FIXME: Oilpan: This is pretty funky. The current code disables all modifications of the
+ // EventHandlerRegistry when the document becomes inactive. To keep that behavior we only
+ // perform weak processing of the registry when the document is active.
+ if (m_document.isActive())
haraken 2014/04/30 02:41:22 Nit: This is OK but I'd move the m_document.isActi
zerny-chromium 2014/04/30 08:29:34 Done.
+ visitor->registerWeakMembers<EventHandlerRegistry, &EventHandlerRegistry::clearWeakMembers>(this);
+}
+
void EventHandlerRegistry::clearWeakMembers(Visitor* visitor)
{
Vector<EventTarget*> deadNodeTargets;

Powered by Google App Engine
This is Rietveld 408576698