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

Unified Diff: third_party/WebKit/Source/wtf/Partitions.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/wtf/Partitions.cpp
diff --git a/third_party/WebKit/Source/wtf/Partitions.cpp b/third_party/WebKit/Source/wtf/Partitions.cpp
index 890ba9326e49df819a7d043f85c5a8fa2bad501d..b0e587de8d3639e4a85ff7feb4c3b70274bf787a 100644
--- a/third_party/WebKit/Source/wtf/Partitions.cpp
+++ b/third_party/WebKit/Source/wtf/Partitions.cpp
@@ -47,9 +47,9 @@ PartitionAllocatorGeneric Partitions::m_bufferAllocator;
SizeSpecificPartitionAllocator<3328> Partitions::m_nodeAllocator;
#endif
SizeSpecificPartitionAllocator<1024> Partitions::m_layoutAllocator;
-HistogramEnumerationFunction Partitions::m_histogramEnumeration = nullptr;
+Partitions::ReportPartitionAllocSizeFunction Partitions::m_reportSizeFunction = nullptr;
-void Partitions::initialize(HistogramEnumerationFunction histogramEnumeration)
+void Partitions::initialize(ReportPartitionAllocSizeFunction reportSizeFunction)
{
SpinLock::Guard guard(s_initializationLock);
@@ -61,7 +61,7 @@ void Partitions::initialize(HistogramEnumerationFunction histogramEnumeration)
m_nodeAllocator.init();
#endif
m_layoutAllocator.init();
- m_histogramEnumeration = histogramEnumeration;
+ m_reportSizeFunction = reportSizeFunction;
s_initialized = true;
}
}
@@ -99,22 +99,17 @@ void Partitions::decommitFreeableMemory()
void Partitions::reportMemoryUsageHistogram()
{
- static size_t supportedMaxSizeInMB = 4 * 1024;
static size_t observedMaxSizeInMB = 0;
- if (!m_histogramEnumeration)
+ if (!m_reportSizeFunction)
return;
// We only report the memory in the main thread.
if (!isMainThread())
return;
// +1 is for rounding up the sizeInMB.
size_t sizeInMB = Partitions::totalSizeOfCommittedPages() / 1024 / 1024 + 1;
- if (sizeInMB >= supportedMaxSizeInMB)
- sizeInMB = supportedMaxSizeInMB - 1;
if (sizeInMB > observedMaxSizeInMB) {
- // Send a UseCounter only when we see the highest memory usage
- // we've ever seen.
- m_histogramEnumeration("PartitionAlloc.CommittedSize", sizeInMB, supportedMaxSizeInMB);
+ m_reportSizeFunction(sizeInMB);
observedMaxSizeInMB = sizeInMB;
}
}

Powered by Google App Engine
This is Rietveld 408576698