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

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: More oilpan fixes & oilpan review feedback ; still failing tests Created 5 years, 6 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
Index: Source/core/css/CSSValueList.cpp
diff --git a/Source/core/css/CSSValueList.cpp b/Source/core/css/CSSValueList.cpp
index 08d4e165620f856d4400f328fdae8dc393bbd5f6..263c427f96fe9f527b6c9303735f79685ee4f10d 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 (size_t index = 0; index < m_values.size(); 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

Powered by Google App Engine
This is Rietveld 408576698