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

Unified Diff: third_party/WebKit/Source/web/WebKit.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/web/WebKit.cpp
diff --git a/third_party/WebKit/Source/web/WebKit.cpp b/third_party/WebKit/Source/web/WebKit.cpp
index 4b4c5f6509727fdd6c6538958b4e51b5b76e75b6..52896830db64193f7c4426ad44a3b023e0cca86e 100644
--- a/third_party/WebKit/Source/web/WebKit.cpp
+++ b/third_party/WebKit/Source/web/WebKit.cpp
@@ -43,6 +43,7 @@
#include "core/workers/WorkerGlobalScopeProxy.h"
#include "gin/public/v8_platform.h"
#include "modules/InitModules.h"
+#include "platform/Histogram.h"
#include "platform/LayoutTestSupport.h"
#include "platform/Logging.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -143,9 +144,16 @@ static double monotonicallyIncreasingTimeFunction()
return Platform::current()->monotonicallyIncreasingTimeSeconds();
}
-static void histogramEnumerationFunction(const char* name, int sample, int boundaryValue)
+static void maxObservedSizeFunction(size_t sizeInMB)
{
- Platform::current()->histogramEnumeration(name, sample, boundaryValue);
+ const size_t supportedMaxSizeInMB = 4 * 1024;
+ if (sizeInMB >= supportedMaxSizeInMB)
+ sizeInMB = supportedMaxSizeInMB - 1;
+
+ // Send a UseCounter only when we see the highest memory usage
+ // we've ever seen.
+ DEFINE_STATIC_LOCAL(EnumerationHistogram, committedSizeHistogram, ("PartitionAlloc.CommittedSize", supportedMaxSizeInMB));
+ committedSizeHistogram.count(sizeInMB);
}
static void callOnMainThreadFunction(WTF::MainThreadFunction function, void* context)
@@ -163,7 +171,7 @@ void initializeWithoutV8(Platform* platform)
ASSERT(!s_webKitInitialized);
s_webKitInitialized = true;
- WTF::Partitions::initialize(histogramEnumerationFunction);
+ WTF::Partitions::initialize(maxObservedSizeFunction);
ASSERT(platform);
Platform::initialize(platform);

Powered by Google App Engine
This is Rietveld 408576698