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

Unified Diff: chrome/browser/memory/tab_manager.cc

Issue 2426733004: Bug fix: Use the last hidden time for purge + suspend (Closed)
Patch Set: (rebase) 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 | « no previous file | chrome/browser/memory/tab_stats.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/tab_manager.cc
diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc
index e761e81a7c43a1d31ef1ebd15c33c984e6faa98b..0f71308419f82d42bac643dc02b210dec450fa74 100644
--- a/chrome/browser/memory/tab_manager.cc
+++ b/chrome/browser/memory/tab_manager.cc
@@ -639,6 +639,7 @@ void TabManager::AddTabStats(const TabStripModel* model,
contents->GetPageImportanceSignals().had_form_interaction;
stats.discard_count = GetWebContentsData(contents)->DiscardCount();
stats.last_active = contents->GetLastActiveTime();
+ stats.last_hidden = contents->GetLastHiddenTime();
stats.render_process_host = contents->GetRenderProcessHost();
stats.renderer_handle = contents->GetRenderProcessHost()->GetHandle();
stats.child_process_host_id = contents->GetRenderProcessHost()->GetID();
@@ -710,7 +711,7 @@ void TabManager::PurgeAndSuspendBackgroundedTabs() {
// timers for simplicity, so PurgeAndSuspend is called even after the
// renderer is purged and suspended once. This should be replaced with
// timers if we want necessary and sufficient signals.
- if (tab.last_active > purge_and_suspend_time_threshold)
+ if (tab.last_hidden > purge_and_suspend_time_threshold)
continue;
if (!CanSuspendBackgroundedRenderer(tab.child_process_host_id))
continue;
« no previous file with comments | « no previous file | chrome/browser/memory/tab_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698