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

Unified Diff: base/memory/discardable_memory.h

Issue 336273003: base: Add soft memory limit to DiscardableMemoryManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: v2 Created 6 years, 6 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 | « no previous file | base/memory/discardable_memory_android.cc » ('j') | base/memory/discardable_memory_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory.h
diff --git a/base/memory/discardable_memory.h b/base/memory/discardable_memory.h
index 9189b5eb027901a0e6e22d87853cd928b0c9fb4b..85a067f2f944774efa40527f853e85cfc8b25554 100644
--- a/base/memory/discardable_memory.h
+++ b/base/memory/discardable_memory.h
@@ -97,6 +97,13 @@ class BASE_EXPORT DiscardableMemory {
// Create a DiscardableMemory instance with preferred type and |size|.
static scoped_ptr<DiscardableMemory> CreateLockedMemory(size_t size);
+ // Call this when idle. Discardable memory implementations might use this
+ // to reduce memory footprint. Returns true if there's no need to call this
+ // again until memory instances have been used. This indicates that all
+ // discardable memory implementations have done as much cleanup as they
+ // will be able to do.
+ static bool IdleNotification();
+
// Locks the memory so that it will not be purged by the system. Returns
// DISCARDABLE_MEMORY_LOCK_STATUS_SUCCESS on success. If the return value is
// DISCARDABLE_MEMORY_LOCK_STATUS_FAILED then this object should be
« no previous file with comments | « no previous file | base/memory/discardable_memory_android.cc » ('j') | base/memory/discardable_memory_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698