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

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

Issue 14660019: Run Mutation Observer and Custom Element callbacks consistently at microtask checkpoint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing. 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
« no previous file with comments | « Source/core/dom/CustomElementCallbackDispatcher.cpp ('k') | Source/core/dom/CustomElementRegistry.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/CustomElementRegistry.h
diff --git a/Source/core/dom/CustomElementRegistry.h b/Source/core/dom/CustomElementRegistry.h
index d108970f54121452ee8ec777c1f11db687cfe4b5..525618ae6b2de3a68bda40bcae6942fe8a5a1302 100644
--- a/Source/core/dom/CustomElementRegistry.h
+++ b/Source/core/dom/CustomElementRegistry.h
@@ -32,15 +32,12 @@
#define CustomElementRegistry_h
#include "core/dom/ContextLifecycleObserver.h"
-#include "core/dom/CustomElementCallback.h"
#include "core/dom/CustomElementUpgradeCandidateMap.h"
#include "core/dom/ExceptionCode.h"
#include "core/dom/QualifiedName.h"
-#include "wtf/ListHashSet.h"
#include "wtf/PassRefPtr.h"
#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
-#include "wtf/Vector.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/AtomicStringHash.h"
@@ -48,36 +45,16 @@ namespace WebCore {
class CustomElementConstructorBuilder;
class CustomElementDefinition;
-class Dictionary;
class Document;
class Element;
-class CustomElementInvocation {
-public:
- CustomElementInvocation(PassRefPtr<CustomElementCallback>, PassRefPtr<Element>);
- ~CustomElementInvocation();
-
- CustomElementCallback* callback() const { return m_callback.get(); }
- Element* element() const { return m_element.get(); }
-
-private:
- RefPtr<CustomElementCallback> m_callback;
- RefPtr<Element> m_element;
-};
-
void setTypeExtension(Element*, const AtomicString& typeExtension);
class CustomElementRegistry : public RefCounted<CustomElementRegistry>, public ContextLifecycleObserver {
WTF_MAKE_NONCOPYABLE(CustomElementRegistry); WTF_MAKE_FAST_ALLOCATED;
public:
- class CallbackDeliveryScope {
- public:
- CallbackDeliveryScope() { }
- ~CallbackDeliveryScope() { CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded(); }
- };
-
explicit CustomElementRegistry(Document*);
- ~CustomElementRegistry();
+ virtual ~CustomElementRegistry() { }
void registerElement(CustomElementConstructorBuilder*, const AtomicString& name, ExceptionCode&);
@@ -93,20 +70,10 @@ public:
static bool isCustomTagName(const AtomicString& name) { return isValidName(name); }
- static void deliverAllLifecycleCallbacks();
- static void deliverAllLifecycleCallbacksIfNeeded();
-
private:
typedef HashMap<AtomicString, RefPtr<CustomElementDefinition> > DefinitionMap;
- typedef ListHashSet<CustomElementRegistry*> InstanceSet;
-
static bool isValidName(const AtomicString&);
- static InstanceSet& activeCustomElementRegistries();
- void enqueueReadyCallback(CustomElementCallback*, Element*);
- void deactivate();
- void deliverLifecycleCallbacks();
-
PassRefPtr<CustomElementDefinition> findAndCheckNamespace(const AtomicString& type, const AtomicString& namespaceURI) const;
void didCreateCustomTagElement(CustomElementDefinition*, Element*);
@@ -114,24 +81,8 @@ private:
DefinitionMap m_definitions;
CustomElementUpgradeCandidateMap m_candidates;
-
- Vector<CustomElementInvocation> m_invocations;
};
-inline void CustomElementRegistry::deliverAllLifecycleCallbacksIfNeeded()
-{
- if (!activeCustomElementRegistries().isEmpty())
- deliverAllLifecycleCallbacks();
- ASSERT(activeCustomElementRegistries().isEmpty());
-}
-
-inline CustomElementRegistry::InstanceSet& CustomElementRegistry::activeCustomElementRegistries()
-{
- DEFINE_STATIC_LOCAL(InstanceSet, activeInstances, ());
- return activeInstances;
-}
-
-
} // namespace WebCore
#endif
« no previous file with comments | « Source/core/dom/CustomElementCallbackDispatcher.cpp ('k') | Source/core/dom/CustomElementRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698