Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp |
| diff --git a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp |
| index a5e6a25fef1da2ec5d687de1c67b02e749555220..47c808942284722f246d51587bb0052cf89289a3 100644 |
| --- a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp |
| +++ b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLInputStream.cpp |
| @@ -52,17 +52,17 @@ HTMLInputCheckpoint BackgroundHTMLInputStream::createCheckpoint( |
| void BackgroundHTMLInputStream::invalidateCheckpointsBefore( |
| HTMLInputCheckpoint newFirstValidCheckpointIndex) { |
| - ASSERT(newFirstValidCheckpointIndex < m_checkpoints.size()); |
| + DCHECK_LT(newFirstValidCheckpointIndex, m_checkpoints.size()); |
| // There is nothing to do for the first valid checkpoint. |
| if (m_firstValidCheckpointIndex == newFirstValidCheckpointIndex) |
| return; |
| - ASSERT(newFirstValidCheckpointIndex > m_firstValidCheckpointIndex); |
| + DCHECK_GT(newFirstValidCheckpointIndex, m_firstValidCheckpointIndex); |
| const Checkpoint& lastInvalidCheckpoint = |
| m_checkpoints[newFirstValidCheckpointIndex - 1]; |
| - ASSERT(m_firstValidSegmentIndex <= |
| - lastInvalidCheckpoint.numberOfSegmentsAlreadyAppended); |
| + DCHECK_LE(m_firstValidSegmentIndex, |
| + lastInvalidCheckpoint.numberOfSegmentsAlreadyAppended); |
| for (size_t i = m_firstValidSegmentIndex; |
| i < lastInvalidCheckpoint.numberOfSegmentsAlreadyAppended; ++i) |
| m_segments[i] = String(); |
| @@ -79,11 +79,14 @@ void BackgroundHTMLInputStream::invalidateCheckpointsBefore( |
| void BackgroundHTMLInputStream::rewindTo(HTMLInputCheckpoint checkpointIndex, |
| const String& unparsedInput) { |
| - ASSERT(checkpointIndex < |
| - m_checkpoints |
| - .size()); // If this ASSERT fires, checkpointIndex is invalid. |
| + DCHECK_LT(checkpointIndex, |
| + m_checkpoints |
| + .size()); // If this ASSERT fires, checkpointIndex is invalid. |
|
kouhei (in TOK)
2017/03/16 12:47:23
Would you fix formatting here? Also, would you con
Hwanseung Lee
2017/03/16 14:29:54
i tried to change formatting. but i can't change f
|
| const Checkpoint& checkpoint = m_checkpoints[checkpointIndex]; |
| - ASSERT(!checkpoint.isNull()); |
| + |
| +#if DCHECK_IS_ON() |
|
Yoav Weiss
2017/03/16 10:24:44
Why the macro here?
|
| + DCHECK(!checkpoint.isNull()); |
|
Hwanseung Lee
2017/03/16 12:34:01
it is cause of build fail without "#if DCHECK_IS_O
|
| +#endif |
| bool isClosed = m_current.isClosed(); |
| @@ -91,7 +94,7 @@ void BackgroundHTMLInputStream::rewindTo(HTMLInputCheckpoint checkpointIndex, |
| for (size_t i = checkpoint.numberOfSegmentsAlreadyAppended; |
| i < m_segments.size(); ++i) { |
| - ASSERT(!m_segments[i].isNull()); |
| + DCHECK(!m_segments[i].isNull()); |
| m_current.append(SegmentedString(m_segments[i])); |
| } |
| @@ -103,7 +106,7 @@ void BackgroundHTMLInputStream::rewindTo(HTMLInputCheckpoint checkpointIndex, |
| if (isClosed && !m_current.isClosed()) |
| m_current.close(); |
| - ASSERT(m_current.isClosed() == isClosed); |
| + DCHECK_EQ(m_current.isClosed(), isClosed); |
| m_segments.clear(); |
| m_checkpoints.clear(); |