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

Unified Diff: Source/WebCore/platform/graphics/FontCache.cpp

Issue 11348334: Merge 134871 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1312/
Patch Set: Created 8 years 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/WebCore/platform/graphics/FontCache.h ('k') | Source/WebCore/platform/graphics/SimpleFontData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/platform/graphics/FontCache.cpp
===================================================================
--- Source/WebCore/platform/graphics/FontCache.cpp (revision 136288)
+++ Source/WebCore/platform/graphics/FontCache.cpp (working copy)
@@ -228,7 +228,7 @@
}
#if ENABLE(OPENTYPE_VERTICAL)
-typedef HashMap<FontCache::FontFileKey, OwnPtr<OpenTypeVerticalData>, WTF::IntHash<FontCache::FontFileKey>, WTF::UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey> > FontVerticalDataCache;
+typedef HashMap<FontCache::FontFileKey, RefPtr<OpenTypeVerticalData>, WTF::IntHash<FontCache::FontFileKey>, WTF::UnsignedWithZeroKeyHashTraits<FontCache::FontFileKey> > FontVerticalDataCache;
FontVerticalDataCache& fontVerticalDataCacheInstance()
{
@@ -236,19 +236,17 @@
return fontVerticalDataCache;
}
-OpenTypeVerticalData* FontCache::getVerticalData(const FontFileKey& key, const FontPlatformData& platformData)
+PassRefPtr<OpenTypeVerticalData> FontCache::getVerticalData(const FontFileKey& key, const FontPlatformData& platformData)
{
FontVerticalDataCache& fontVerticalDataCache = fontVerticalDataCacheInstance();
FontVerticalDataCache::iterator result = fontVerticalDataCache.find(key);
if (result != fontVerticalDataCache.end())
- return result.get()->value.get();
+ return result.get()->value;
- OpenTypeVerticalData* verticalData = new OpenTypeVerticalData(platformData);
- if (!verticalData->isOpenType()) {
- delete verticalData;
- verticalData = 0; // Put 0 in cache to mark that this isn't an OpenType font.
- }
- fontVerticalDataCache.set(key, adoptPtr(verticalData));
+ RefPtr<OpenTypeVerticalData> verticalData = OpenTypeVerticalData::create(platformData);
+ if (!verticalData->isOpenType())
+ verticalData.clear();
+ fontVerticalDataCache.set(key, verticalData);
return verticalData;
}
#endif
« no previous file with comments | « Source/WebCore/platform/graphics/FontCache.h ('k') | Source/WebCore/platform/graphics/SimpleFontData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698