| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef StyleNonInheritedVariables_h | 5 #ifndef StyleNonInheritedVariables_h |
| 6 #define StyleNonInheritedVariables_h | 6 #define StyleNonInheritedVariables_h |
| 7 | 7 |
| 8 #include "core/css/CSSValue.h" | 8 #include "core/css/CSSValue.h" |
| 9 #include "core/css/CSSVariableData.h" | 9 #include "core/css/CSSVariableData.h" |
| 10 #include "platform/wtf/Forward.h" | 10 #include "platform/wtf/Forward.h" |
| 11 #include "platform/wtf/HashMap.h" | 11 #include "platform/wtf/HashMap.h" |
| 12 #include "platform/wtf/text/AtomicStringHash.h" | 12 #include "platform/wtf/text/AtomicStringHash.h" |
| 13 | 13 |
| 14 namespace blink { | 14 namespace blink { |
| 15 | 15 |
| 16 class StyleNonInheritedVariables { | 16 class StyleNonInheritedVariables { |
| 17 public: | 17 public: |
| 18 static std::unique_ptr<StyleNonInheritedVariables> Create() { | 18 static std::unique_ptr<StyleNonInheritedVariables> Create() { |
| 19 return WTF::WrapUnique(new StyleNonInheritedVariables); | 19 return WTF::WrapUnique(new StyleNonInheritedVariables); |
| 20 } | 20 } |
| 21 | 21 |
| 22 std::unique_ptr<StyleNonInheritedVariables> Copy() { | 22 std::unique_ptr<StyleNonInheritedVariables> Clone() { |
| 23 return WTF::WrapUnique(new StyleNonInheritedVariables(*this)); | 23 return WTF::WrapUnique(new StyleNonInheritedVariables(*this)); |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool operator==(const StyleNonInheritedVariables& other) const; | 26 bool operator==(const StyleNonInheritedVariables& other) const; |
| 27 bool operator!=(const StyleNonInheritedVariables& other) const { | 27 bool operator!=(const StyleNonInheritedVariables& other) const { |
| 28 return !(*this == other); | 28 return !(*this == other); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void SetVariable(const AtomicString& name, | 31 void SetVariable(const AtomicString& name, |
| 32 PassRefPtr<CSSVariableData> value) { | 32 PassRefPtr<CSSVariableData> value) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 46 | 46 |
| 47 friend class CSSVariableResolver; | 47 friend class CSSVariableResolver; |
| 48 | 48 |
| 49 HashMap<AtomicString, RefPtr<CSSVariableData>> data_; | 49 HashMap<AtomicString, RefPtr<CSSVariableData>> data_; |
| 50 HashMap<AtomicString, Persistent<CSSValue>> registered_data_; | 50 HashMap<AtomicString, Persistent<CSSValue>> registered_data_; |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace blink | 53 } // namespace blink |
| 54 | 54 |
| 55 #endif // StyleNonInheritedVariables_h | 55 #endif // StyleNonInheritedVariables_h |
| OLD | NEW |