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

Side by Side Diff: third_party/WebKit/Source/core/fetch/ResourceFetcher.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) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de)
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org)
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org)
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ 6 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/
7 7
8 This library is free software; you can redistribute it and/or 8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public 9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either 10 License as published by the Free Software Foundation; either
(...skipping 17 matching lines...) Expand all
28 28
29 #include "bindings/core/v8/V8DOMActivityLogger.h" 29 #include "bindings/core/v8/V8DOMActivityLogger.h"
30 #include "core/fetch/CrossOriginAccessControl.h" 30 #include "core/fetch/CrossOriginAccessControl.h"
31 #include "core/fetch/FetchContext.h" 31 #include "core/fetch/FetchContext.h"
32 #include "core/fetch/FetchInitiatorTypeNames.h" 32 #include "core/fetch/FetchInitiatorTypeNames.h"
33 #include "core/fetch/ImageResource.h" 33 #include "core/fetch/ImageResource.h"
34 #include "core/fetch/MemoryCache.h" 34 #include "core/fetch/MemoryCache.h"
35 #include "core/fetch/ResourceLoader.h" 35 #include "core/fetch/ResourceLoader.h"
36 #include "core/fetch/ResourceLoaderSet.h" 36 #include "core/fetch/ResourceLoaderSet.h"
37 #include "core/fetch/UniqueIdentifier.h" 37 #include "core/fetch/UniqueIdentifier.h"
38 #include "platform/Histogram.h"
38 #include "platform/Logging.h" 39 #include "platform/Logging.h"
39 #include "platform/RuntimeEnabledFeatures.h" 40 #include "platform/RuntimeEnabledFeatures.h"
40 #include "platform/TraceEvent.h" 41 #include "platform/TraceEvent.h"
41 #include "platform/TracedValue.h" 42 #include "platform/TracedValue.h"
42 #include "platform/mhtml/ArchiveResource.h" 43 #include "platform/mhtml/ArchiveResource.h"
43 #include "platform/mhtml/MHTMLArchive.h" 44 #include "platform/mhtml/MHTMLArchive.h"
44 #include "platform/network/ResourceTimingInfo.h" 45 #include "platform/network/ResourceTimingInfo.h"
45 #include "platform/weborigin/KnownPorts.h" 46 #include "platform/weborigin/KnownPorts.h"
46 #include "platform/weborigin/SecurityOrigin.h" 47 #include "platform/weborigin/SecurityOrigin.h"
47 #include "platform/weborigin/SecurityPolicy.h" 48 #include "platform/weborigin/SecurityPolicy.h"
(...skipping 1094 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 1143
1143 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder() 1144 ResourceFetcher::DeadResourceStatsRecorder::DeadResourceStatsRecorder()
1144 : m_useCount(0) 1145 : m_useCount(0)
1145 , m_revalidateCount(0) 1146 , m_revalidateCount(0)
1146 , m_loadCount(0) 1147 , m_loadCount(0)
1147 { 1148 {
1148 } 1149 }
1149 1150
1150 ResourceFetcher::DeadResourceStatsRecorder::~DeadResourceStatsRecorder() 1151 ResourceFetcher::DeadResourceStatsRecorder::~DeadResourceStatsRecorder()
1151 { 1152 {
1152 Platform::current()->histogramCustomCounts( 1153 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, hitCountHistogram, new CustomCountHistogram("WebCore.ResourceFetcher.HitCount", 0, 1000, 50));
1153 "WebCore.ResourceFetcher.HitCount", m_useCount, 0, 1000, 50); 1154 hitCountHistogram.count(m_useCount);
1154 Platform::current()->histogramCustomCounts( 1155 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, revalidateCountHistogr am, new CustomCountHistogram("WebCore.ResourceFetcher.RevalidateCount", 0, 1000, 50));
1155 "WebCore.ResourceFetcher.RevalidateCount", m_revalidateCount, 0, 1000, 5 0); 1156 revalidateCountHistogram.count(m_revalidateCount);
1156 Platform::current()->histogramCustomCounts( 1157 DEFINE_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, loadCountHistogram, ne w CustomCountHistogram("WebCore.ResourceFetcher.LoadCount", 0, 1000, 50));
1157 "WebCore.ResourceFetcher.LoadCount", m_loadCount, 0, 1000, 50); 1158 loadCountHistogram.count(m_loadCount);
1158 } 1159 }
1159 1160
1160 void ResourceFetcher::DeadResourceStatsRecorder::update(RevalidationPolicy polic y) 1161 void ResourceFetcher::DeadResourceStatsRecorder::update(RevalidationPolicy polic y)
1161 { 1162 {
1162 switch (policy) { 1163 switch (policy) {
1163 case Reload: 1164 case Reload:
1164 case Load: 1165 case Load:
1165 ++m_loadCount; 1166 ++m_loadCount;
1166 return; 1167 return;
1167 case Revalidate: 1168 case Revalidate:
(...skipping 12 matching lines...) Expand all
1180 visitor->trace(m_loaders); 1181 visitor->trace(m_loaders);
1181 visitor->trace(m_nonBlockingLoaders); 1182 visitor->trace(m_nonBlockingLoaders);
1182 #if ENABLE(OILPAN) 1183 #if ENABLE(OILPAN)
1183 visitor->trace(m_documentResources); 1184 visitor->trace(m_documentResources);
1184 visitor->trace(m_preloads); 1185 visitor->trace(m_preloads);
1185 visitor->trace(m_resourceTimingInfoMap); 1186 visitor->trace(m_resourceTimingInfoMap);
1186 #endif 1187 #endif
1187 } 1188 }
1188 1189
1189 } // namespace blink 1190 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698