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

Unified Diff: third_party/WebKit/Source/core/editing/EphemeralRange.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/EphemeralRange.cpp
diff --git a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
index 30f030415ae40820b7d3349d4b47a5506afed2f3..b4aefe4a2f086dc290f9a9f625d101e2e902328f 100644
--- a/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
+++ b/third_party/WebKit/Source/core/editing/EphemeralRange.cpp
@@ -20,20 +20,20 @@ EphemeralRangeTemplate<Strategy>::EphemeralRangeTemplate(const PositionTemplate<
#endif
{
if (m_startPosition.isNull()) {
- ASSERT(m_endPosition.isNull());
+ DCHECK(m_endPosition.isNull());
return;
}
- ASSERT(m_endPosition.isNotNull());
- ASSERT(m_startPosition.document() == m_endPosition.document());
- ASSERT(m_startPosition.inShadowIncludingDocument());
- ASSERT(m_endPosition.inShadowIncludingDocument());
+ DCHECK(m_endPosition.isNotNull());
+ DCHECK_EQ(m_startPosition.document(), m_endPosition.document());
+ DCHECK(m_startPosition.inShadowIncludingDocument());
+ DCHECK(m_endPosition.inShadowIncludingDocument());
}
template <typename Strategy>
EphemeralRangeTemplate<Strategy>::EphemeralRangeTemplate(const EphemeralRangeTemplate<Strategy>& other)
: EphemeralRangeTemplate(other.m_startPosition, other.m_endPosition)
{
- ASSERT(other.isValid());
+ DCHECK(other.isValid());
}
template <typename Strategy>
@@ -47,7 +47,7 @@ EphemeralRangeTemplate<Strategy>::EphemeralRangeTemplate(const Range* range)
{
if (!range)
return;
- ASSERT(range->inShadowIncludingDocument());
+ DCHECK(range->inShadowIncludingDocument());
m_startPosition = fromPositionInDOMTree<Strategy>(range->startPosition());
m_endPosition = fromPositionInDOMTree<Strategy>(range->endPosition());
#if ENABLE(ASSERT)
@@ -68,7 +68,7 @@ EphemeralRangeTemplate<Strategy>::~EphemeralRangeTemplate()
template <typename Strategy>
EphemeralRangeTemplate<Strategy>& EphemeralRangeTemplate<Strategy>::operator=(const EphemeralRangeTemplate<Strategy>& other)
{
- ASSERT(other.isValid());
+ DCHECK(other.isValid());
m_startPosition = other.m_startPosition;
m_endPosition = other.m_endPosition;
#if ENABLE(ASSERT)
@@ -92,28 +92,28 @@ bool EphemeralRangeTemplate<Strategy>::operator!=(const EphemeralRangeTemplate<S
template <typename Strategy>
Document& EphemeralRangeTemplate<Strategy>::document() const
{
- ASSERT(isNotNull());
+ DCHECK(isNotNull());
return *m_startPosition.document();
}
template <typename Strategy>
PositionTemplate<Strategy> EphemeralRangeTemplate<Strategy>::startPosition() const
{
- ASSERT(isValid());
+ DCHECK(isValid());
return m_startPosition;
}
template <typename Strategy>
PositionTemplate<Strategy> EphemeralRangeTemplate<Strategy>::endPosition() const
{
- ASSERT(isValid());
+ DCHECK(isValid());
return m_endPosition;
}
template <typename Strategy>
bool EphemeralRangeTemplate<Strategy>::isCollapsed() const
{
- ASSERT(isValid());
+ DCHECK(isValid());
return m_startPosition == m_endPosition;
}

Powered by Google App Engine
This is Rietveld 408576698