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

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

Issue 18332025: Split CustomElementRegistry into a registration context and a registry. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Synced to tip. 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
« no previous file with comments | « Source/core/dom/CustomElementRegistrationContext.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 80039f545f69a0983f5cf45132f23a94d0f01f9c..f4195a717cdb88c5504e0e6e7490727b5629cfa6 100644
--- a/Source/core/dom/CustomElementRegistry.h
+++ b/Source/core/dom/CustomElementRegistry.h
@@ -33,13 +33,10 @@
#include "core/dom/CustomElementDefinition.h"
#include "core/dom/CustomElementDescriptor.h"
-#include "core/dom/CustomElementUpgradeCandidateMap.h"
+#include "core/dom/CustomElementDescriptorHash.h"
#include "core/dom/ExceptionCode.h"
-#include "core/dom/QualifiedName.h"
#include "wtf/HashMap.h"
#include "wtf/HashSet.h"
-#include "wtf/PassRefPtr.h"
-#include "wtf/RefCounted.h"
#include "wtf/RefPtr.h"
#include "wtf/text/AtomicString.h"
#include "wtf/text/AtomicStringHash.h"
@@ -48,52 +45,22 @@ namespace WebCore {
class CustomElementConstructorBuilder;
class Document;
-class Element;
-// Element creation
-void setTypeExtension(Element*, const AtomicString& typeExtension);
+class CustomElementRegistry {
+ WTF_MAKE_NONCOPYABLE(CustomElementRegistry);
+protected:
+ friend class ActiveRegistrationContext;
-class CustomElementRegistry : public RefCounted<CustomElementRegistry> {
- WTF_MAKE_NONCOPYABLE(CustomElementRegistry); WTF_MAKE_FAST_ALLOCATED;
-public:
CustomElementRegistry() { }
virtual ~CustomElementRegistry() { }
- // Model
- static bool isCustomTagName(const AtomicString& name) { return isValidTypeName(name); }
-
- // Registration and definitions
- void registerElement(Document*, CustomElementConstructorBuilder*, const AtomicString& name, ExceptionCode&);
- CustomElementDefinition* findFor(Element*) const;
-
- // Element creation
- PassRefPtr<Element> createCustomTagElement(Document*, const QualifiedName& localName);
- void didGiveTypeExtension(Element*, const AtomicString&);
-
- // Lifecycle
- void customElementWasDestroyed(Element*);
-
-private:
- // Model
- static bool isValidTypeName(const AtomicString&);
- CustomElementDescriptor describe(Element*) const;
-
- // Registration and definitions
+ CustomElementDefinition* registerElement(Document*, CustomElementConstructorBuilder*, const AtomicString& name, ExceptionCode&);
CustomElementDefinition* find(const CustomElementDescriptor&) const;
- // Lifecycle
- void didCreateUnresolvedElement(const CustomElementDescriptor&, Element*);
- void didResolveElement(CustomElementDefinition*, Element*) const;
-
- // Registration and definitions
+private:
typedef HashMap<CustomElementDescriptor, RefPtr<CustomElementDefinition> > DefinitionMap;
DefinitionMap m_definitions;
HashSet<AtomicString> m_registeredTypeNames;
-
- // Element creation
- typedef HashMap<Element*, AtomicString> ElementTypeMap;
- ElementTypeMap m_elementTypeMap; // Creation-time "is" attribute value.
- CustomElementUpgradeCandidateMap m_candidates;
};
} // namespace WebCore
« no previous file with comments | « Source/core/dom/CustomElementRegistrationContext.cpp ('k') | Source/core/dom/CustomElementRegistry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698