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

Unified Diff: base/memory/memory_pressure_monitor_mac.h

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_chromeos.cc ('k') | base/memory/memory_pressure_monitor_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/memory_pressure_monitor_mac.h
diff --git a/base/memory/memory_pressure_monitor_mac.h b/base/memory/memory_pressure_monitor_mac.h
index 89794f67bdd183a948d1ac7b45091b8dc36de07e..9f89b1661a62bfed7898a0f4d825e7f5372b8d40 100644
--- a/base/memory/memory_pressure_monitor_mac.h
+++ b/base/memory/memory_pressure_monitor_mac.h
@@ -5,6 +5,7 @@
#ifndef BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_
#define BASE_MEMORY_MEMORY_PRESSURE_MONITOR_MAC_H_
+#include <CoreFoundation/CFDate.h>
#include <dispatch/dispatch.h>
#include "base/base_export.h"
@@ -35,14 +36,22 @@ class BASE_EXPORT MemoryPressureMonitor : public base::MemoryPressureMonitor {
static MemoryPressureLevel
MemoryPressureLevelForMacMemoryPressure(int mac_memory_pressure);
- static void NotifyMemoryPressureChanged(
- dispatch_source_s* event_source,
- const DispatchCallback& dispatch_callback);
+ void OnMemoryPressureChanged(dispatch_source_s* event_source,
+ const DispatchCallback& dispatch_callback);
ScopedDispatchObject<dispatch_source_t> memory_level_event_source_;
DispatchCallback dispatch_callback_;
+ CFTimeInterval last_pressure_change_;
+
+ MemoryPressureLevel last_pressure_level_;
+
+ // The UMA statistic is recorded in 5 second increments. This
+ // accumulates the remaining time to be rolled into the next
+ // call.
+ CFTimeInterval reporting_error_;
+
DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor);
};
« no previous file with comments | « base/memory/memory_pressure_monitor_chromeos.cc ('k') | base/memory/memory_pressure_monitor_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698