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

Side by Side Diff: third_party/WebKit/Source/core/style/StyleNonInheritedVariables.h

Issue 2437883002: Made PassRefPtr move only and replaced new copies with moves. (Closed)
Patch Set: Removed stale comment Created 4 years, 2 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
OLDNEW
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 "wtf/Forward.h" 10 #include "wtf/Forward.h"
(...skipping 12 matching lines...) Expand all
23 return wrapUnique(new StyleNonInheritedVariables(*this)); 23 return 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) {
33 m_data.set(name, value); 33 m_data.set(name, std::move(value));
34 } 34 }
35 CSSVariableData* getVariable(const AtomicString& name) const; 35 CSSVariableData* getVariable(const AtomicString& name) const;
36 void removeVariable(const AtomicString&); 36 void removeVariable(const AtomicString&);
37 37
38 void setRegisteredVariable(const AtomicString&, const CSSValue*); 38 void setRegisteredVariable(const AtomicString&, const CSSValue*);
39 CSSValue* registeredVariable(const AtomicString& name) const { 39 CSSValue* registeredVariable(const AtomicString& name) const {
40 return m_registeredData.get(name); 40 return m_registeredData.get(name);
41 } 41 }
42 42
43 private: 43 private:
44 StyleNonInheritedVariables() = default; 44 StyleNonInheritedVariables() = default;
45 StyleNonInheritedVariables(StyleNonInheritedVariables&); 45 StyleNonInheritedVariables(StyleNonInheritedVariables&);
46 46
47 friend class CSSVariableResolver; 47 friend class CSSVariableResolver;
48 48
49 HashMap<AtomicString, RefPtr<CSSVariableData>> m_data; 49 HashMap<AtomicString, RefPtr<CSSVariableData>> m_data;
50 HashMap<AtomicString, Persistent<CSSValue>> m_registeredData; 50 HashMap<AtomicString, Persistent<CSSValue>> m_registeredData;
51 }; 51 };
52 52
53 } // namespace blink 53 } // namespace blink
54 54
55 #endif // StyleNonInheritedVariables_h 55 #endif // StyleNonInheritedVariables_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/PropertyRegistry.cpp ('k') | third_party/WebKit/Source/modules/fetch/BlobBytesConsumer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698