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

Unified Diff: third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp

Issue 2807913002: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/fonts (Closed)
Patch Set: Replace ASSERT, ASSERT_NOT_REACHED, and RELEASE_ASSERT in platform/fonts 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/platform/fonts/shaping/ShapeResult.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
index 5cbce4bbc90ae62283d70a76e775488a7cce5651..8dcdf9e8d94b10af9da19c975125642d21028ddf 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeResult.cpp
@@ -43,7 +43,7 @@ namespace blink {
float ShapeResult::RunInfo::xPositionForVisualOffset(
unsigned offset,
AdjustMidCluster adjustMidCluster) const {
- ASSERT(offset < m_numCharacters);
+ DCHECK_LT(offset, m_numCharacters);
if (rtl())
offset = m_numCharacters - offset - 1;
return xPositionForOffset(offset, adjustMidCluster);
@@ -52,7 +52,7 @@ float ShapeResult::RunInfo::xPositionForVisualOffset(
float ShapeResult::RunInfo::xPositionForOffset(
unsigned offset,
AdjustMidCluster adjustMidCluster) const {
- ASSERT(offset <= m_numCharacters);
+ DCHECK_LE(offset, m_numCharacters);
const unsigned numGlyphs = m_glyphData.size();
unsigned glyphIndex = 0;
float position = 0;
@@ -266,8 +266,8 @@ float ShapeResult::positionForOffset(unsigned absoluteOffset) const {
void ShapeResult::fallbackFonts(
HashSet<const SimpleFontData*>* fallback) const {
- ASSERT(fallback);
- ASSERT(m_primaryFont);
+ DCHECK(fallback);
+ DCHECK(m_primaryFont);
for (unsigned i = 0; i < m_runs.size(); ++i) {
if (m_runs[i] && m_runs[i]->m_fontData &&
m_runs[i]->m_fontData != m_primaryFont &&
@@ -339,9 +339,9 @@ void ShapeResult::insertRun(std::unique_ptr<ShapeResult::RunInfo> runToInsert,
unsigned startGlyph,
unsigned numGlyphs,
hb_buffer_t* harfBuzzBuffer) {
- ASSERT(numGlyphs > 0);
+ DCHECK_GT(numGlyphs, 0u);
std::unique_ptr<ShapeResult::RunInfo> run(std::move(runToInsert));
- ASSERT(numGlyphs == run->m_glyphData.size());
+ DCHECK_EQ(numGlyphs, run->m_glyphData.size());
const SimpleFontData* currentFontData = run->m_fontData.get();
const hb_glyph_info_t* glyphInfos =
@@ -390,7 +390,7 @@ void ShapeResult::insertRun(std::unique_ptr<ShapeResult::RunInfo> runToInsert,
run->m_width = std::max(0.0f, totalAdvance);
m_width += run->m_width;
m_numGlyphs += numGlyphs;
- ASSERT(m_numGlyphs >= numGlyphs);
+ DCHECK_GE(m_numGlyphs, numGlyphs);
m_hasVerticalOffsets |= hasVerticalOffsets;
// The runs are stored in result->m_runs in visual order. For LTR, we place

Powered by Google App Engine
This is Rietveld 408576698