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

Unified Diff: third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 2755493004: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in core/css/ (Closed)
Patch Set: Worked on Review Comments done Created 3 years, 9 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: third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index 5501d85711565728aaa27bedf0ffdce1dc2dfb32..a83694be4fedc2fafb5022d1ee9bd73f69195735 100644
--- a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -71,7 +71,7 @@ Length animatableValueToLengthWithZoom(const AnimatableValue* value,
ValueRange range = ValueRangeAll) {
if (value->isLength())
return toAnimatableLength(value)->getLength(zoom, range);
- ASSERT(toAnimatableUnknown(value)->toCSSValueID() == CSSValueAuto);
+ DCHECK_EQ(toAnimatableUnknown(value)->toCSSValueID(), CSSValueAuto);
return Length(Auto);
}
@@ -98,7 +98,7 @@ BorderImageLength animatableValueToBorderImageLength(
if (value->isDouble())
return BorderImageLength(
clampTo<double>(toAnimatableDouble(value)->toDouble(), 0));
- ASSERT(toAnimatableUnknown(value)->toCSSValueID() == CSSValueAuto);
+ DCHECK_EQ(toAnimatableUnknown(value)->toCSSValueID(), CSSValueAuto);
return Length(Auto);
}
@@ -211,7 +211,7 @@ void setOnFillLayers(FillLayer& fillLayers,
StyleResolverState& state) {
const Vector<RefPtr<AnimatableValue>>& values =
toAnimatableRepeatable(value)->values();
- ASSERT(!values.isEmpty());
+ DCHECK(!values.isEmpty());
FillLayer* fillLayer = &fillLayers;
FillLayer* prev = 0;
for (size_t i = 0; i < values.size(); ++i) {
@@ -225,8 +225,8 @@ void setOnFillLayers(FillLayer& fillLayers,
fillLayer->setImage(state.styleImage(
property, *toAnimatableImage(layerValue)->toCSSValue()));
} else {
- ASSERT(toAnimatableUnknown(layerValue)->toCSSValueID() ==
- CSSValueNone);
+ DCHECK_EQ(toAnimatableUnknown(layerValue)->toCSSValueID(),
+ CSSValueNone);
fillLayer->setImage(nullptr);
}
break;
@@ -243,7 +243,7 @@ void setOnFillLayers(FillLayer& fillLayers,
setFillSize(fillLayer, layerValue, state);
break;
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
}
prev = fillLayer;
fillLayer = fillLayer->next();
@@ -267,14 +267,15 @@ void setOnFillLayers(FillLayer& fillLayers,
fillLayer->clearSize();
break;
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
}
fillLayer = fillLayer->next();
}
}
FontStretch animatableValueToFontStretch(const AnimatableValue* value) {
- ASSERT(FontStretchUltraCondensed == 1 && FontStretchUltraExpanded == 9);
+ DCHECK_EQ(FontStretchUltraCondensed, 1);
+ DCHECK_EQ(FontStretchUltraExpanded, 9);
unsigned index = round(toAnimatableDouble(value)->toDouble()) - 1;
static const FontStretch stretchValues[] = {
FontStretchUltraCondensed, FontStretchExtraCondensed,
@@ -311,8 +312,8 @@ TransformOperation* animatableValueToTransformOperation(
toAnimatableTransform(value)->transformOperations();
if (transformList.size() == 0)
return nullptr;
- ASSERT(transformList.size() == 1);
- ASSERT(transformList.operations()[0].get()->type() == type);
+ DCHECK_EQ(transformList.size(), static_cast<unsigned>(1));
tkent 2017/03/28 14:44:56 static_cast<unsigned>(1) -> 1u
nikhil.sahni 2017/03/30 12:17:58 Done.
+ DCHECK_EQ(transformList.operations()[0].get()->type(), type);
return transformList.operations()[0].get();
}
@@ -322,7 +323,7 @@ TransformOperation* animatableValueToTransformOperation(
void AnimatedStyleBuilder::applyProperty(CSSPropertyID property,
StyleResolverState& state,
const AnimatableValue* value) {
- ASSERT(CSSPropertyMetadata::isInterpolableProperty(property));
+ DCHECK(CSSPropertyMetadata::isInterpolableProperty(property));
if (value->isUnknown()) {
StyleBuilder::applyProperty(property, state,
*toAnimatableUnknown(value)->toCSSValue());
@@ -867,7 +868,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property,
return;
default:
- ASSERT_NOT_REACHED();
+ NOTREACHED();
}
}

Powered by Google App Engine
This is Rietveld 408576698