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

Unified Diff: third_party/WebKit/Source/core/dom/ViewportDescription.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/dom/ViewportDescription.cpp
diff --git a/third_party/WebKit/Source/core/dom/ViewportDescription.cpp b/third_party/WebKit/Source/core/dom/ViewportDescription.cpp
index c57e8f63c090d115f3f565a7e46413da0b212b15..8fd6d2414978b3a0b07e77db97dc5d738755dab7 100644
--- a/third_party/WebKit/Source/core/dom/ViewportDescription.cpp
+++ b/third_party/WebKit/Source/core/dom/ViewportDescription.cpp
@@ -34,7 +34,6 @@
#include "core/frame/Settings.h"
#include "platform/Histogram.h"
#include "platform/weborigin/KURL.h"
-#include "public/platform/Platform.h"
namespace blink {
@@ -221,18 +220,15 @@ void ViewportDescription::reportMobilePageStats(const LocalFrame* mainFrame) con
if (!mainFrame->document()->url().protocolIsInHTTPFamily())
return;
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, metaTagTypeHistogram, ("Viewport.MetaTagType", TypeCount));
if (!isSpecifiedByAuthor()) {
- if (mainFrame->document()->isMobileDocument())
- Platform::current()->histogramEnumeration("Viewport.MetaTagType", XhtmlMobileProfile, TypeCount);
- else
- Platform::current()->histogramEnumeration("Viewport.MetaTagType", NoViewportTag, TypeCount);
-
+ metaTagTypeHistogram.count(mainFrame->document()->isMobileDocument() ? XhtmlMobileProfile : NoViewportTag);
return;
}
if (isMetaViewportType()) {
if (maxWidth.type() == blink::Fixed) {
- Platform::current()->histogramEnumeration("Viewport.MetaTagType", ConstantWidth, TypeCount);
+ metaTagTypeHistogram.count(ConstantWidth);
if (mainFrame->view()) {
// To get an idea of how "far" the viewport is from the device's ideal width, we
@@ -245,15 +241,15 @@ void ViewportDescription::reportMobilePageStats(const LocalFrame* mainFrame) con
}
} else if (maxWidth.type() == blink::DeviceWidth || maxWidth.type() == blink::ExtendToZoom) {
- Platform::current()->histogramEnumeration("Viewport.MetaTagType", DeviceWidth, TypeCount);
+ metaTagTypeHistogram.count(DeviceWidth);
} else {
// Overflow bucket for cases we may be unaware of.
- Platform::current()->histogramEnumeration("Viewport.MetaTagType", MetaWidthOther, TypeCount);
+ metaTagTypeHistogram.count(MetaWidthOther);
}
} else if (type == ViewportDescription::HandheldFriendlyMeta) {
- Platform::current()->histogramEnumeration("Viewport.MetaTagType", MetaHandheldFriendly, TypeCount);
+ metaTagTypeHistogram.count(MetaHandheldFriendly);
} else if (type == ViewportDescription::MobileOptimizedMeta) {
- Platform::current()->histogramEnumeration("Viewport.MetaTagType", MobileOptimizedMeta, TypeCount);
+ metaTagTypeHistogram.count(MobileOptimizedMeta);
}
#endif
}

Powered by Google App Engine
This is Rietveld 408576698