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

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

Issue 1659053002: Remove custom counts histogram from the blink API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a few thread_safe_static_local -> static_local as per feedback in reviews Created 4 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 13 matching lines...) Expand all
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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 { 279 {
279 unsigned items = 0; 280 unsigned items = 0;
280 if (gFallbackListShaperCache) { 281 if (gFallbackListShaperCache) {
281 FallbackListShaperCache::iterator iter; 282 FallbackListShaperCache::iterator iter;
282 for (iter = gFallbackListShaperCache->begin(); 283 for (iter = gFallbackListShaperCache->begin();
283 iter != gFallbackListShaperCache->end(); ++iter) { 284 iter != gFallbackListShaperCache->end(); ++iter) {
284 items += iter->value->size(); 285 items += iter->value->size();
285 } 286 }
286 gFallbackListShaperCache->clear(); 287 gFallbackListShaperCache->clear();
287 } 288 }
288 Platform::current()->histogramCustomCounts("Blink.Fonts.ShapeCache", items, 1, 1000000, 50); 289 DEFINE_STATIC_LOCAL(CustomCountHistogram, shapeCacheHistogram, ("Blink.Fonts .ShapeCache", 1, 1000000, 50));
290 shapeCacheHistogram.count(items);
289 } 291 }
290 292
291 void FontCache::invalidateShapeCache() 293 void FontCache::invalidateShapeCache()
292 { 294 {
293 purgeFallbackListShaperCache(); 295 purgeFallbackListShaperCache();
294 } 296 }
295 297
296 void FontCache::purge(PurgeSeverity PurgeSeverity) 298 void FontCache::purge(PurgeSeverity PurgeSeverity)
297 { 299 {
298 // We should never be forcing the purge while the FontCachePurgePreventer is in scope. 300 // 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
392 iter != gFallbackListShaperCache->end(); 394 iter != gFallbackListShaperCache->end();
393 ++iter) { 395 ++iter) {
394 shapeResultCacheSize += iter->value->byteSize(); 396 shapeResultCacheSize += iter->value->byteSize();
395 } 397 }
396 dump->addScalar("size", "bytes", shapeResultCacheSize); 398 dump->addScalar("size", "bytes", shapeResultCacheSize);
397 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate dObjectPoolName)); 399 memoryDump->addSuballocation(dump->guid(), String(WTF::Partitions::kAllocate dObjectPoolName));
398 } 400 }
399 401
400 402
401 } // namespace blink 403 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698