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

Unified Diff: content/browser/memory/memory_coordinator_impl.cc

Issue 2832753002: memory_coordinator: Use TimeTicks to suppress memory condition update (Closed)
Patch Set: Remove unused const Created 3 years, 8 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/browser/memory/memory_coordinator_impl.h ('k') | content/browser/memory/memory_monitor_android.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/memory/memory_coordinator_impl.cc
diff --git a/content/browser/memory/memory_coordinator_impl.cc b/content/browser/memory/memory_coordinator_impl.cc
index ffd91b6657b791441f73bbe22efe61f4837c7aae..8dbfa01f4082f02aa5b511444b47def7f818335f 100644
--- a/content/browser/memory/memory_coordinator_impl.cc
+++ b/content/browser/memory/memory_coordinator_impl.cc
@@ -261,7 +261,7 @@ MemoryState MemoryCoordinatorImpl::GetCurrentMemoryState() const {
void MemoryCoordinatorImpl::ForceSetMemoryCondition(MemoryCondition condition,
base::TimeDelta duration) {
UpdateConditionIfNeeded(condition);
- condition_observer_->ScheduleUpdateCondition(duration);
+ suppress_condition_change_until_ = tick_clock_->NowTicks() + duration;
}
void MemoryCoordinatorImpl::Observe(int type,
@@ -304,6 +304,9 @@ void MemoryCoordinatorImpl::UpdateConditionIfNeeded(
if (memory_condition_ == next_condition)
return;
+ if (suppress_condition_change_until_ > tick_clock_->NowTicks())
+ return;
+
MemoryCondition prev_condition = memory_condition_;
memory_condition_ = next_condition;
« no previous file with comments | « content/browser/memory/memory_coordinator_impl.h ('k') | content/browser/memory/memory_monitor_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698