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

Unified Diff: base/memory/discardable_memory_manager.cc

Issue 261993003: base: Use DiscardableMemoryManager on MacOSX. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix initial return value of AllocateAndAcquireLock and CHECKs for allocation failure Created 6 years, 7 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 468690b7c9fe9c7ac24f067f19f62237a5358e73..3e90d223a56076f2eeb1c406f117092f16c90e1a 100644
--- a/base/memory/discardable_memory_manager.cc
+++ b/base/memory/discardable_memory_manager.cc
@@ -12,21 +12,15 @@
namespace base {
namespace internal {
-namespace {
-// This is admittedly pretty magical. It's approximately enough memory for eight
-// 2560x1600 images.
-static const size_t kDefaultMemoryLimit = 128 * 1024 * 1024;
-static const size_t kDefaultBytesToKeepUnderModeratePressure = 12 * 1024 * 1024;
-
-} // namespace
-
-DiscardableMemoryManager::DiscardableMemoryManager()
+DiscardableMemoryManager::DiscardableMemoryManager(
+ size_t memory_limit,
+ size_t bytes_to_keep_under_moderate_pressure)
: allocations_(AllocationMap::NO_AUTO_EVICT),
bytes_allocated_(0),
- memory_limit_(kDefaultMemoryLimit),
+ memory_limit_(memory_limit),
bytes_to_keep_under_moderate_pressure_(
- kDefaultBytesToKeepUnderModeratePressure) {
+ bytes_to_keep_under_moderate_pressure) {
BytesAllocatedChanged();
}
« 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