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

Unified Diff: Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp

Issue 296703009: Oilpan: move custom element objects to the heap. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix compilation issue pointed out by clang Created 6 years, 7 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/custom/CustomElementMicrotaskDispatcher.cpp
diff --git a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp
index ca716e61001b11c4b98e170b4aa435a6073a4d09..fc622343b881b6c4f2adf9e79f5ce8f6e427afed 100644
--- a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp
+++ b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp
@@ -25,13 +25,15 @@ CustomElementMicrotaskDispatcher::CustomElementMicrotaskDispatcher()
{
}
+DEFINE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CustomElementMicrotaskDispatcher)
+
CustomElementMicrotaskDispatcher& CustomElementMicrotaskDispatcher::instance()
{
- DEFINE_STATIC_LOCAL(CustomElementMicrotaskDispatcher, instance, ());
- return instance;
+ DEFINE_STATIC_LOCAL(OwnPtrWillBePersistent<CustomElementMicrotaskDispatcher>, instance, (adoptPtrWillBeNoop(new CustomElementMicrotaskDispatcher())));
+ return *instance;
}
-void CustomElementMicrotaskDispatcher::enqueue(HTMLImportLoader* importLoader, PassOwnPtr<CustomElementMicrotaskStep> step)
+void CustomElementMicrotaskDispatcher::enqueue(HTMLImportLoader* importLoader, PassOwnPtrWillBeRawPtr<CustomElementMicrotaskStep> step)
{
ASSERT(m_phase == Quiescent || m_phase == DispatchingCallbacks);
ensureMicrotaskScheduled();
@@ -84,7 +86,7 @@ void CustomElementMicrotaskDispatcher::doDispatch()
m_resolutionAndImports->dispatch();
m_phase = DispatchingCallbacks;
- for (Vector<CustomElementCallbackQueue*>::iterator it = m_elements.begin();it != m_elements.end(); ++it) {
+ for (WillBeHeapVector<RawPtrWillBeMember<CustomElementCallbackQueue> >::iterator it = m_elements.begin(); it != m_elements.end(); ++it) {
// Created callback may enqueue an attached callback.
CustomElementCallbackDispatcher::CallbackDeliveryScope scope;
(*it)->processInElementQueue(kMicrotaskQueueId);
@@ -95,6 +97,14 @@ void CustomElementMicrotaskDispatcher::doDispatch()
m_phase = Quiescent;
}
+void CustomElementMicrotaskDispatcher::trace(Visitor* visitor)
+{
+ visitor->trace(m_resolutionAndImports);
+#if ENABLE(OILPAN)
+ visitor->trace(m_elements);
+#endif
+}
+
#if !defined(NDEBUG)
void CustomElementMicrotaskDispatcher::show()
{
« no previous file with comments | « Source/core/dom/custom/CustomElementMicrotaskDispatcher.h ('k') | Source/core/dom/custom/CustomElementMicrotaskImportStep.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698