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

Unified Diff: base/memory/discardable_memory_mac.cc

Issue 336273003: base: Add soft memory limit to DiscardableMemoryManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mac build Created 6 years, 5 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
« no previous file with comments | « base/memory/discardable_memory_linux.cc ('k') | base/memory/discardable_memory_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_mac.cc
diff --git a/base/memory/discardable_memory_mac.cc b/base/memory/discardable_memory_mac.cc
index b2982fc5d236a8b0aadb91b909d8e2c54160cb64..b2184e7d589c415f5cd98f09b0e77786d42333a2 100644
--- a/base/memory/discardable_memory_mac.cc
+++ b/base/memory/discardable_memory_mac.cc
@@ -25,7 +25,11 @@ namespace {
const size_t kMacMemoryLimit = 512 * 1024 * 1024;
struct SharedState {
- SharedState() : manager(kMacMemoryLimit, kMacMemoryLimit) {}
+ SharedState()
+ : manager(kMacMemoryLimit,
+ kMacMemoryLimit,
+ kMacMemoryLimit,
+ TimeDelta::Max()) {}
internal::DiscardableMemoryManager manager;
};
@@ -166,6 +170,11 @@ void DiscardableMemory::UnregisterMemoryPressureListeners() {
}
// static
+bool DiscardableMemory::ReduceMemoryUsage() {
+ return internal::DiscardableMemoryEmulated::ReduceMemoryUsage();
+}
+
+// static
void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
« no previous file with comments | « base/memory/discardable_memory_linux.cc ('k') | base/memory/discardable_memory_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698