Chromium Code Reviews| Index: Source/core/css/FontFaceCache.cpp |
| diff --git a/Source/core/css/FontFaceCache.cpp b/Source/core/css/FontFaceCache.cpp |
| index a85e9fa38b717455679aedeec71e2b3a1d82f5d8..c4ab2a56dc3c635810b38bde73caa9212c3f8424 100644 |
| --- a/Source/core/css/FontFaceCache.cpp |
| +++ b/Source/core/css/FontFaceCache.cpp |
| @@ -58,11 +58,11 @@ void FontFaceCache::addFontFace(CSSFontSelector* cssFontSelector, PassRefPtr<Fon |
| { |
| RefPtr<FontFace> fontFace = prpFontFace; |
| - OwnPtr<TraitsMap>& familyFontFaces = m_fontFaces.add(fontFace->family(), nullptr).storedValue->value; |
| + OwnPtrWillBeMember<TraitsMap>& familyFontFaces = m_fontFaces.add(fontFace->family(), nullptr).storedValue->value; |
| if (!familyFontFaces) |
| - familyFontFaces = adoptPtr(new TraitsMap); |
| + familyFontFaces = adoptPtrWillBeNoop(new TraitsMap); |
|
haraken
2014/04/07 14:10:12
In our experimental branch, I think we were using
wibling-chromium
2014/04/08 09:35:59
I am not sure we need conservative scanning to kee
haraken
2014/04/08 11:14:40
Sorry, this issue is not related to conservative s
wibling-chromium
2014/04/08 12:47:23
Just talked to Mads about this:)
As he also mentio
tkent
2014/04/08 13:45:38
Shouldn't we apply the add-new idiom to HeapHashMa
|
| - RefPtr<CSSSegmentedFontFace>& segmentedFontFace = familyFontFaces->add(fontFace->traits().mask(), nullptr).storedValue->value; |
| + RefPtrWillBeMember<CSSSegmentedFontFace>& segmentedFontFace = familyFontFaces->add(fontFace->traits().mask(), nullptr).storedValue->value; |
| if (!segmentedFontFace) |
| segmentedFontFace = CSSSegmentedFontFace::create(cssFontSelector, fontFace->traits()); |
| @@ -92,7 +92,7 @@ void FontFaceCache::removeFontFace(FontFace* fontFace, bool cssConnected) |
| TraitsMap::iterator familyFontFacesIter = familyFontFaces->find(fontFace->traits().mask()); |
| if (familyFontFacesIter == familyFontFaces->end()) |
| return; |
| - RefPtr<CSSSegmentedFontFace> segmentedFontFace = familyFontFacesIter->value; |
| + RefPtrWillBeRawPtr<CSSSegmentedFontFace> segmentedFontFace = familyFontFacesIter->value; |
| segmentedFontFace->removeFontFace(fontFace); |
| if (segmentedFontFace->isEmpty()) { |
| @@ -193,12 +193,12 @@ CSSSegmentedFontFace* FontFaceCache::get(const FontDescription& fontDescription, |
| if (!familyFontFaces || familyFontFaces->isEmpty()) |
| return 0; |
| - OwnPtr<TraitsMap>& segmentedFontFaceCache = m_fonts.add(family, nullptr).storedValue->value; |
| + OwnPtrWillBeMember<TraitsMap>& segmentedFontFaceCache = m_fonts.add(family, nullptr).storedValue->value; |
| if (!segmentedFontFaceCache) |
| - segmentedFontFaceCache = adoptPtr(new TraitsMap); |
| + segmentedFontFaceCache = adoptPtrWillBeNoop(new TraitsMap); |
| FontTraits traits = fontDescription.traits(); |
| - RefPtr<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traits.mask(), nullptr).storedValue->value; |
| + RefPtrWillBeMember<CSSSegmentedFontFace>& face = segmentedFontFaceCache->add(traits.mask(), nullptr).storedValue->value; |
| if (!face) { |
| for (TraitsMap::const_iterator i = familyFontFaces->begin(); i != familyFontFaces->end(); ++i) { |
| CSSSegmentedFontFace* candidate = i->value.get(); |
| @@ -214,4 +214,10 @@ CSSSegmentedFontFace* FontFaceCache::get(const FontDescription& fontDescription, |
| return face.get(); |
| } |
| +void FontFaceCache::trace(Visitor* visitor) |
| +{ |
| + visitor->trace(m_fontFaces); |
| + visitor->trace(m_fonts); |
| +} |
| + |
| } |