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

Unified Diff: third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp

Issue 1878473002: ASSERT -> DCHECK in core/editing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Output info for some DCHECKs, add TODOs. Created 4 years, 8 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/editing/serializers/MarkupFormatter.cpp
diff --git a/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp b/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp
index a16bdc05e5f3ffdca1b187270fd2b7d5620193dc..70eed4b4873fb217bef70320fa8fc54237f13a15 100644
--- a/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp
+++ b/third_party/WebKit/Source/core/editing/serializers/MarkupFormatter.cpp
@@ -95,7 +95,7 @@ void MarkupFormatter::appendCharactersReplacingEntities(StringBuilder& result, c
if (!(offset + length))
return;
- ASSERT(offset + length <= source.length());
+ DCHECK_LE(offset + length, source.length());
if (source.is8Bit())
appendCharactersReplacingEntitiesInternal(result, source.characters8() + offset, length, entityMaps, WTF_ARRAY_LENGTH(entityMaps), entityMask);
else
@@ -191,7 +191,7 @@ void MarkupFormatter::appendAttributeValue(StringBuilder& result, const String&
void MarkupFormatter::appendQuotedURLAttributeValue(StringBuilder& result, const Element& element, const Attribute& attribute)
{
- ASSERT(element.isURLAttribute(attribute));
+ DCHECK(element.isURLAttribute(attribute)) << element;
const String resolvedURLString = resolveURLIfNeeded(element, attribute.value());
UChar quoteChar = '"';
String strippedURLString = resolvedURLString.stripWhiteSpace();
@@ -375,7 +375,7 @@ void MarkupFormatter::appendAttribute(StringBuilder& result, const Element& elem
}
}
}
- ASSERT(prefixedName.prefix());
+ DCHECK(prefixedName.prefix());
appendNamespace(result, prefixedName.prefix(), attribute.namespaceURI(), *namespaces);
}
}
@@ -420,7 +420,7 @@ bool MarkupFormatter::shouldAddNamespaceElement(const Element& element, Namespac
bool MarkupFormatter::shouldAddNamespaceAttribute(const Attribute& attribute, const Element& element) const
{
// xmlns and xmlns:prefix attributes should be handled by another branch in appendAttribute.
- ASSERT(attribute.namespaceURI() != XMLNSNames::xmlnsNamespaceURI);
+ DCHECK_NE(attribute.namespaceURI(), XMLNSNames::xmlnsNamespaceURI);
// Attributes are in the null namespace by default.
if (!attribute.namespaceURI())

Powered by Google App Engine
This is Rietveld 408576698