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

Side by Side Diff: third_party/WebKit/WebCore/platform/graphics/FontCache.cpp

Issue 20076: WebKit merge 40500:40539 [WebKit side] (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> 3 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com>
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 269
270 if (it == end) { 270 if (it == end) {
271 // Removed everything 271 // Removed everything
272 gInactiveFontData->clear(); 272 gInactiveFontData->clear();
273 } else { 273 } else {
274 for (int i = 0; i < count; ++i) 274 for (int i = 0; i < count; ++i)
275 gInactiveFontData->remove(gInactiveFontData->begin()); 275 gInactiveFontData->remove(gInactiveFontData->begin());
276 } 276 }
277 277
278 Vector<FontPlatformDataCacheKey> keysToRemove; 278 Vector<FontPlatformDataCacheKey> keysToRemove;
279 keysToRemove.reserveCapacity(gFontPlatformDataCache->size()); 279 keysToRemove.reserveInitialCapacity(gFontPlatformDataCache->size());
280 FontPlatformDataCache::iterator platformDataEnd = gFontPlatformDataCache->en d(); 280 FontPlatformDataCache::iterator platformDataEnd = gFontPlatformDataCache->en d();
281 for (FontPlatformDataCache::iterator platformData = gFontPlatformDataCache-> begin(); platformData != platformDataEnd; ++platformData) { 281 for (FontPlatformDataCache::iterator platformData = gFontPlatformDataCache-> begin(); platformData != platformDataEnd; ++platformData) {
282 if (platformData->second && !gFontDataCache->contains(*platformData->sec ond)) 282 if (platformData->second && !gFontDataCache->contains(*platformData->sec ond))
283 keysToRemove.append(platformData->first); 283 keysToRemove.append(platformData->first);
284 } 284 }
285 285
286 size_t keysToRemoveCount = keysToRemove.size(); 286 size_t keysToRemoveCount = keysToRemove.size();
287 for (size_t i = 0; i < keysToRemoveCount; ++i) 287 for (size_t i = 0; i < keysToRemoveCount; ++i)
288 delete gFontPlatformDataCache->take(keysToRemove[i]); 288 delete gFontPlatformDataCache->take(keysToRemove[i]);
289 289
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 if (gFontPlatformDataCache) { 389 if (gFontPlatformDataCache) {
390 deleteAllValues(*gFontPlatformDataCache); 390 deleteAllValues(*gFontPlatformDataCache);
391 delete gFontPlatformDataCache; 391 delete gFontPlatformDataCache;
392 gFontPlatformDataCache = new FontPlatformDataCache; 392 gFontPlatformDataCache = new FontPlatformDataCache;
393 } 393 }
394 394
395 gGeneration++; 395 gGeneration++;
396 396
397 Vector<RefPtr<FontSelector> > clients; 397 Vector<RefPtr<FontSelector> > clients;
398 size_t numClients = gClients->size(); 398 size_t numClients = gClients->size();
399 clients.reserveCapacity(numClients); 399 clients.reserveInitialCapacity(numClients);
400 HashSet<FontSelector*>::iterator end = gClients->end(); 400 HashSet<FontSelector*>::iterator end = gClients->end();
401 for (HashSet<FontSelector*>::iterator it = gClients->begin(); it != end; ++i t) 401 for (HashSet<FontSelector*>::iterator it = gClients->begin(); it != end; ++i t)
402 clients.append(*it); 402 clients.append(*it);
403 403
404 ASSERT(numClients == clients.size()); 404 ASSERT(numClients == clients.size());
405 for (size_t i = 0; i < numClients; ++i) 405 for (size_t i = 0; i < numClients; ++i)
406 clients[i]->fontCacheInvalidated(); 406 clients[i]->fontCacheInvalidated();
407 407
408 purgeInactiveFontData(); 408 purgeInactiveFontData();
409 } 409 }
410 410
411 } // namespace WebCore 411 } // namespace WebCore
412 412
413 413
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698