| 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());
|
|
|