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

Unified Diff: third_party/WebKit/Source/core/svg/SVGLength.cpp

Issue 2738863002: Replace ASSERT with DCHECK in core/svg/ (Closed)
Patch Set: Split DCHECKS wherever possible 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/svg/SVGLength.cpp
diff --git a/third_party/WebKit/Source/core/svg/SVGLength.cpp b/third_party/WebKit/Source/core/svg/SVGLength.cpp
index 17e20c738e69623b7b40e604bd77365ba672e0bd..35b7843d5a1fa9c8073dc6a1fa0e21d98c7f054e 100644
--- a/third_party/WebKit/Source/core/svg/SVGLength.cpp
+++ b/third_party/WebKit/Source/core/svg/SVGLength.cpp
@@ -35,7 +35,7 @@ SVGLength::SVGLength(SVGLengthMode mode)
: m_value(
CSSPrimitiveValue::create(0, CSSPrimitiveValue::UnitType::UserUnits)),
m_unitMode(static_cast<unsigned>(mode)) {
- ASSERT(unitMode() == mode);
+ DCHECK_EQ(unitMode(), mode);
}
SVGLength::SVGLength(const SVGLength& o)
@@ -99,7 +99,7 @@ static bool isSupportedCSSUnitType(CSSPrimitiveValue::UnitType type) {
}
void SVGLength::setUnitType(CSSPrimitiveValue::UnitType type) {
- ASSERT(isSupportedCSSUnitType(type));
+ DCHECK(isSupportedCSSUnitType(type));
m_value = CSSPrimitiveValue::create(m_value->getFloatValue(), type);
}
@@ -166,7 +166,7 @@ void SVGLength::newValueSpecifiedUnits(CSSPrimitiveValue::UnitType type,
void SVGLength::convertToSpecifiedUnits(CSSPrimitiveValue::UnitType type,
const SVGLengthContext& context) {
- ASSERT(isSupportedCSSUnitType(type));
+ DCHECK(isSupportedCSSUnitType(type));
float valueInUserUnits = value(context);
m_value = CSSPrimitiveValue::create(
@@ -248,8 +248,8 @@ void SVGLength::calculateAnimatedValue(SVGAnimationElement* animationElement,
toLength->value(lengthContext),
toAtEndOfDurationLength->value(lengthContext), animatedNumber);
- ASSERT(unitMode() == lengthModeForAnimatedLengthAttribute(
- animationElement->attributeName()));
+ DCHECK_EQ(unitMode(), lengthModeForAnimatedLengthAttribute(
+ animationElement->attributeName()));
// TODO(shanmuga.m): Construct a calc() expression if the units fall in
// different categories.

Powered by Google App Engine
This is Rietveld 408576698