1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CustomElementMicrotaskStepDispatcher_h 6 #define CustomElementMicrotaskStepDispatcher_h 7 8 #include "core/dom/custom/CustomElementAsyncImportMicrotaskQueue.h" 9 #include "core/dom/custom/CustomElementSyncMicrotaskQueue.h" 10 #include "platform/heap/Handle.h" 11 12 namespace WebCore { 13 14 class HTMLImportLoader; 15 16 class CustomElementMicrotaskStepDispatcher : public RefCountedWillBeGarbageCollectedFinalized<CustomElementMicrotaskStepDispatcher> { 17 WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskStepDispatcher); 18 public: create()19 static PassRefPtrWillBeRawPtr<CustomElementMicrotaskStepDispatcher> create() { return adoptRefWillBeNoop(new CustomElementMicrotaskStepDispatcher()); } 20 21 void enqueue(HTMLImportLoader* parentLoader, PassOwnPtrWillBeRawPtr<CustomElementMicrotaskStep>); 22 void enqueue(HTMLImportLoader* parentLoader, PassOwnPtrWillBeRawPtr<CustomElementMicrotaskImportStep>, bool importIsSync); 23 24 void dispatch(); 25 void trace(Visitor*); 26 27 #if !defined(NDEBUG) 28 void show(unsigned indent); 29 #endif 30 31 private: 32 CustomElementMicrotaskStepDispatcher(); 33 34 RefPtrWillBeMember<CustomElementSyncMicrotaskQueue> m_syncQueue; 35 RefPtrWillBeMember<CustomElementAsyncImportMicrotaskQueue> m_asyncQueue; 36 }; 37 38 } 39 40 #endif // CustomElementMicrotaskStepDispatcher_h 41