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

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc

Issue 2770203002: Replace DCHECK with DCHECK_op and split some DCHECKs wherever necessary (Closed)
Patch Set: Add few more 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
index 4be176f1e3ad4fa21e035decc06c1298d777beb1..f99de8aa89aecf545532860f6dbf51cb19a6b7a5 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_inline_node.cc
@@ -232,21 +232,23 @@ LayoutUnit NGLayoutInlineItem::InlineSize() const {
if (Type() == NGLayoutInlineItem::kText)
return LayoutUnit(shape_result_->width());
- DCHECK(Type() != NGLayoutInlineItem::kAtomicInline)
+ DCHECK_NE(Type(), NGLayoutInlineItem::kAtomicInline)
<< "Use NGInlineLayoutAlgorithm::InlineSize";
// Bidi controls and out-of-flow objects do not have in-flow widths.
return LayoutUnit();
}
LayoutUnit NGLayoutInlineItem::InlineSize(unsigned start, unsigned end) const {
- DCHECK(start >= StartOffset() && start <= end && end <= EndOffset());
+ DCHECK_GE(start, StartOffset());
+ DCHECK_LE(start, end);
+ DCHECK_LE(end, EndOffset());
if (start == end)
return LayoutUnit();
if (start == start_offset_ && end == end_offset_)
return InlineSize();
- DCHECK(Type() == NGLayoutInlineItem::kText);
+ DCHECK_EQ(Type(), NGLayoutInlineItem::kText);
return LayoutUnit(ShapeResultBuffer::getCharacterRange(
shape_result_, Direction(), shape_result_->width(),
start - StartOffset(), end - StartOffset())
@@ -257,7 +259,9 @@ void NGLayoutInlineItem::GetFallbackFonts(
HashSet<const SimpleFontData*>* fallback_fonts,
unsigned start,
unsigned end) const {
- DCHECK(start >= StartOffset() && start <= end && end <= EndOffset());
+ DCHECK_GE(start, StartOffset());
+ DCHECK_LE(start, end);
+ DCHECK_LE(end, EndOffset());
// TODO(kojii): Implement |start| and |end|.
shape_result_->fallbackFonts(fallback_fonts);

Powered by Google App Engine
This is Rietveld 408576698