Index: third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp |
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp |
index 91127c459a01464c991463d24e5d8459e63fe1b2..c6f6fc547a01c8f9b2bd12d87542d3a775a22daa 100644 |
--- a/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp |
+++ b/third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.cpp |
@@ -29,6 +29,7 @@ |
#include "core/fetch/FetchInitiatorInfo.h" |
#include "core/fetch/ResourceFetcher.h" |
#include "core/loader/DocumentLoader.h" |
+#include "platform/Histogram.h" |
#include "public/platform/Platform.h" |
namespace blink { |
@@ -75,7 +76,9 @@ void HTMLResourcePreloader::preload(PassOwnPtr<PreloadRequest> preload, const Ne |
if (preload->resourceType() == Resource::Script || preload->resourceType() == Resource::CSSStyleSheet || preload->resourceType() == Resource::ImportResource) |
request.setCharset(preload->charset().isEmpty() ? m_document->characterSet().string() : preload->charset()); |
request.setForPreload(true); |
- Platform::current()->histogramCustomCounts("WebCore.PreloadDelayMs", static_cast<int>(1000 * (monotonicallyIncreasingTime() - preload->discoveryTime())), 0, 2000, 20); |
+ int duration = static_cast<int>(1000 * (monotonicallyIncreasingTime() - preload->discoveryTime())); |
+ DEFINE_STATIC_LOCAL(CustomCountHistogram, preloadDelayHistogram, ("WebCore.PreloadDelayMs", 0, 2000, 20)); |
+ preloadDelayHistogram.count(duration); |
m_document->loader()->startPreload(preload->resourceType(), request); |
} |