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

Unified Diff: third_party/WebKit/Source/core/layout/Grid.cpp

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/Grid.cpp
diff --git a/third_party/WebKit/Source/core/layout/Grid.cpp b/third_party/WebKit/Source/core/layout/Grid.cpp
index 1a06366ceb373dc559f290b3474048c33063abb0..ae3704d4adb5eb09ab97813ac16fdca0cca9d5d6 100644
--- a/third_party/WebKit/Source/core/layout/Grid.cpp
+++ b/third_party/WebKit/Source/core/layout/Grid.cpp
@@ -31,8 +31,8 @@ void Grid::ensureGridSize(size_t maximumRowSize, size_t maximumColumnSize) {
}
void Grid::insert(LayoutBox& child, const GridArea& area) {
- DCHECK(area.rows.isTranslatedDefinite() &&
- area.columns.isTranslatedDefinite());
+ DCHECK(area.rows.isTranslatedDefinite());
+ DCHECK(area.columns.isTranslatedDefinite());
ensureGridSize(area.rows.endLine(), area.columns.endLine());
for (const auto& row : area.rows) {
@@ -164,8 +164,8 @@ GridIterator::GridIterator(const Grid& grid,
m_childIndex(0) {
DCHECK(!m_grid.isEmpty());
DCHECK(!m_grid[0].isEmpty());
- DCHECK(m_rowIndex < m_grid.size());
- DCHECK(m_columnIndex < m_grid[0].size());
+ DCHECK_LT(m_rowIndex, m_grid.size());
+ DCHECK_LT(m_columnIndex, m_grid[0].size());
}
LayoutBox* GridIterator::nextGridItem() {
@@ -212,7 +212,8 @@ std::unique_ptr<GridArea> GridIterator::nextEmptyGridArea(
size_t varyingTrackSpan) {
DCHECK(!m_grid.isEmpty());
DCHECK(!m_grid[0].isEmpty());
- DCHECK(fixedTrackSpan >= 1 && varyingTrackSpan >= 1);
+ DCHECK_GE(fixedTrackSpan, 1u);
+ DCHECK_GE(varyingTrackSpan, 1u);
size_t rowSpan =
(m_direction == ForColumns) ? varyingTrackSpan : fixedTrackSpan;

Powered by Google App Engine
This is Rietveld 408576698