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

Side by Side Diff: Source/core/style/StyleVariableData.h

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Missing file :( Created 5 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 #ifndef StyleVariableData_h
2 #define StyleVariableData_h
3
4 #include "wtf/Forward.h"
5 #include "wtf/HashMap.h"
6 #include "wtf/RefCounted.h"
7 #include "wtf/text/AtomicStringHash.h"
8
9 namespace blink {
10
11 class CSSVariableData;
12
13 class StyleVariableData : public RefCounted<StyleVariableData> {
14 public:
15 static PassRefPtr<StyleVariableData> create() { return adoptRef(new StyleVar iableData()); }
16 PassRefPtr<StyleVariableData> copy() const { return adoptRef(new StyleVariab leData(*this)); }
17
18 bool operator==(const StyleVariableData& other) const { return other.m_data == m_data; }
19 bool operator!=(const StyleVariableData& other) const { return !(*this == ot her); }
20
21 void setVariable(const AtomicString& name, CSSVariableData* value) { m_data. set(name, value); }
22 CSSVariableData* getVariable(const AtomicString& name) const { return m_data .get(name); }
23 void removeVariable(const AtomicString& name) { return m_data.remove(name); }
24 private:
25 explicit StyleVariableData() : RefCounted<StyleVariableData>() { }
26 StyleVariableData(const StyleVariableData& other) : RefCounted<StyleVariable Data>(), m_data(HashMap<AtomicString, CSSVariableData*>(other.m_data)) { }
27
28 friend class CSSVariableResolver;
29
30 HashMap<AtomicString, CSSVariableData*> m_data;
31 };
32
33 } // namespace blink
34
35 #endif // StyleVariableData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698