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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 1652983005: Remove Enumeration Histograms from the Blink Platform API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_blink_histograms_5a
Patch Set: Rebase two new histograms were added today 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/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 137cd7f28260bb372ea04755cd5089b059b601c9..c8b6bbb43e7dda25024aca5a317ed59f7a45d8e9 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -52,9 +52,9 @@
#include "core/loader/NetworkHintsInterface.h"
#include "core/style/StyleInheritedData.h"
#include "platform/ContentType.h"
+#include "platform/Histogram.h"
#include "platform/MIMETypeRegistry.h"
#include "platform/RuntimeEnabledFeatures.h"
-#include "public/platform/Platform.h"
#include "wtf/StdLibExtras.h"
namespace blink {
@@ -534,6 +534,9 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
CSSParserContext parserContext(m_owner->document(), 0, baseURL, charset);
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, restoredCachedStyleSheetHistogram, ("Blink.RestoredCachedStyleSheet", 2));
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, restoredCachedStyleSheet2Histogram, ("Blink.RestoredCachedStyleSheet2", StyleSheetCacheStatusCount));
+
if (RefPtrWillBeRawPtr<StyleSheetContents> restoredSheet = const_cast<CSSStyleSheetResource*>(cachedStyleSheet)->restoreParsedStyleSheet(parserContext)) {
ASSERT(restoredSheet->isCacheable());
ASSERT(!restoredSheet->isLoading());
@@ -548,13 +551,13 @@ void LinkStyle::setCSSStyleSheet(const String& href, const KURL& baseURL, const
m_loading = false;
restoredSheet->checkLoaded();
- Platform::current()->histogramEnumeration("Blink.RestoredCachedStyleSheet", true, 2);
- Platform::current()->histogramEnumeration("Blink.RestoredCachedStyleSheet2", StyleSheetInMemoryCache, StyleSheetCacheStatusCount);
+ restoredCachedStyleSheetHistogram.count(true);
+ restoredCachedStyleSheet2Histogram.count(StyleSheetInMemoryCache);
return;
}
- Platform::current()->histogramEnumeration("Blink.RestoredCachedStyleSheet", false, 2);
+ restoredCachedStyleSheetHistogram.count(false);
StyleSheetCacheStatus cacheStatus = cachedStyleSheet->response().wasCached() ? StyleSheetInDiskCache : StyleSheetNewEntry;
- Platform::current()->histogramEnumeration("Blink.RestoredCachedStyleSheet2", cacheStatus, StyleSheetCacheStatusCount);
+ restoredCachedStyleSheet2Histogram.count(cacheStatus);
RefPtrWillBeRawPtr<StyleSheetContents> styleSheet = StyleSheetContents::create(href, parserContext);

Powered by Google App Engine
This is Rietveld 408576698