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

Unified Diff: base/memory/discardable_memory.h

Issue 391273002: Merge 281795 "base: Add soft memory limit to DiscardableMemoryMa..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: 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 | « no previous file | base/memory/discardable_memory_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory.h
===================================================================
--- base/memory/discardable_memory.h (revision 283285)
+++ base/memory/discardable_memory.h (working copy)
@@ -97,6 +97,16 @@
// Create a DiscardableMemory instance with preferred type and |size|.
static scoped_ptr<DiscardableMemory> CreateLockedMemory(size_t size);
+ // Discardable memory implementations might allow an elevated usage level
+ // while in frequent use. Call this to have the usage reduced to the base
+ // level. 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 reduced usage to the base level or below.
+ // Note: calling this too often or while discardable memory is in frequent
+ // use can hurt performance, whereas calling it too infrequently can result
+ // in memory bloat.
+ static bool ReduceMemoryUsage();
+
// 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698