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

Unified Diff: third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.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/commands/SplitTextNodeCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
index 0d95952aeb1ca3a7d46b6eeb818ff53d8761f377..337da60b0d004ea34fb49a17e69ceec3cf8b4485 100644
--- a/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/SplitTextNodeCommand.cpp
@@ -43,10 +43,10 @@ SplitTextNodeCommand::SplitTextNodeCommand(Text* text, int offset)
// the second node (i.e. the new node is inserted before the existing one).
// That is not a fundamental dependency (i.e. it could be re-coded), but
// rather is based on how this code happens to work.
- ASSERT(m_text2);
- ASSERT(m_text2->length() > 0);
- ASSERT(m_offset > 0);
- ASSERT(m_offset < m_text2->length());
+ DCHECK(m_text2);
+ DCHECK_GT(m_text2->length(), 0u);
+ DCHECK_GT(m_offset, 0u);
+ DCHECK_LT(m_offset, m_text2->length());
}
void SplitTextNodeCommand::doApply(EditingState*)
@@ -60,7 +60,7 @@ void SplitTextNodeCommand::doApply(EditingState*)
return;
m_text1 = Text::create(document(), prefixText);
- ASSERT(m_text1);
+ DCHECK(m_text1);
document().markers().copyMarkers(m_text2.get(), 0, m_offset, m_text1.get(), 0);
insertText1AndTrimText2();
@@ -71,7 +71,7 @@ void SplitTextNodeCommand::doUnapply()
if (!m_text1 || !m_text1->hasEditableStyle())
return;
- ASSERT(m_text1->document() == document());
+ DCHECK_EQ(m_text1->document(), document());
String prefixText = m_text1->data();

Powered by Google App Engine
This is Rietveld 408576698