OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PropertyRegistry_h |
| 6 #define PropertyRegistry_h |
| 7 |
| 8 #include "core/css/CSSSyntaxDescriptor.h" |
| 9 #include "core/css/CSSValue.h" |
| 10 #include "core/css/CSSVariableData.h" |
| 11 #include "wtf/HashMap.h" |
| 12 #include "wtf/RefPtr.h" |
| 13 #include "wtf/text/AtomicString.h" |
| 14 #include "wtf/text/AtomicStringHash.h" |
| 15 |
| 16 namespace blink { |
| 17 |
| 18 class PropertyRegistry : public GarbageCollected<PropertyRegistry> { |
| 19 public: |
| 20 static PropertyRegistry* create() |
| 21 { |
| 22 return new PropertyRegistry(); |
| 23 } |
| 24 |
| 25 class Registration : public GarbageCollectedFinalized<Registration> { |
| 26 public: |
| 27 Registration(const CSSSyntaxDescriptor& syntax, bool inherits, const CSS
Value* initial) |
| 28 : m_syntax(syntax), m_inherits(inherits), m_initial(initial) { } |
| 29 |
| 30 const CSSSyntaxDescriptor& syntax() const { return m_syntax; } |
| 31 bool inherits() const { return m_inherits; } |
| 32 const CSSValue* initial() const { return m_initial; } |
| 33 |
| 34 DEFINE_INLINE_TRACE() { visitor->trace(m_initial); } |
| 35 |
| 36 private: |
| 37 const CSSSyntaxDescriptor m_syntax; |
| 38 const bool m_inherits; |
| 39 const Member<const CSSValue> m_initial; |
| 40 }; |
| 41 |
| 42 void registerProperty(const AtomicString&, const CSSSyntaxDescriptor&, bool
inherits, const CSSValue* initial); |
| 43 void unregisterProperty(const AtomicString&); |
| 44 const Registration* registration(const AtomicString&) const; |
| 45 |
| 46 DEFINE_INLINE_TRACE() { visitor->trace(m_registrations); } |
| 47 |
| 48 private: |
| 49 HeapHashMap<AtomicString, Member<Registration>> m_registrations; |
| 50 }; |
| 51 |
| 52 } // namespace blink |
| 53 |
| 54 #endif // PropertyRegistry_h |
OLD | NEW |