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

Side by Side Diff: third_party/WebKit/Source/platform/fonts/FontCache.cpp

Issue 2657443005: Migrate WTF::HashSet::add() to ::insert() [part 1 of N] (Closed)
Patch Set: Created 3 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
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 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 409
410 HeapHashSet<WeakMember<FontCacheClient>>& fontCacheClients() { 410 HeapHashSet<WeakMember<FontCacheClient>>& fontCacheClients() {
411 DEFINE_STATIC_LOCAL(HeapHashSet<WeakMember<FontCacheClient>>, clients, 411 DEFINE_STATIC_LOCAL(HeapHashSet<WeakMember<FontCacheClient>>, clients,
412 (new HeapHashSet<WeakMember<FontCacheClient>>)); 412 (new HeapHashSet<WeakMember<FontCacheClient>>));
413 invalidateFontCache = true; 413 invalidateFontCache = true;
414 return clients; 414 return clients;
415 } 415 }
416 416
417 void FontCache::addClient(FontCacheClient* client) { 417 void FontCache::addClient(FontCacheClient* client) {
418 ASSERT(!fontCacheClients().contains(client)); 418 ASSERT(!fontCacheClients().contains(client));
419 fontCacheClients().add(client); 419 fontCacheClients().insert(client);
420 } 420 }
421 421
422 static unsigned short gGeneration = 0; 422 static unsigned short gGeneration = 0;
423 423
424 unsigned short FontCache::generation() { 424 unsigned short FontCache::generation() {
425 return gGeneration; 425 return gGeneration;
426 } 426 }
427 427
428 void FontCache::invalidate() { 428 void FontCache::invalidate() {
429 if (!invalidateFontCache) { 429 if (!invalidateFontCache) {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
482 for (iter = gFallbackListShaperCache->begin(); 482 for (iter = gFallbackListShaperCache->begin();
483 iter != gFallbackListShaperCache->end(); ++iter) { 483 iter != gFallbackListShaperCache->end(); ++iter) {
484 shapeResultCacheSize += iter->value->byteSize(); 484 shapeResultCacheSize += iter->value->byteSize();
485 } 485 }
486 dump->AddScalar("size", "bytes", shapeResultCacheSize); 486 dump->AddScalar("size", "bytes", shapeResultCacheSize);
487 memoryDump->AddSuballocation(dump->guid(), 487 memoryDump->AddSuballocation(dump->guid(),
488 WTF::Partitions::kAllocatedObjectPoolName); 488 WTF::Partitions::kAllocatedObjectPoolName);
489 } 489 }
490 490
491 } // namespace blink 491 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698