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

Unified Diff: base/memory/memory_pressure_monitor_win.cc

Issue 2434103003: Add Mac memory pressure statistic reporting and consolidate platform code (Closed)
Patch Set: Add radar ID Created 4 years, 1 month 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
« no previous file with comments | « base/memory/memory_pressure_monitor_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/memory_pressure_monitor_win.cc
diff --git a/base/memory/memory_pressure_monitor_win.cc b/base/memory/memory_pressure_monitor_win.cc
index a93b425e8228fbdd44e54899e96e6be53dd8db7e..cad1fcb8d05fa57cb96d800f6d86b86b0a50f6eb 100644
--- a/base/memory/memory_pressure_monitor_win.cc
+++ b/base/memory/memory_pressure_monitor_win.cc
@@ -6,7 +6,6 @@
#include <windows.h>
-#include "base/metrics/histogram_macros.h"
#include "base/single_thread_task_runner.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h"
@@ -18,32 +17,6 @@ namespace {
static const DWORDLONG kMBBytes = 1024 * 1024;
-// Enumeration of UMA memory pressure levels. This needs to be kept in sync with
-// histograms.xml and the memory pressure levels defined in
-// MemoryPressureListener.
-enum MemoryPressureLevelUMA {
- UMA_MEMORY_PRESSURE_LEVEL_NONE = 0,
- UMA_MEMORY_PRESSURE_LEVEL_MODERATE = 1,
- UMA_MEMORY_PRESSURE_LEVEL_CRITICAL = 2,
- // This must be the last value in the enum.
- UMA_MEMORY_PRESSURE_LEVEL_COUNT,
-};
-
-// Converts a memory pressure level to an UMA enumeration value.
-MemoryPressureLevelUMA MemoryPressureLevelToUmaEnumValue(
- MemoryPressureListener::MemoryPressureLevel level) {
- switch (level) {
- case MemoryPressureListener::MEMORY_PRESSURE_LEVEL_NONE:
- return UMA_MEMORY_PRESSURE_LEVEL_NONE;
- case MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE:
- return UMA_MEMORY_PRESSURE_LEVEL_MODERATE;
- case MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL:
- return UMA_MEMORY_PRESSURE_LEVEL_CRITICAL;
- }
- NOTREACHED();
- return UMA_MEMORY_PRESSURE_LEVEL_NONE;
-}
-
} // namespace
// The following constants have been lifted from similar values in the ChromeOS
@@ -210,10 +183,7 @@ void MemoryPressureMonitor::CheckMemoryPressureAndRecordStatistics() {
CheckMemoryPressure();
- UMA_HISTOGRAM_ENUMERATION(
- "Memory.PressureLevel",
- MemoryPressureLevelToUmaEnumValue(current_memory_pressure_level_),
- UMA_MEMORY_PRESSURE_LEVEL_COUNT);
+ RecordMemoryPressure(current_memory_pressure_level_, 1);
}
MemoryPressureListener::MemoryPressureLevel
« no previous file with comments | « base/memory/memory_pressure_monitor_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698