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

Unified Diff: third_party/WebKit/Source/core/testing/Internals.cpp

Issue 2137483003: Add UMA metrics for root scroller intervention to track forcing passive breakage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use HistogramTester Created 4 years, 5 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/testing/Internals.cpp
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index 33b5df0e89dd0152b0f46cfba0eb594ae0df6aa9..436435f3ad2a42af9ce65619aade882f65dc9408 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -138,6 +138,7 @@
#include "platform/heap/Handle.h"
#include "platform/inspector_protocol/FrontendChannel.h"
#include "platform/scroll/ProgrammaticScrollAnimator.h"
+#include "platform/testing/HistogramTester.h"
#include "platform/weborigin/SchemeRegistry.h"
#include "public/platform/Platform.h"
#include "public/platform/WebConnectionType.h"
@@ -221,6 +222,7 @@ Internals::~Internals()
}
static RuntimeEnabledFeatures::Backup* sFeaturesBackup = nullptr;
+static std::unique_ptr<HistogramTester> sHistogramSnapshot;
void Internals::resetToConsistentState(Page* page)
{
@@ -228,6 +230,8 @@ void Internals::resetToConsistentState(Page* page)
if (!sFeaturesBackup)
sFeaturesBackup = new RuntimeEnabledFeatures::Backup;
+ if (!sHistogramSnapshot)
+ sHistogramSnapshot.reset(new HistogramTester());
sFeaturesBackup->restore();
page->setIsCursorVisible(true);
page->setPageScaleFactor(1);
@@ -386,6 +390,16 @@ void Internals::clearHitTestCache(Document* doc, ExceptionState& exceptionState)
doc->layoutViewItem().clearHitTestCache();
}
+int Internals::histogramCount(const String& name, int bucket) const
+{
+ return sHistogramSnapshot->histogramCount(name.utf8().data(), bucket);
+}
+
+void Internals::clearHistogramCounts()
+{
+ sHistogramSnapshot.reset(new HistogramTester());
+}
+
bool Internals::isPreloaded(const String& url)
{
return isPreloadedBy(url, contextDocument());

Powered by Google App Engine
This is Rietveld 408576698