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

Unified Diff: chrome/browser/chromeos/memory/oom_priority_manager.cc

Issue 138913021: Avoid discarding freshly created background tabs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase (last_selected) Created 6 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
Index: chrome/browser/chromeos/memory/oom_priority_manager.cc
diff --git a/chrome/browser/chromeos/memory/oom_priority_manager.cc b/chrome/browser/chromeos/memory/oom_priority_manager.cc
index bb9a61e0d6ad2e2aa14b17ea8bd856953d7c2c87..c5018c20256786573f7973c2761fef2a7db63d4c 100644
--- a/chrome/browser/chromeos/memory/oom_priority_manager.cc
+++ b/chrome/browser/chromeos/memory/oom_priority_manager.cc
@@ -449,8 +449,8 @@ bool OomPriorityManager::CompareTabStats(TabStats first,
// for beforeUnload handlers, which are likely to present a dialog asking
// if the user wants to discard state. crbug.com/123049
- // Being more recently selected is more important.
- return first.last_selected > second.last_selected;
+ // Being more recently active is more important.
+ return first.last_active > second.last_active;
}
void OomPriorityManager::AdjustFocusedTabScoreOnFileThread() {
@@ -578,7 +578,7 @@ OomPriorityManager::TabStatsList OomPriorityManager::GetTabStatsOnUIThread() {
stats.is_pinned = model->IsTabPinned(i);
stats.is_selected = browser_active && model->IsTabSelected(i);
stats.is_discarded = model->IsTabDiscarded(i);
- stats.last_selected = contents->GetLastSelectedTime();
+ stats.last_active = contents->GetLastActiveTime();
stats.renderer_handle = contents->GetRenderProcessHost()->GetHandle();
stats.title = contents->GetTitle();
stats.tab_contents_id = IdFromWebContents(contents);
« no previous file with comments | « chrome/browser/chromeos/memory/oom_priority_manager.h ('k') | chrome/browser/chromeos/memory/oom_priority_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698