| OLD | NEW | 
|   1 /* |   1 /* | 
|   2  * Copyright (C) 2012 Google Inc. All rights reserved. |   2  * Copyright (C) 2012 Google Inc. All rights reserved. | 
|   3  * |   3  * | 
|   4  * Redistribution and use in source and binary forms, with or without |   4  * Redistribution and use in source and binary forms, with or without | 
|   5  * modification, are permitted provided that the following conditions |   5  * modification, are permitted provided that the following conditions | 
|   6  * are met: |   6  * are met: | 
|   7  * |   7  * | 
|   8  * 1. Redistributions of source code must retain the above copyright |   8  * 1. Redistributions of source code must retain the above copyright | 
|   9  *    notice, this list of conditions and the following disclaimer. |   9  *    notice, this list of conditions and the following disclaimer. | 
|  10  * 2. Redistributions in binary form must reproduce the above copyright |  10  * 2. Redistributions in binary form must reproduce the above copyright | 
| (...skipping 24 matching lines...) Expand all  Loading... | 
|  35 #include "core/dom/custom/V0CustomElementDefinition.h" |  35 #include "core/dom/custom/V0CustomElementDefinition.h" | 
|  36 #include "core/dom/custom/V0CustomElementDescriptor.h" |  36 #include "core/dom/custom/V0CustomElementDescriptor.h" | 
|  37 #include "core/dom/custom/V0CustomElementDescriptorHash.h" |  37 #include "core/dom/custom/V0CustomElementDescriptorHash.h" | 
|  38 #include "wtf/HashMap.h" |  38 #include "wtf/HashMap.h" | 
|  39 #include "wtf/HashSet.h" |  39 #include "wtf/HashSet.h" | 
|  40 #include "wtf/text/AtomicString.h" |  40 #include "wtf/text/AtomicString.h" | 
|  41 #include "wtf/text/AtomicStringHash.h" |  41 #include "wtf/text/AtomicStringHash.h" | 
|  42  |  42  | 
|  43 namespace blink { |  43 namespace blink { | 
|  44  |  44  | 
 |  45 class CustomElementsRegistry; | 
 |  46 class ExceptionState; | 
|  45 class V0CustomElementConstructorBuilder; |  47 class V0CustomElementConstructorBuilder; | 
|  46 class ExceptionState; |  | 
|  47  |  48  | 
|  48 class V0CustomElementRegistry final { |  49 class V0CustomElementRegistry final { | 
|  49     WTF_MAKE_NONCOPYABLE(V0CustomElementRegistry); |  50     WTF_MAKE_NONCOPYABLE(V0CustomElementRegistry); | 
|  50     DISALLOW_NEW(); |  51     DISALLOW_NEW(); | 
|  51 public: |  52 public: | 
|  52     DECLARE_TRACE(); |  53     DECLARE_TRACE(); | 
|  53     void documentWasDetached() { m_documentWasDetached = true; } |  54     void documentWasDetached() { m_documentWasDetached = true; } | 
|  54  |  55  | 
|  55 protected: |  56 protected: | 
|  56     friend class V0CustomElementRegistrationContext; |  57     friend class V0CustomElementRegistrationContext; | 
|  57  |  58  | 
|  58     V0CustomElementRegistry() : m_documentWasDetached(false) { } |  59     V0CustomElementRegistry() : m_documentWasDetached(false) { } | 
|  59  |  60  | 
|  60     V0CustomElementDefinition* registerElement(Document*, V0CustomElementConstru
    ctorBuilder*, const AtomicString& name, V0CustomElement::NameSet validNames, Exc
    eptionState&); |  61     V0CustomElementDefinition* registerElement(Document*, V0CustomElementConstru
    ctorBuilder*, const AtomicString& name, V0CustomElement::NameSet validNames, Exc
    eptionState&); | 
|  61     V0CustomElementDefinition* find(const V0CustomElementDescriptor&) const; |  62     V0CustomElementDefinition* find(const V0CustomElementDescriptor&) const; | 
|  62  |  63  | 
 |  64     bool nameIsDefined(const AtomicString& name) const; | 
 |  65     void setV1(const CustomElementsRegistry*); | 
 |  66  | 
|  63 private: |  67 private: | 
 |  68     bool v1NameIsDefined(const AtomicString& name) const; | 
 |  69  | 
|  64     typedef HeapHashMap<V0CustomElementDescriptor, Member<V0CustomElementDefinit
    ion>> DefinitionMap; |  70     typedef HeapHashMap<V0CustomElementDescriptor, Member<V0CustomElementDefinit
    ion>> DefinitionMap; | 
|  65     DefinitionMap m_definitions; |  71     DefinitionMap m_definitions; | 
|  66     HashSet<AtomicString> m_registeredTypeNames; |  72     HashSet<AtomicString> m_registeredTypeNames; | 
 |  73     Member<const CustomElementsRegistry> m_v1; | 
|  67     bool m_documentWasDetached; |  74     bool m_documentWasDetached; | 
|  68 }; |  75 }; | 
|  69  |  76  | 
|  70 } // namespace blink |  77 } // namespace blink | 
|  71  |  78  | 
|  72 #endif // V0CustomElementRegistry_h |  79 #endif // V0CustomElementRegistry_h | 
| OLD | NEW |