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

Unified Diff: Source/core/css/CSSFontSelector.cpp

Issue 18375005: [oilpan] Move CSSFontFace and CSSSegmentedFontFace to the managed heap (Closed) Base URL: svn://svn.chromium.org/blink/branches/oilpan
Patch Set: Created 7 years, 5 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
« no previous file with comments | « Source/core/css/CSSFontSelector.h ('k') | Source/core/css/CSSSegmentedFontFace.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()
« no previous file with comments | « Source/core/css/CSSFontSelector.h ('k') | Source/core/css/CSSSegmentedFontFace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698