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 13 matching lines...) Expand all Loading... |
24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | 24 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | 26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
28 */ | 28 */ |
29 | 29 |
30 #include "platform/fonts/FontCache.h" | 30 #include "platform/fonts/FontCache.h" |
31 | 31 |
32 #include "platform/FontFamilyNames.h" | 32 #include "platform/FontFamilyNames.h" |
33 | 33 |
| 34 #include "platform/Histogram.h" |
34 #include "platform/RuntimeEnabledFeatures.h" | 35 #include "platform/RuntimeEnabledFeatures.h" |
35 #include "platform/fonts/AlternateFontFamily.h" | 36 #include "platform/fonts/AlternateFontFamily.h" |
36 #include "platform/fonts/FontCacheClient.h" | 37 #include "platform/fonts/FontCacheClient.h" |
37 #include "platform/fonts/FontCacheKey.h" | 38 #include "platform/fonts/FontCacheKey.h" |
38 #include "platform/fonts/FontDataCache.h" | 39 #include "platform/fonts/FontDataCache.h" |
39 #include "platform/fonts/FontDescription.h" | 40 #include "platform/fonts/FontDescription.h" |
40 #include "platform/fonts/FontPlatformData.h" | 41 #include "platform/fonts/FontPlatformData.h" |
41 #include "platform/fonts/FontSmoothingMode.h" | 42 #include "platform/fonts/FontSmoothingMode.h" |
42 #include "platform/fonts/SimpleFontData.h" | 43 #include "platform/fonts/SimpleFontData.h" |
43 #include "platform/fonts/TextRenderingMode.h" | 44 #include "platform/fonts/TextRenderingMode.h" |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 { | 244 { |
244 unsigned items = 0; | 245 unsigned items = 0; |
245 if (gFallbackListShaperCache) { | 246 if (gFallbackListShaperCache) { |
246 FallbackListShaperCache::iterator iter; | 247 FallbackListShaperCache::iterator iter; |
247 for (iter = gFallbackListShaperCache->begin(); | 248 for (iter = gFallbackListShaperCache->begin(); |
248 iter != gFallbackListShaperCache->end(); ++iter) { | 249 iter != gFallbackListShaperCache->end(); ++iter) { |
249 items += iter->value->size(); | 250 items += iter->value->size(); |
250 } | 251 } |
251 gFallbackListShaperCache->clear(); | 252 gFallbackListShaperCache->clear(); |
252 } | 253 } |
253 Platform::current()->histogramCustomCounts("Blink.Fonts.ShapeCache", items,
1, 1000000, 50); | 254 DEFINE_STATIC_LOCAL(CustomCountHistogram, shapeCacheHistogram, ("Blink.Fonts
.ShapeCache", 1, 1000000, 50)); |
| 255 shapeCacheHistogram.count(items); |
254 } | 256 } |
255 | 257 |
256 void FontCache::invalidateShapeCache() | 258 void FontCache::invalidateShapeCache() |
257 { | 259 { |
258 purgeFallbackListShaperCache(); | 260 purgeFallbackListShaperCache(); |
259 } | 261 } |
260 | 262 |
261 void FontCache::purge(PurgeSeverity PurgeSeverity) | 263 void FontCache::purge(PurgeSeverity PurgeSeverity) |
262 { | 264 { |
263 // We should never be forcing the purge while the FontCachePurgePreventer is
in scope. | 265 // We should never be forcing the purge while the FontCachePurgePreventer is
in scope. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
357 iter != gFallbackListShaperCache->end(); | 359 iter != gFallbackListShaperCache->end(); |
358 ++iter) { | 360 ++iter) { |
359 shapeResultCacheSize += iter->value->byteSize(); | 361 shapeResultCacheSize += iter->value->byteSize(); |
360 } | 362 } |
361 dump->addScalar("size", "bytes", shapeResultCacheSize); | 363 dump->addScalar("size", "bytes", shapeResultCacheSize); |
362 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate
dObjectPoolName)); | 364 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate
dObjectPoolName)); |
363 } | 365 } |
364 | 366 |
365 | 367 |
366 } // namespace blink | 368 } // namespace blink |
OLD | NEW |