OLD | NEW |
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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 static bool invalidateFontCache = false; | 419 static bool invalidateFontCache = false; |
420 | 420 |
421 HeapHashSet<WeakMember<FontCacheClient>>& fontCacheClients() { | 421 HeapHashSet<WeakMember<FontCacheClient>>& fontCacheClients() { |
422 DEFINE_STATIC_LOCAL(HeapHashSet<WeakMember<FontCacheClient>>, clients, | 422 DEFINE_STATIC_LOCAL(HeapHashSet<WeakMember<FontCacheClient>>, clients, |
423 (new HeapHashSet<WeakMember<FontCacheClient>>)); | 423 (new HeapHashSet<WeakMember<FontCacheClient>>)); |
424 invalidateFontCache = true; | 424 invalidateFontCache = true; |
425 return clients; | 425 return clients; |
426 } | 426 } |
427 | 427 |
428 void FontCache::addClient(FontCacheClient* client) { | 428 void FontCache::addClient(FontCacheClient* client) { |
| 429 CHECK(client); |
429 ASSERT(!fontCacheClients().contains(client)); | 430 ASSERT(!fontCacheClients().contains(client)); |
430 fontCacheClients().insert(client); | 431 fontCacheClients().insert(client); |
431 } | 432 } |
432 | 433 |
433 static unsigned short gGeneration = 0; | 434 static unsigned short gGeneration = 0; |
434 | 435 |
435 unsigned short FontCache::generation() { | 436 unsigned short FontCache::generation() { |
436 return gGeneration; | 437 return gGeneration; |
437 } | 438 } |
438 | 439 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 for (iter = gFallbackListShaperCache->begin(); | 503 for (iter = gFallbackListShaperCache->begin(); |
503 iter != gFallbackListShaperCache->end(); ++iter) { | 504 iter != gFallbackListShaperCache->end(); ++iter) { |
504 shapeResultCacheSize += iter->value->byteSize(); | 505 shapeResultCacheSize += iter->value->byteSize(); |
505 } | 506 } |
506 dump->AddScalar("size", "bytes", shapeResultCacheSize); | 507 dump->AddScalar("size", "bytes", shapeResultCacheSize); |
507 memoryDump->AddSuballocation(dump->guid(), | 508 memoryDump->AddSuballocation(dump->guid(), |
508 WTF::Partitions::kAllocatedObjectPoolName); | 509 WTF::Partitions::kAllocatedObjectPoolName); |
509 } | 510 } |
510 | 511 |
511 } // namespace blink | 512 } // namespace blink |
OLD | NEW |