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

Side by Side Diff: third_party/WebKit/Source/core/layout/line/LineBoxList.cpp

Issue 2748103015: Replace ASSERT with DCHECK in core/layout/<sub dirs> (Closed)
Patch Set: Rebase with latest Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 24 matching lines...) Expand all
35 #include "core/layout/api/LineLayoutItem.h" 35 #include "core/layout/api/LineLayoutItem.h"
36 #include "core/layout/line/InlineTextBox.h" 36 #include "core/layout/line/InlineTextBox.h"
37 #include "core/layout/line/RootInlineBox.h" 37 #include "core/layout/line/RootInlineBox.h"
38 #include "core/paint/InlinePainter.h" 38 #include "core/paint/InlinePainter.h"
39 #include "core/paint/PaintInfo.h" 39 #include "core/paint/PaintInfo.h"
40 40
41 namespace blink { 41 namespace blink {
42 42
43 #if DCHECK_IS_ON() 43 #if DCHECK_IS_ON()
44 LineBoxList::~LineBoxList() { 44 LineBoxList::~LineBoxList() {
45 ASSERT(!m_firstLineBox); 45 DCHECK(!m_firstLineBox);
46 ASSERT(!m_lastLineBox); 46 DCHECK(!m_lastLineBox);
47 } 47 }
48 #endif 48 #endif
49 49
50 void LineBoxList::appendLineBox(InlineFlowBox* box) { 50 void LineBoxList::appendLineBox(InlineFlowBox* box) {
51 checkConsistency(); 51 checkConsistency();
52 52
53 if (!m_firstLineBox) { 53 if (!m_firstLineBox) {
54 m_firstLineBox = m_lastLineBox = box; 54 m_firstLineBox = m_lastLineBox = box;
55 } else { 55 } else {
56 m_lastLineBox->setNextLineBox(box); 56 m_lastLineBox->setNextLineBox(box);
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 nextRootBox->markDirty(); 365 nextRootBox->markDirty();
366 } 366 }
367 } 367 }
368 368
369 #if DCHECK_IS_ON() 369 #if DCHECK_IS_ON()
370 void LineBoxList::checkConsistency() const { 370 void LineBoxList::checkConsistency() const {
371 #ifdef CHECK_CONSISTENCY 371 #ifdef CHECK_CONSISTENCY
372 const InlineFlowBox* prev = nullptr; 372 const InlineFlowBox* prev = nullptr;
373 for (const InlineFlowBox* child = m_firstLineBox; child; 373 for (const InlineFlowBox* child = m_firstLineBox; child;
374 child = child->nextLineBox()) { 374 child = child->nextLineBox()) {
375 ASSERT(child->prevLineBox() == prev); 375 DCHECK_EQ(child->prevLineBox(), prev);
376 prev = child; 376 prev = child;
377 } 377 }
378 ASSERT(prev == m_lastLineBox); 378 DCHECK_EQ(prev, m_lastLineBox);
379 #endif 379 #endif
380 } 380 }
381 381
382 #endif 382 #endif
383 383
384 } // namespace blink 384 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698