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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLResourcePreloader.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 side-by-side diff with in-line comments
Download patch
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);
}

Powered by Google App Engine
This is Rietveld 408576698