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

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

Issue 18167006: Implement Custom Elements' entered and left document callbacks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Feedback. Created 7 years, 5 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/CustomElementCallbackInvocation.h
diff --git a/Source/core/dom/CustomElementCallbackInvocation.h b/Source/core/dom/CustomElementCallbackInvocation.h
index 0e46c6354aa684344334219cabd95157e2f27a1e..c6f081862e39bcb5a8e179bb099d3f533a83021e 100644
--- a/Source/core/dom/CustomElementCallbackInvocation.h
+++ b/Source/core/dom/CustomElementCallbackInvocation.h
@@ -31,24 +31,35 @@
#ifndef CustomElementCallbackInvocation_h
#define CustomElementCallbackInvocation_h
+#include "core/dom/CustomElementLifecycleCallbacks.h"
#include "wtf/PassOwnPtr.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefPtr.h"
#include "wtf/text/AtomicString.h"
namespace WebCore {
-class CustomElementLifecycleCallbacks;
class Element;
class CustomElementCallbackInvocation {
WTF_MAKE_NONCOPYABLE(CustomElementCallbackInvocation);
public:
- static PassOwnPtr<CustomElementCallbackInvocation> createCreatedInvocation();
- static PassOwnPtr<CustomElementCallbackInvocation> createAttributeChangedInvocation(const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue);
+ static PassOwnPtr<CustomElementCallbackInvocation> createInvocation(PassRefPtr<CustomElementLifecycleCallbacks>, CustomElementLifecycleCallbacks::CallbackType);
+ static PassOwnPtr<CustomElementCallbackInvocation> createAttributeChangedInvocation(PassRefPtr<CustomElementLifecycleCallbacks>, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue);
- CustomElementCallbackInvocation() { }
virtual ~CustomElementCallbackInvocation() { }
+ virtual void dispatch(Element*) = 0;
- virtual void dispatch(CustomElementLifecycleCallbacks*, Element*) = 0;
+protected:
+ CustomElementCallbackInvocation(PassRefPtr<CustomElementLifecycleCallbacks> callbacks)
+ : m_callbacks(callbacks)
+ {
+ }
+
+ CustomElementLifecycleCallbacks* callbacks() { return m_callbacks.get(); }
+
+private:
+ RefPtr<CustomElementLifecycleCallbacks> m_callbacks;
};
}
« no previous file with comments | « Source/core/dom/CustomElementCallbackDispatcher.cpp ('k') | Source/core/dom/CustomElementCallbackInvocation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698