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

Unified Diff: Source/platform/fonts/FontCache.cpp

Issue 230303002: Revert of [Oilpan]: Moving the FontSelector/FontCacheClient, CSSSegmentedFontFace, and FontFaceCache to the o… (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 8 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/platform/fonts/FontCache.h ('k') | Source/platform/fonts/FontCacheClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/fonts/FontCache.cpp
diff --git a/Source/platform/fonts/FontCache.cpp b/Source/platform/fonts/FontCache.cpp
index c60c1dcd15cee91eb41bf3fcfedadc78fa5ec725..99fc13b34b1b14c466a790ac9b4c2f6b0e372da0 100644
--- a/Source/platform/fonts/FontCache.cpp
+++ b/Source/platform/fonts/FontCache.cpp
@@ -243,32 +243,24 @@
purgeFontVerticalDataCache();
}
-static bool invalidateFontCache = false;
-
-WillBeHeapHashSet<RawPtrWillBeWeakMember<FontCacheClient> >& fontCacheClients()
-{
-#if ENABLE(OILPAN)
- DEFINE_STATIC_LOCAL(Persistent<HeapHashSet<WeakMember<FontCacheClient> > >, clients, (new HeapHashSet<WeakMember<FontCacheClient> >()));
-#else
- DEFINE_STATIC_LOCAL(HashSet<RawPtr<FontCacheClient> >*, clients, (new HashSet<RawPtr<FontCacheClient> >()));
-#endif
- invalidateFontCache = true;
- return *clients;
-}
+static HashSet<FontCacheClient*>* gClients;
void FontCache::addClient(FontCacheClient* client)
{
- ASSERT(!fontCacheClients().contains(client));
- fontCacheClients().add(client);
-}
-
-#if !ENABLE(OILPAN)
+ if (!gClients)
+ gClients = new HashSet<FontCacheClient*>;
+
+ ASSERT(!gClients->contains(client));
+ gClients->add(client);
+}
+
void FontCache::removeClient(FontCacheClient* client)
{
- ASSERT(fontCacheClients().contains(client));
- fontCacheClients().remove(client);
-}
-#endif
+ ASSERT(gClients);
+ ASSERT(gClients->contains(client));
+
+ gClients->remove(client);
+}
static unsigned short gGeneration = 0;
@@ -279,7 +271,7 @@
void FontCache::invalidate()
{
- if (!invalidateFontCache) {
+ if (!gClients) {
ASSERT(!gFontPlatformDataCache);
return;
}
@@ -291,11 +283,11 @@
gGeneration++;
- WillBeHeapVector<RefPtrWillBeMember<FontCacheClient> > clients;
- size_t numClients = fontCacheClients().size();
+ Vector<RefPtr<FontCacheClient> > clients;
+ size_t numClients = gClients->size();
clients.reserveInitialCapacity(numClients);
- WillBeHeapHashSet<RawPtrWillBeWeakMember<FontCacheClient> >::iterator end = fontCacheClients().end();
- for (WillBeHeapHashSet<RawPtrWillBeWeakMember<FontCacheClient> >::iterator it = fontCacheClients().begin(); it != end; ++it)
+ HashSet<FontCacheClient*>::iterator end = gClients->end();
+ for (HashSet<FontCacheClient*>::iterator it = gClients->begin(); it != end; ++it)
clients.append(*it);
ASSERT(numClients == clients.size());
« no previous file with comments | « Source/platform/fonts/FontCache.h ('k') | Source/platform/fonts/FontCacheClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698