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

Unified Diff: third_party/WebKit/Source/core/editing/SurroundingText.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/SurroundingText.cpp
diff --git a/third_party/WebKit/Source/core/editing/SurroundingText.cpp b/third_party/WebKit/Source/core/editing/SurroundingText.cpp
index 0db8545a658d8ea0ad105cacde5c3b62d224a076..d22f472fe79944cde7def3e31687a6b080424323 100644
--- a/third_party/WebKit/Source/core/editing/SurroundingText.cpp
+++ b/third_party/WebKit/Source/core/editing/SurroundingText.cpp
@@ -55,7 +55,7 @@ SurroundingText::SurroundingText(const Position& position, unsigned maxLength)
void SurroundingText::initialize(const Position& startPosition, const Position& endPosition, unsigned maxLength)
{
- ASSERT(startPosition.document() == endPosition.document());
+ DCHECK_EQ(startPosition.document(), endPosition.document());
const unsigned halfMaxLength = maxLength / 2;
@@ -86,7 +86,7 @@ void SurroundingText::initialize(const Position& startPosition, const Position&
m_startOffsetInContent = Range::create(*document, backwardsIterator.endPosition(), startPosition)->text().length();
m_endOffsetInContent = Range::create(*document, backwardsIterator.endPosition(), endPosition)->text().length();
m_contentRange = Range::create(*document, backwardsIterator.endPosition(), forwardRange.startPosition());
- ASSERT(m_contentRange);
+ DCHECK(m_contentRange);
}
Range* SurroundingText::rangeFromContentOffsets(unsigned startOffsetInContent, unsigned endOffsetInContent)
@@ -96,17 +96,17 @@ Range* SurroundingText::rangeFromContentOffsets(unsigned startOffsetInContent, u
CharacterIterator iterator(m_contentRange->startPosition(), m_contentRange->endPosition());
- ASSERT(!iterator.atEnd());
+ DCHECK(!iterator.atEnd());
iterator.advance(startOffsetInContent);
Position start = iterator.startPosition();
- ASSERT(!iterator.atEnd());
+ DCHECK(!iterator.atEnd());
iterator.advance(endOffsetInContent - startOffsetInContent);
Position end = iterator.startPosition();
- ASSERT(start.document());
+ DCHECK(start.document());
return Range::create(*start.document(), start, end);
}

Powered by Google App Engine
This is Rietveld 408576698