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

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: ToT-ed again... Created 5 years, 5 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
25 HashMap<AtomicString, CSSVariableData*> m_data;
26 private:
27 explicit StyleVariableData() : RefCounted<StyleVariableData>() { }
28 StyleVariableData(const StyleVariableData& other) : RefCounted<StyleVariable Data>(), m_data(HashMap<AtomicString, CSSVariableData*>(other.m_data)) { }
29 };
30
31 } // namespace blink
32
33 #endif // StyleVariableData_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698