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.
5 #ifndef CustomElementMicrotaskRunQueue_h
6 #define CustomElementMicrotaskRunQueue_h
8 #include "platform/heap/Handle.h"
9 #include "wtf/RefCounted.h"
10 #include "wtf/WeakPtr.h"
14 class CustomElementSyncMicrotaskQueue;
15 class CustomElementAsyncImportMicrotaskQueue;
16 class CustomElementMicrotaskStep;
17 class HTMLImportLoader;
19 class CustomElementMicrotaskRunQueue : public RefCountedWillBeGarbageCollectedFinalized<CustomElementMicrotaskRunQueue> {
20 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(CustomElementMicrotaskRunQueue)
22 static PassRefPtrWillBeRawPtr<CustomElementMicrotaskRunQueue> create() { return adoptRefWillBeNoop(new CustomElementMicrotaskRunQueue()); }
24 void enqueue(HTMLImportLoader* parentLoader, PassOwnPtrWillBeRawPtr<CustomElementMicrotaskStep>, bool importIsSync);
25 void requestDispatchIfNeeded();
31 void show(unsigned indent);
35 static void dispatchIfAlive(WeakPtr<CustomElementMicrotaskRunQueue> self);
37 CustomElementMicrotaskRunQueue();
41 WeakPtrFactory<CustomElementMicrotaskRunQueue> m_weakFactory;
42 RefPtrWillBeMember<CustomElementSyncMicrotaskQueue> m_syncQueue;
43 RefPtrWillBeMember<CustomElementAsyncImportMicrotaskQueue> m_asyncQueue;
44 bool m_dispatchIsPending;