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

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: Fix misplaced bracket on android Created 4 years, 11 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..0bf3c2041dbf85044586e5be979fbeb8e16229a7 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::MaxObservedSizeFunction Partitions::m_maxSizeFunction = nullptr;
-void Partitions::initialize(HistogramEnumerationFunction histogramEnumeration)
+void Partitions::initialize(MaxObservedSizeFunction maxSizeFunction)
{
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_maxSizeFunction = maxSizeFunction;
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_maxSizeFunction)
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_maxSizeFunction(sizeInMB);
observedMaxSizeInMB = sizeInMB;
}
}

Powered by Google App Engine
This is Rietveld 408576698