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

Unified Diff: base/memory/discardable_memory_manager.h

Issue 681713002: Update from chromium https://crrev.com/301315 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 2 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_mach.cc ('k') | base/memory/discardable_memory_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_manager.h
diff --git a/base/memory/discardable_memory_manager.h b/base/memory/discardable_memory_manager.h
index 43737f82778d942672d1d92f0303a4b802068b06..8bf92891a3ea967d897053f138d09030de808e62 100644
--- a/base/memory/discardable_memory_manager.h
+++ b/base/memory/discardable_memory_manager.h
@@ -31,6 +31,10 @@ class DiscardableMemoryManagerAllocation {
// is acquired on the allocation.
virtual void Purge() = 0;
+ // Check if allocated memory is still resident. It is illegal to call this
+ // while a lock is acquired on the allocation.
+ virtual bool IsMemoryResident() const = 0;
+
protected:
virtual ~DiscardableMemoryManagerAllocation() {}
};
@@ -68,6 +72,9 @@ class BASE_EXPORT_PRIVATE DiscardableMemoryManager {
void SetHardMemoryLimitExpirationTime(
TimeDelta hard_memory_limit_expiration_time);
+ // This will make sure that all purged memory is released to the OS.
+ void ReleaseFreeMemory();
+
// This will attempt to reduce memory footprint until within soft memory
// limit. Returns true if there's no need to call this again until allocations
// have been used.
« no previous file with comments | « base/memory/discardable_memory_mach.cc ('k') | base/memory/discardable_memory_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698