Commit e56e395b authored by thakis's avatar thakis Committed by Commit bot

blink: Remove CHECK_CONSISTENCY.

This conditional build mode was added almost a decade ago in
http://bugs.webkig.org/show_bug.cgi?id=14981 and the code guarded
by it hasn't been compiling in a few weeks at least.  It's
probably safe to say that it hasn't been used in a long time.

BUG=675877

Review-Url: https://codereview.chromium.org/2871983002
Cr-Commit-Position: refs/heads/master@{#471111}
parent c3446d5d
......@@ -249,8 +249,6 @@ void LayoutText::WillBeDestroyed() {
}
void LayoutText::ExtractTextBox(InlineTextBox* box) {
CheckConsistency();
last_text_box_ = box->PrevTextBox();
if (box == first_text_box_)
first_text_box_ = nullptr;
......@@ -259,13 +257,9 @@ void LayoutText::ExtractTextBox(InlineTextBox* box) {
box->SetPreviousTextBox(nullptr);
for (InlineTextBox* curr = box; curr; curr = curr->NextTextBox())
curr->SetExtracted();
CheckConsistency();
}
void LayoutText::AttachTextBox(InlineTextBox* box) {
CheckConsistency();
if (last_text_box_) {
last_text_box_->SetNextTextBox(box);
box->SetPreviousTextBox(last_text_box_);
......@@ -278,13 +272,9 @@ void LayoutText::AttachTextBox(InlineTextBox* box) {
last = curr;
}
last_text_box_ = last;
CheckConsistency();
}
void LayoutText::RemoveTextBox(InlineTextBox* box) {
CheckConsistency();
if (box == first_text_box_)
first_text_box_ = box->NextTextBox();
if (box == last_text_box_)
......@@ -293,8 +283,6 @@ void LayoutText::RemoveTextBox(InlineTextBox* box) {
box->NextTextBox()->SetPreviousTextBox(box->PrevTextBox());
if (box->PrevTextBox())
box->PrevTextBox()->SetNextTextBox(box->NextTextBox());
CheckConsistency();
}
void LayoutText::DeleteTextBoxes() {
......@@ -2027,23 +2015,6 @@ unsigned LayoutText::ResolvedTextLength() const {
return len;
}
#if DCHECK_IS_ON()
void LayoutText::CheckConsistency() const {
#ifdef CHECK_CONSISTENCY
const InlineTextBox* prev = nullptr;
for (const InlineTextBox* child = m_firstTextBox; child;
child = child->nextTextBox()) {
DCHECK(child->getLineLayoutItem().isEqual(this));
DCHECK_EQ(child->prevTextBox(), prev);
prev = child;
}
DCHECK_EQ(prev, m_lastTextBox);
#endif
}
#endif
void LayoutText::MomentarilyRevealLastTypedCharacter(
unsigned last_typed_character_offset) {
if (!g_secure_text_timers)
......
......@@ -285,8 +285,6 @@ class CORE_EXPORT LayoutText : public LayoutObject {
LayoutRect LocalVisualRect() const override;
void CheckConsistency() const;
// We put the bitfield first to minimize padding on 64-bit.
// Whether or not we can be broken into multiple lines.
......@@ -351,10 +349,6 @@ inline float LayoutText::HyphenWidth(const Font& font,
DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutText, IsText());
#if !DCHECK_IS_ON()
inline void LayoutText::CheckConsistency() const {}
#endif
inline LayoutText* Text::GetLayoutObject() const {
return ToLayoutText(CharacterData::GetLayoutObject());
}
......
......@@ -95,7 +95,6 @@ void InlineFlowBox::AddToLine(InlineBox* child) {
DCHECK(!child->Parent());
DCHECK(!child->NextOnLine());
DCHECK(!child->PrevOnLine());
CheckConsistency();
child->SetParent(this);
if (!first_child_) {
......@@ -195,13 +194,9 @@ void InlineFlowBox::AddToLine(InlineBox* child) {
!ToInlineFlowBox(child)->KnownToHaveNoOverflow())
ClearKnownToHaveNoOverflow();
}
CheckConsistency();
}
void InlineFlowBox::RemoveChild(InlineBox* child, MarkLineBoxes mark_dirty) {
CheckConsistency();
if (mark_dirty == kMarkLineBoxesDirty && !IsDirty())
DirtyLineBoxes();
......@@ -217,8 +212,6 @@ void InlineFlowBox::RemoveChild(InlineBox* child, MarkLineBoxes mark_dirty) {
child->PrevOnLine()->SetNextOnLine(child->NextOnLine());
child->SetParent(nullptr);
CheckConsistency();
}
void InlineFlowBox::DeleteLine() {
......@@ -1720,21 +1713,4 @@ void InlineFlowBox::ShowLineTreeAndMark(const InlineBox* marked_box1,
#endif
#if DCHECK_IS_ON()
void InlineFlowBox::CheckConsistency() const {
#ifdef CHECK_CONSISTENCY
DCHECK(!m_hasBadChildList);
const InlineBox* prev = nullptr;
for (const InlineBox* child = m_firstChild; child;
child = child->nextOnLine()) {
DCHECK_EQ(child->parent(), this);
DCHECK_EQ(child->prevOnLine(), prev);
prev = child;
}
DCHECK_EQ(prev, m_lastChild);
#endif
}
#endif
} // namespace blink
......@@ -97,14 +97,8 @@ class InlineFlowBox : public InlineBox {
void SetNextLineBox(InlineFlowBox* n) { next_line_box_ = n; }
void SetPreviousLineBox(InlineFlowBox* p) { prev_line_box_ = p; }
InlineBox* FirstChild() const {
CheckConsistency();
return first_child_;
}
InlineBox* LastChild() const {
CheckConsistency();
return last_child_;
}
InlineBox* FirstChild() const { return first_child_; }
InlineBox* LastChild() const { return last_child_; }
bool IsLeaf() const final { return false; }
......@@ -282,7 +276,6 @@ class InlineFlowBox : public InlineBox {
bool HasTextDescendants() const { return has_text_descendants_; }
void SetHasTextDescendants() { has_text_descendants_ = true; }
void CheckConsistency() const;
void SetHasBadChildList();
// Line visual and layout overflow are in the coordinate space of the block.
......@@ -483,10 +476,6 @@ class InlineFlowBox : public InlineBox {
DEFINE_INLINE_BOX_TYPE_CASTS(InlineFlowBox);
#if !DCHECK_IS_ON()
inline void InlineFlowBox::CheckConsistency() const {}
#endif
inline void InlineFlowBox::SetHasBadChildList() {
#if DCHECK_IS_ON()
has_bad_child_list_ = true;
......
......@@ -48,8 +48,6 @@ LineBoxList::~LineBoxList() {
#endif
void LineBoxList::AppendLineBox(InlineFlowBox* box) {
CheckConsistency();
if (!first_line_box_) {
first_line_box_ = last_line_box_ = box;
} else {
......@@ -57,8 +55,6 @@ void LineBoxList::AppendLineBox(InlineFlowBox* box) {
box->SetPreviousLineBox(last_line_box_);
last_line_box_ = box;
}
CheckConsistency();
}
void LineBoxList::DeleteLineBoxTree() {
......@@ -73,8 +69,6 @@ void LineBoxList::DeleteLineBoxTree() {
}
void LineBoxList::ExtractLineBox(InlineFlowBox* box) {
CheckConsistency();
last_line_box_ = box->PrevLineBox();
if (box == first_line_box_)
first_line_box_ = nullptr;
......@@ -83,13 +77,9 @@ void LineBoxList::ExtractLineBox(InlineFlowBox* box) {
box->SetPreviousLineBox(nullptr);
for (InlineFlowBox* curr = box; curr; curr = curr->NextLineBox())
curr->SetExtracted();
CheckConsistency();
}
void LineBoxList::AttachLineBox(InlineFlowBox* box) {
CheckConsistency();
if (last_line_box_) {
last_line_box_->SetNextLineBox(box);
box->SetPreviousLineBox(last_line_box_);
......@@ -102,13 +92,9 @@ void LineBoxList::AttachLineBox(InlineFlowBox* box) {
last = curr;
}
last_line_box_ = last;
CheckConsistency();
}
void LineBoxList::RemoveLineBox(InlineFlowBox* box) {
CheckConsistency();
if (box == first_line_box_)
first_line_box_ = box->NextLineBox();
if (box == last_line_box_)
......@@ -117,8 +103,6 @@ void LineBoxList::RemoveLineBox(InlineFlowBox* box) {
box->NextLineBox()->SetPreviousLineBox(box->PrevLineBox());
if (box->PrevLineBox())
box->PrevLineBox()->SetNextLineBox(box->NextLineBox());
CheckConsistency();
}
void LineBoxList::DeleteLineBoxes() {
......@@ -369,19 +353,4 @@ void LineBoxList::DirtyLinesFromChangedChild(LineLayoutItem container,
}
}
#if DCHECK_IS_ON()
void LineBoxList::CheckConsistency() const {
#ifdef CHECK_CONSISTENCY
const InlineFlowBox* prev = nullptr;
for (const InlineFlowBox* child = m_firstLineBox; child;
child = child->nextLineBox()) {
DCHECK_EQ(child->prevLineBox(), prev);
prev = child;
}
DCHECK_EQ(prev, m_lastLineBox);
#endif
}
#endif
} // namespace blink
......@@ -57,8 +57,6 @@ class LineBoxList {
InlineFlowBox* FirstLineBox() const { return first_line_box_; }
InlineFlowBox* LastLineBox() const { return last_line_box_; }
void CheckConsistency() const;
void AppendLineBox(InlineFlowBox*);
void DeleteLineBoxTree();
......@@ -100,10 +98,6 @@ class LineBoxList {
InlineFlowBox* last_line_box_;
};
#if !DCHECK_IS_ON()
inline void LineBoxList::CheckConsistency() const {}
#endif
} // namespace blink
#endif // LineBoxList_h
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment