Chromium Code Reviews| 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..30a6a39401d6131d5012b0e158edd7793953ac74 100644 |
| --- a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp |
| +++ b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.cpp |
| @@ -27,11 +27,16 @@ CustomElementMicrotaskDispatcher::CustomElementMicrotaskDispatcher() |
| CustomElementMicrotaskDispatcher& CustomElementMicrotaskDispatcher::instance() |
| { |
| +#if ENABLE(OILPAN) |
| + DEFINE_STATIC_LOCAL(Persistent<CustomElementMicrotaskDispatcher>, instance, (new CustomElementMicrotaskDispatcher())); |
| + return *instance; |
| +#else |
| DEFINE_STATIC_LOCAL(CustomElementMicrotaskDispatcher, instance, ()); |
| return instance; |
| +#endif |
|
haraken
2014/05/27 01:08:45
Ditto. I'd prefer DEFINE_STATIC_LOCAL(OwnPtrWillBe
sof
2014/05/27 11:59:14
Done, here & elsewhere.
(Where does this style co
|
| } |
| -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 +89,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 +100,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() |
| { |