Index: Source/core/css/CSSFontSelector.cpp |
diff --git a/Source/core/css/CSSFontSelector.cpp b/Source/core/css/CSSFontSelector.cpp |
index 8828f1d8863ead16c88051f5398f29cf4830c88e..71acba2ea8c34e94035c155c4aa42bfc8f59c447 100644 |
--- a/Source/core/css/CSSFontSelector.cpp |
+++ b/Source/core/css/CSSFontSelector.cpp |
@@ -487,7 +487,7 @@ PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDes |
return 0; |
} |
- CSSSegmentedFontFace* face = getFontFace(fontDescription, familyName); |
+ Handle<CSSSegmentedFontFace> face = getFontFace(fontDescription, familyName); |
// If no face was found, then return 0 and let the OS come up with its best match for the name. |
if (!face) { |
// If we were handed a generic family, but there was no match, go ahead and return the correct font based off our |
@@ -501,21 +501,22 @@ PassRefPtr<FontData> CSSFontSelector::getFontData(const FontDescription& fontDes |
return face->getFontData(fontDescription); |
} |
-CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDescription, const AtomicString& family) |
+Result<CSSSegmentedFontFace> CSSFontSelector::getFontFace(const FontDescription& fontDescription, const AtomicString& family) |
{ |
Vector<RefPtr<CSSFontFace> >* familyFontFaces = m_fontFaces.get(family); |
if (!familyFontFaces || familyFontFaces->isEmpty()) |
- return 0; |
+ return nullptr; |
- OwnPtr<HashMap<unsigned, RefPtr<CSSSegmentedFontFace> > >& segmentedFontFaceCache = m_fonts.add(family, nullptr).iterator->value; |
+ OwnPtr<HashMap<unsigned, Persistent<CSSSegmentedFontFace> > >& segmentedFontFaceCache = m_fonts.add(family, nullptr).iterator->value; |
if (!segmentedFontFaceCache) |
- segmentedFontFaceCache = adoptPtr(new HashMap<unsigned, RefPtr<CSSSegmentedFontFace> >); |
+ segmentedFontFaceCache = adoptPtr(new HashMap<unsigned, Persistent<CSSSegmentedFontFace> >); |
FontTraitsMask traitsMask = fontDescription.traitsMask(); |
- RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traitsMask, 0).iterator->value; |
+ Handle<CSSSegmentedFontFace> face = segmentedFontFaceCache->add(traitsMask, nullptr).iterator->value; |
if (!face) { |
face = CSSSegmentedFontFace::create(this); |
+ segmentedFontFaceCache->set(traitsMask, face); |
haraken
2013/07/08 09:20:08
The only suspicious place is here, but I confirmed
|
// Collect all matching faces and sort them in order of preference. |
Vector<CSSFontFace*, 32> candidateFontFaces; |
@@ -554,7 +555,7 @@ CSSSegmentedFontFace* CSSFontSelector::getFontFace(const FontDescription& fontDe |
for (unsigned i = 0; i < numCandidates; ++i) |
face->appendFontFace(candidateFontFaces[i]); |
} |
- return face.get(); |
+ return face; |
} |
void CSSFontSelector::clearDocument() |