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

Unified Diff: Source/core/css/CSSPrimitiveValue.h

Issue 1233363002: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/css/CSSGradientValue.cpp ('k') | Source/core/css/CSSProperty.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSPrimitiveValue.h
diff --git a/Source/core/css/CSSPrimitiveValue.h b/Source/core/css/CSSPrimitiveValue.h
index 30f7f6d940c0a77be6de96a4abd6ffc3c1acba49..c5a5bda5c172643b265b122eb2fc6e103581f7db 100644
--- a/Source/core/css/CSSPrimitiveValue.h
+++ b/Source/core/css/CSSPrimitiveValue.h
@@ -399,14 +399,26 @@ public:
{
}
-
+ /*
CSSPrimitiveValue(const CSSPrimitiveValue& other)
: m_rawValue(other.m_rawValue.asPtr)
{
ref();
+ }*/
+
+ CSSPrimitiveValue(CSSPrimitiveValue const& other)
+ : m_rawValue(other.m_rawValue.asPtr)
+ {
+ ref();
+ }
+
+ CSSPrimitiveValue(CSSPrimitiveValue&& other)
+ : m_rawValue(other.m_rawValue.asPtr)
+ {
+ other.m_rawValue.asPtr.clear();
}
- CSSPrimitiveValue& operator=(const CSSPrimitiveValue& rhs)
+ CSSPrimitiveValue& operator=(CSSPrimitiveValue const& rhs)
{
rhs.ref();
deref();
@@ -414,9 +426,15 @@ public:
return *this;
}
+ CSSPrimitiveValue& operator=(CSSPrimitiveValue&& rhs)
+ {
+ return *this;
+ }
+
~CSSPrimitiveValue()
{
- deref();
+ if (m_rawValue.asPtr)
+ deref();
}
« no previous file with comments | « Source/core/css/CSSGradientValue.cpp ('k') | Source/core/css/CSSProperty.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698