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

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

Issue 220013003: Simplify CustomElementScheduler by passing the enum for callback type directly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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/CustomElementLifecycleCallbacks.h
diff --git a/Source/core/dom/custom/CustomElementLifecycleCallbacks.h b/Source/core/dom/custom/CustomElementLifecycleCallbacks.h
index aa182e625d97aaa497e172b1daecf2f1ef9864bf..a713815e93058efce69cc8eb5eddfb763c5e94e5 100644
--- a/Source/core/dom/custom/CustomElementLifecycleCallbacks.h
+++ b/Source/core/dom/custom/CustomElementLifecycleCallbacks.h
@@ -42,18 +42,6 @@ class CustomElementLifecycleCallbacks : public RefCounted<CustomElementLifecycle
public:
virtual ~CustomElementLifecycleCallbacks() { }
- bool hasCreatedCallback() const { return m_which & Created; }
- virtual void created(Element*) = 0;
-
- bool hasAttachedCallback() const { return m_which & Attached; }
- virtual void attached(Element*) = 0;
-
- bool hasDetachedCallback() const { return m_which & Detached; }
- virtual void detached(Element*) = 0;
-
- bool hasAttributeChangedCallback() const { return m_which & AttributeChanged; }
- virtual void attributeChanged(Element*, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue) = 0;
-
enum CallbackType {
None = 0,
Created = 1 << 0,
@@ -62,6 +50,13 @@ public:
AttributeChanged = 1 << 3
};
+ bool hasCallback(CallbackType type) const { return m_which & type; }
+
+ virtual void created(Element*) = 0;
+ virtual void attached(Element*) = 0;
+ virtual void detached(Element*) = 0;
+ virtual void attributeChanged(Element*, const AtomicString& name, const AtomicString& oldValue, const AtomicString& newValue) = 0;
+
protected:
CustomElementLifecycleCallbacks(CallbackType which) : m_which(which) { }
« no previous file with comments | « Source/core/dom/custom/CustomElementCallbackInvocation.cpp ('k') | Source/core/dom/custom/CustomElementScheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698