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

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

Issue 144023016: Separate Custom Element resolution and upgrade/createdCallback. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 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.h
diff --git a/Source/core/dom/custom/CustomElementMicrotaskDispatcher.h b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..b97e2e6354a5e550ca72745d09c416a86995593e
--- /dev/null
+++ b/Source/core/dom/custom/CustomElementMicrotaskDispatcher.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CustomElementMicrotaskDispatcher_h
+#define CustomElementMicrotaskDispatcher_h
+
+#include "core/dom/custom/CustomElementMicrotaskQueue.h"
+#include "wtf/Noncopyable.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Vector.h"
+
+namespace WebCore {
+
+class CustomElementCallbackQueue;
+class CustomElementMicrotaskStep;
+class HTMLImport;
+
+class CustomElementMicrotaskDispatcher {
+ WTF_MAKE_NONCOPYABLE(CustomElementMicrotaskDispatcher);
+public:
+ CustomElementMicrotaskDispatcher() : m_phase(Quiescent) { }
+ ~CustomElementMicrotaskDispatcher() { }
+
+ void enqueue(HTMLImport*, PassOwnPtr<CustomElementMicrotaskStep>);
+ void enqueue(CustomElementCallbackQueue*);
+ bool dispatch();
+ bool elementQueueIsEmpty() { return m_elements.isEmpty(); }
+
+private:
+ enum {
+ Quiescent,
+ Resolving,
+ DispatchingCallbacks
+ } m_phase;
+
+ CustomElementMicrotaskQueue m_resolutionAndImports;
+ Vector<CustomElementCallbackQueue*> m_elements;
+};
+
+}
+
+#endif // CustomElementMicrotaskDispatcher_h

Powered by Google App Engine
This is Rietveld 408576698