| Index: Source/core/css/CSSValue.h
|
| diff --git a/Source/core/css/CSSValue.h b/Source/core/css/CSSValue.h
|
| index 609dcbc85afcae15a768dc5b5debdca568aa6112..8ffa9dae64a3253b2e171beb2b767a161ff69b4b 100644
|
| --- a/Source/core/css/CSSValue.h
|
| +++ b/Source/core/css/CSSValue.h
|
| @@ -69,7 +69,11 @@ public:
|
|
|
| ~CSSValue()
|
| {
|
| - deref();
|
| + // Although m_data can't be null, a move constructor from NullableCSSValue
|
| + // could make it null for a short time.
|
| + if (m_data)
|
| + deref();
|
| +
|
| }
|
|
|
| CSSValue& operator=(const CSSValue& rhs)
|
| @@ -80,6 +84,18 @@ public:
|
| return *this;
|
| }
|
|
|
| + CSSValue& operator=(CSSValue&& rhs)
|
| + {
|
| + m_data = rhs.m_data;
|
| + rhs.m_data.clear();
|
| + return *this;
|
| + }
|
| +
|
| + CSSValue(CSSValue&& rhs)
|
| + {
|
| + m_data = rhs.m_data;
|
| + }
|
| +
|
| bool operator==(const CSSValue& other) const
|
| {
|
| return m_data->equals(*other.m_data);
|
| @@ -221,6 +237,13 @@ public:
|
| ref();
|
| }
|
|
|
| + NullableCSSValue(NullableCSSValue&& rhs)
|
| + {
|
| + m_data = rhs.m_data;
|
| + rhs.m_data = nullptr;
|
| + }
|
| +
|
| +
|
| ~NullableCSSValue()
|
| {
|
| deref();
|
| @@ -239,7 +262,14 @@ public:
|
| return *this;
|
| }
|
|
|
| - bool operator==(const NullableCSSValue& rhs)
|
| + NullableCSSValue& operator=(NullableCSSValue&& rhs)
|
| + {
|
| + m_data = rhs.m_data;
|
| + rhs.m_data.clear();
|
| + return *this;
|
| + }
|
| +
|
| + bool operator==(const NullableCSSValue& rhs) const
|
| {
|
| return m_data ? rhs.m_data && m_data->equals(*rhs.m_data) : !bool(rhs.m_data);
|
| }
|
|
|