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 ExceptionState; |
| 46 class ScriptState; |
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; } |
| 55 bool nameIsDefined(const AtomicString&) const; |
54 | 56 |
55 protected: | 57 protected: |
56 friend class V0CustomElementRegistrationContext; | 58 friend class V0CustomElementRegistrationContext; |
57 | 59 |
58 V0CustomElementRegistry() : m_documentWasDetached(false) { } | 60 V0CustomElementRegistry() : m_documentWasDetached(false) { } |
59 | 61 |
60 V0CustomElementDefinition* registerElement(Document*, V0CustomElementConstru
ctorBuilder*, const AtomicString& name, V0CustomElement::NameSet validNames, Exc
eptionState&); | 62 V0CustomElementDefinition* registerElement(ScriptState*, Document*, V0Custom
ElementConstructorBuilder*, const AtomicString& name, V0CustomElement::NameSet v
alidNames, ExceptionState&); |
61 V0CustomElementDefinition* find(const V0CustomElementDescriptor&) const; | 63 V0CustomElementDefinition* find(const V0CustomElementDescriptor&) const; |
62 | 64 |
63 private: | 65 private: |
64 typedef HeapHashMap<V0CustomElementDescriptor, Member<V0CustomElementDefinit
ion>> DefinitionMap; | 66 typedef HeapHashMap<V0CustomElementDescriptor, Member<V0CustomElementDefinit
ion>> DefinitionMap; |
65 DefinitionMap m_definitions; | 67 DefinitionMap m_definitions; |
66 HashSet<AtomicString> m_registeredTypeNames; | 68 HashSet<AtomicString> m_registeredTypeNames; |
67 bool m_documentWasDetached; | 69 bool m_documentWasDetached; |
68 }; | 70 }; |
69 | 71 |
70 } // namespace blink | 72 } // namespace blink |
71 | 73 |
72 #endif // V0CustomElementRegistry_h | 74 #endif // V0CustomElementRegistry_h |
OLD | NEW |