Chromium Code Reviews| 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..f435851cb3d5aac97e96f4abdddde04761874abf 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_THREAD_SAFE_STATIC_LOCAL(CustomCountHistogram, preloadDelayHistogram, new CustomCountHistogram("WebCore.PreloadDelayMs", 0, 2000, 20)); |
|
esprehn
2016/02/04 23:25:23
main thread only, m_document below is only accessi
|
| + preloadDelayHistogram.count(duration); |
| m_document->loader()->startPreload(preload->resourceType(), request); |
| } |