| 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
|
|
|