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

Unified Diff: base/memory/discardable_memory_manager.cc

Issue 935333002: Update from https://crrev.com/316786 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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_manager.h ('k') | base/memory/discardable_memory_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/discardable_memory_manager.cc
diff --git a/base/memory/discardable_memory_manager.cc b/base/memory/discardable_memory_manager.cc
index 09e63e35f62ef852b04997cd15fde67f433fc6d0..cbbdb4770af04494f48290fb7bfae500e5496b47 100644
--- a/base/memory/discardable_memory_manager.cc
+++ b/base/memory/discardable_memory_manager.cc
@@ -51,34 +51,6 @@ void DiscardableMemoryManager::SetHardMemoryLimitExpirationTime(
hard_memory_limit_expiration_time_ = hard_memory_limit_expiration_time;
}
-void DiscardableMemoryManager::ReleaseFreeMemory() {
- TRACE_EVENT0("base", "DiscardableMemoryManager::ReleaseFreeMemory");
-
- AutoLock lock(lock_);
- size_t bytes_allocated_before_releasing_memory = bytes_allocated_;
- for (auto& entry : allocations_) {
- Allocation* allocation = entry.first;
- AllocationInfo* info = &entry.second;
-
- if (!info->purgable)
- continue;
-
- // Skip if memory is still resident, otherwise purge and adjust
- // |bytes_allocated_|.
- if (allocation->IsMemoryResident())
- continue;
-
- size_t bytes_purgable = info->bytes;
- DCHECK_LE(bytes_purgable, bytes_allocated_);
- bytes_allocated_ -= bytes_purgable;
- info->purgable = false;
- allocation->Purge();
- }
-
- if (bytes_allocated_ != bytes_allocated_before_releasing_memory)
- BytesAllocatedChanged(bytes_allocated_);
-}
-
bool DiscardableMemoryManager::ReduceMemoryUsage() {
return PurgeIfNotUsedSinceHardLimitCutoffUntilWithinSoftMemoryLimit();
}
« no previous file with comments | « base/memory/discardable_memory_manager.h ('k') | base/memory/discardable_memory_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698