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

Unified Diff: Source/core/css/CSSValueList.cpp

Issue 1164573002: CSSValue Immediates: Change CSSValue to an object instead of a pointer (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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/CSSValueList.h ('k') | Source/core/css/CSSValueObject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSValueList.cpp
diff --git a/Source/core/css/CSSValueList.cpp b/Source/core/css/CSSValueList.cpp
index 1648f677020881dc368a930580cff5b98daf4748..cd59514bf950642a323a3d95c17e912aba433dd6 100644
--- a/Source/core/css/CSSValueList.cpp
+++ b/Source/core/css/CSSValueList.cpp
@@ -27,23 +27,23 @@
namespace blink {
CSSValueList::CSSValueList(ClassType classType, ValueListSeparator listSeparator)
- : CSSValue(classType)
+ : CSSValueObject(classType)
{
m_valueListSeparator = listSeparator;
}
CSSValueList::CSSValueList(ValueListSeparator listSeparator)
- : CSSValue(ValueListClass)
+ : CSSValueObject(ValueListClass)
{
m_valueListSeparator = listSeparator;
}
-bool CSSValueList::removeAll(CSSValue* val)
+bool CSSValueList::removeAll(CSSValue val)
{
bool found = false;
for (int index = m_values.size() - 1; index >= 0; --index) {
- RefPtrWillBeMember<CSSValue>& value = m_values.at(index);
- if (value && val && value->equals(*val)) {
+ CSSValue& value = m_values.at(index);
+ if (value.equals(val)) {
m_values.remove(index);
found = true;
}
@@ -52,11 +52,11 @@ bool CSSValueList::removeAll(CSSValue* val)
return found;
}
-bool CSSValueList::hasValue(CSSValue* val) const
+bool CSSValueList::hasValue(CSSValue val) const
{
for (size_t index = 0; index < m_values.size(); index++) {
- const RefPtrWillBeMember<CSSValue>& value = m_values.at(index);
- if (value && val && value->equals(*val))
+ const CSSValue& value = m_values.at(index);
+ if (value.equals(val))
return true;
}
return false;
@@ -105,7 +105,7 @@ String CSSValueList::customCSSText() const
for (unsigned i = 0; i < size; i++) {
if (!result.isEmpty())
result.append(separator);
- result.append(m_values[i]->cssText());
+ result.append(m_values[i].cssText());
}
return result.toString();
@@ -119,7 +119,7 @@ bool CSSValueList::equals(const CSSValueList& other) const
bool CSSValueList::hasFailedOrCanceledSubresources() const
{
for (unsigned i = 0; i < m_values.size(); ++i) {
- if (m_values[i]->hasFailedOrCanceledSubresources())
+ if (m_values[i].hasFailedOrCanceledSubresources())
return true;
}
return false;
@@ -127,8 +127,10 @@ bool CSSValueList::hasFailedOrCanceledSubresources() const
DEFINE_TRACE_AFTER_DISPATCH(CSSValueList)
{
- visitor->trace(m_values);
- CSSValue::traceAfterDispatch(visitor);
+ for (unsigned i = 0; i < m_values.size(); ++i) {
+ visitor->trace(m_values[i]);
+ }
+ CSSValueObject::traceAfterDispatch(visitor);
}
} // namespace blink
« no previous file with comments | « Source/core/css/CSSValueList.h ('k') | Source/core/css/CSSValueObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698