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

Unified Diff: content/common/host_discardable_shared_memory_manager.cc

Issue 2388403002: HostDiscardableSharedMemoryManager should store the default memory limit (Closed)
Patch Set: Created 4 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 | « content/common/host_discardable_shared_memory_manager.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/host_discardable_shared_memory_manager.cc
diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc
index aafd5d6376f80eeacd788307ae51efe6fcaaafdf..e349fca4171c1a32a1daf1ef22f50913e1d7c89f 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -164,7 +164,8 @@ HostDiscardableSharedMemoryManager::MemorySegment::~MemorySegment() {
}
HostDiscardableSharedMemoryManager::HostDiscardableSharedMemoryManager()
- : memory_limit_(GetDefaultMemoryLimit()),
+ : default_memory_limit_(GetDefaultMemoryLimit()),
bashi 2016/10/04 03:13:10 Though GetDefaultMemoryLimit() could be dynamicall
+ memory_limit_(default_memory_limit_),
bytes_allocated_(0),
memory_pressure_listener_(new base::MemoryPressureListener(
base::Bind(&HostDiscardableSharedMemoryManager::OnMemoryPressure,
@@ -352,7 +353,7 @@ void HostDiscardableSharedMemoryManager::OnMemoryStateChange(
base::MemoryState state) {
switch (state) {
case base::MemoryState::NORMAL:
- SetMemoryLimit(GetDefaultMemoryLimit());
+ SetMemoryLimit(default_memory_limit_);
break;
case base::MemoryState::THROTTLED:
SetMemoryLimit(0);
« no previous file with comments | « content/common/host_discardable_shared_memory_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698