Index: base/memory/discardable_memory_emulated.cc |
diff --git a/base/memory/discardable_memory_emulated.cc b/base/memory/discardable_memory_emulated.cc |
index 340a181834ad3dbed5058cd419467f05013bc6f8..f9097b186e1405897f2a85c17f52398f0e90a1ac 100644 |
--- a/base/memory/discardable_memory_emulated.cc |
+++ b/base/memory/discardable_memory_emulated.cc |
@@ -13,14 +13,12 @@ namespace { |
// This is admittedly pretty magical. |
const size_t kEmulatedMemoryLimit = 512 * 1024 * 1024; |
const size_t kEmulatedSoftMemoryLimit = 32 * 1024 * 1024; |
-const size_t kEmulatedBytesToKeepUnderModeratePressure = 4 * 1024 * 1024; |
const size_t kEmulatedHardMemoryLimitExpirationTimeMs = 1000; |
struct SharedState { |
SharedState() |
: manager(kEmulatedMemoryLimit, |
kEmulatedSoftMemoryLimit, |
- kEmulatedBytesToKeepUnderModeratePressure, |
TimeDelta::FromMilliseconds( |
kEmulatedHardMemoryLimitExpirationTimeMs)) {} |
@@ -45,18 +43,14 @@ DiscardableMemoryEmulated::~DiscardableMemoryEmulated() { |
} |
// static |
-void DiscardableMemoryEmulated::RegisterMemoryPressureListeners() { |
- g_shared_state.Pointer()->manager.RegisterMemoryPressureListener(); |
-} |
- |
-// static |
-void DiscardableMemoryEmulated::UnregisterMemoryPressureListeners() { |
- g_shared_state.Pointer()->manager.UnregisterMemoryPressureListener(); |
+bool DiscardableMemoryEmulated::ReduceMemoryUsage() { |
+ return g_shared_state.Pointer()->manager.ReduceMemoryUsage(); |
} |
// static |
-bool DiscardableMemoryEmulated::ReduceMemoryUsage() { |
- return g_shared_state.Pointer()->manager.ReduceMemoryUsage(); |
+void DiscardableMemoryEmulated::ReduceMemoryUsageUntilWithinLimit( |
+ size_t bytes) { |
+ g_shared_state.Pointer()->manager.ReduceMemoryUsageUntilWithinLimit(bytes); |
} |
// static |