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

Unified Diff: base/memory/discardable_memory_android.cc

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 | « base/memory/discardable_memory.h ('k') | base/memory/discardable_memory_emulated.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_android.cc
diff --git a/base/memory/discardable_memory_android.cc b/base/memory/discardable_memory_android.cc
index c3de3a36b3d9bac3fa8d035dd7eb8fad7891c400..c929a8768434ea973520244182db1535342aa689 100644
--- a/base/memory/discardable_memory_android.cc
+++ b/base/memory/discardable_memory_android.cc
@@ -32,7 +32,10 @@ size_t GetOptimalAshmemRegionSizeForAllocator() {
// Holds the shared state used for allocations.
struct SharedState {
SharedState()
- : manager(kAshmemMemoryLimit, kAshmemMemoryLimit),
+ : manager(kAshmemMemoryLimit,
+ kAshmemMemoryLimit,
+ kAshmemMemoryLimit,
+ TimeDelta::Max()),
allocator(kAshmemAllocatorName,
GetOptimalAshmemRegionSizeForAllocator()) {}
@@ -54,6 +57,11 @@ void DiscardableMemory::UnregisterMemoryPressureListeners() {
}
// static
+bool DiscardableMemory::IdleNotification() {
+ return internal::DiscardableMemoryEmulated::IdleNotification();
Stephen White 2014/06/20 14:06:01 Not new to this patch, but it seems odd to have th
reveman 2014/06/20 18:06:28 It's not really a fallback. IdleNotification will
+}
+
+// static
void DiscardableMemory::GetSupportedTypes(
std::vector<DiscardableMemoryType>* types) {
const DiscardableMemoryType supported_types[] = {
« no previous file with comments | « base/memory/discardable_memory.h ('k') | base/memory/discardable_memory_emulated.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698