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

Unified Diff: third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp

Issue 2258033002: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Replace ASSERT()s with DCHECK*() in core/html/*.{cpp,h}. Created 4 years, 4 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/html/HTMLTextAreaElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
index 924d4db8765e4c888dcfb13aaf9e9c88bdff7a45..2f87bb4561f055287ec9158ca7d2b2acbe6325ab 100644
--- a/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLTextAreaElement.cpp
@@ -276,7 +276,7 @@ void HTMLTextAreaElement::handleFocusEvent(Element*, WebFocusType)
void HTMLTextAreaElement::subtreeHasChanged()
{
-#if ENABLE(ASSERT)
+#if DCHECK_IS_ON()
// The innerEditor should have either Text nodes or a placeholder break
// element. If we see other nodes, it's a bug in editing code and we should
// fix it.
@@ -284,8 +284,8 @@ void HTMLTextAreaElement::subtreeHasChanged()
for (Node& node : NodeTraversal::descendantsOf(*innerEditor)) {
if (node.isTextNode())
continue;
- ASSERT(isHTMLBRElement(node));
- ASSERT(&node == innerEditor->lastChild());
+ DCHECK(isHTMLBRElement(node));
+ DCHECK_EQ(&node, innerEditor->lastChild());
}
#endif
addPlaceholderBreakElementIfNecessary();
@@ -301,14 +301,14 @@ void HTMLTextAreaElement::subtreeHasChanged()
// When typing in a textarea, childrenChanged is not called, so we need to force the directionality check.
calculateAndAdjustDirectionality();
- ASSERT(document().isActive());
+ DCHECK(document().isActive());
document().frameHost()->chromeClient().didChangeValueInTextField(*this);
}
void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent* event) const
{
- ASSERT(event);
- ASSERT(layoutObject());
+ DCHECK(event);
+ DCHECK(layoutObject());
int signedMaxLength = maxLength();
if (signedMaxLength < 0)
return;
@@ -328,7 +328,7 @@ void HTMLTextAreaElement::handleBeforeTextInsertedEvent(BeforeTextInsertedEvent*
if (focused()) {
selectionLength = computeLengthForSubmission(document().frame()->selection().selectedText());
}
- ASSERT(currentLength >= selectionLength);
+ DCHECK_GE(currentLength, selectionLength);
unsigned baseLength = currentLength - selectionLength;
unsigned appendableLength = unsignedMaxLength > baseLength ? unsignedMaxLength - baseLength : 0;
event->setText(sanitizeUserInputValue(event->text(), appendableLength));

Powered by Google App Engine
This is Rietveld 408576698