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

Unified Diff: third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp

Issue 2066253002: Fix Refcount in FontDataCache for objects from FontFallbackIterator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 years, 6 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/SegmentedFontData.cpp
diff --git a/third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp b/third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp
index 05fe81f4fd5a34220b838f17e6430f411a3db2c9..f7415af3044fcc5eb90889a24469144a2d13cb7b 100644
--- a/third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp
+++ b/third_party/WebKit/Source/platform/fonts/SegmentedFontData.cpp
@@ -38,19 +38,19 @@ SegmentedFontData::~SegmentedFontData()
const SimpleFontData* SegmentedFontData::fontDataForCharacter(UChar32 c) const
{
- Vector<FontDataForRangeSet>::const_iterator end = m_faces.end();
- for (Vector<FontDataForRangeSet>::const_iterator it = m_faces.begin(); it != end; ++it) {
- if (it->contains(c))
- return it->fontData();
+ auto end = m_faces.end();
+ for (auto it = m_faces.begin(); it != end; ++it) {
+ if ((*it)->contains(c))
+ return (*it)->fontData();
}
- return m_faces[0].fontData();
+ return m_faces[0]->fontData();
}
bool SegmentedFontData::containsCharacter(UChar32 c) const
{
- Vector<FontDataForRangeSet>::const_iterator end = m_faces.end();
- for (Vector<FontDataForRangeSet>::const_iterator it = m_faces.begin(); it != end; ++it) {
- if (it->contains(c))
+ auto end = m_faces.end();
+ for (auto it = m_faces.begin(); it != end; ++it) {
+ if ((*it)->contains(c))
return true;
}
return false;
@@ -64,9 +64,9 @@ bool SegmentedFontData::isCustomFont() const
bool SegmentedFontData::isLoading() const
{
- Vector<FontDataForRangeSet>::const_iterator end = m_faces.end();
- for (Vector<FontDataForRangeSet>::const_iterator it = m_faces.begin(); it != end; ++it) {
- if (it->fontData()->isLoading())
+ auto end = m_faces.end();
+ for (auto it = m_faces.begin(); it != end; ++it) {
+ if ((*it)->fontData()->isLoading())
return true;
}
return false;
@@ -75,9 +75,9 @@ bool SegmentedFontData::isLoading() const
// Returns true if any of the sub fonts are loadingFallback.
bool SegmentedFontData::isLoadingFallback() const
{
- Vector<FontDataForRangeSet>::const_iterator end = m_faces.end();
- for (Vector<FontDataForRangeSet>::const_iterator it = m_faces.begin(); it != end; ++it) {
- if (it->fontData()->isLoadingFallback())
+ auto end = m_faces.end();
+ for (auto it = m_faces.begin(); it != end; ++it) {
+ if ((*it)->fontData()->isLoadingFallback())
return true;
}
return false;
@@ -90,9 +90,9 @@ bool SegmentedFontData::isSegmented() const
bool SegmentedFontData::shouldSkipDrawing() const
{
- Vector<FontDataForRangeSet>::const_iterator end = m_faces.end();
- for (Vector<FontDataForRangeSet>::const_iterator it = m_faces.begin(); it != end; ++it) {
- if (it->fontData()->shouldSkipDrawing())
+ auto end = m_faces.end();
+ for (auto it = m_faces.begin(); it != end; ++it) {
+ if ((*it)->fontData()->shouldSkipDrawing())
return true;
}
return false;

Powered by Google App Engine
This is Rietveld 408576698