Chromium Code Reviews| 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; |