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

Unified Diff: Source/core/dom/CustomElementCallbackDispatcher.h

Issue 17707002: Implement Custom Elements inserted and removed callbacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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/CustomElementCallbackDispatcher.h
diff --git a/Source/core/dom/CustomElementCallbackDispatcher.h b/Source/core/dom/CustomElementCallbackDispatcher.h
index a52e7f308f8e8cc6bdeb7f584e8a37ce3967fc1f..5e04d604f19f263d2dcb49c10ba25075c9156043 100644
--- a/Source/core/dom/CustomElementCallbackDispatcher.h
+++ b/Source/core/dom/CustomElementCallbackDispatcher.h
@@ -40,6 +40,8 @@
namespace WebCore {
+class Element;
+
class CustomElementCallbackDispatcher {
WTF_MAKE_NONCOPYABLE(CustomElementCallbackDispatcher);
public:
@@ -56,7 +58,9 @@ public:
}
};
- void enqueueReadyCallback(CustomElementCallback*, Element*);
+ void enqueueCreationCallbacks(CustomElementCallback*, Element*, bool createdByParser);
+ void enqueueInsertedCallback(CustomElementCallback*, Element*);
+ void enqueueRemovedCallback(CustomElementCallback*, Element*);
// Returns true if more work may have to be performed at the
// checkpoint by this or other workers (for example, this work
@@ -67,24 +71,24 @@ public:
// createElementNS and generated constructors.
void dispatchReadyCallback(Element*);
-private:
- explicit CustomElementCallbackDispatcher() { }
-
- bool hasQueuedCallbacks() { return !m_invocations.isEmpty(); }
-
- class ReadyInvocation {
+ class Invocation {
public:
- ReadyInvocation(PassRefPtr<CustomElementCallback>, PassRefPtr<Element>);
- virtual ~ReadyInvocation() { }
- void invoke() { m_callback->ready(m_element.get()); }
+ Invocation(CustomElementCallback::CallbackType, PassRefPtr<CustomElementCallback>, PassRefPtr<Element>);
Element* element() { return m_element.get(); }
+ CustomElementCallback::CallbackType type() { return m_type; }
+ void invoke();
private:
+ CustomElementCallback::CallbackType m_type;
RefPtr<CustomElementCallback> m_callback;
RefPtr<Element> m_element;
};
- typedef Vector<OwnPtr<ReadyInvocation> > InvocationList;
+private:
+ explicit CustomElementCallbackDispatcher() { }
+ bool hasQueuedCallbacks() { return !m_invocations.isEmpty(); }
+
+ typedef Vector<OwnPtr<Invocation> > InvocationList;
InvocationList m_invocations;
};

Powered by Google App Engine
This is Rietveld 408576698