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

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

Issue 2704443006: Make time_to_first_suspension's default 1800sec (Closed)
Patch Set: Fixed style. Created 3 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
« no previous file with comments | « chrome/browser/memory/tab_manager.h ('k') | chrome/browser/memory/tab_manager_unittest.cc » ('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 56aae1cde41797cce72fee5f6f612945155a9911..959ebdcdaefb72159122a6bb1babe1247113d23f 100644
--- a/chrome/browser/memory/tab_manager.cc
+++ b/chrome/browser/memory/tab_manager.cc
@@ -139,6 +139,8 @@ void NotifyRendererProcess(
////////////////////////////////////////////////////////////////////////////////
// TabManager
+constexpr base::TimeDelta TabManager::kDefaultTimeToFirstPurge;
+
TabManager::TabManager()
: discard_count_(0),
recent_tab_discard_(false),
@@ -226,13 +228,13 @@ void TabManager::Start() {
// https://docs.google.com/document/d/1hPHkKtXXBTlsZx9s-9U17XC-ofEIzPo9FYbBEc7PPbk/edit?usp=sharing
std::string purge_and_suspend_time = variations::GetVariationParamValue(
"PurgeAndSuspend", "purge-and-suspend-time");
- unsigned time_to_first_suspension_sec;
+ unsigned int time_to_first_purge_sec = 0;
if (purge_and_suspend_time.empty() ||
- !base::StringToUint(purge_and_suspend_time,
- &time_to_first_suspension_sec))
- time_to_first_suspension_sec = 108000;
- time_to_first_suspension_ =
- base::TimeDelta::FromSeconds(time_to_first_suspension_sec);
+ !base::StringToUint(purge_and_suspend_time, &time_to_first_purge_sec))
+ time_to_first_suspension_ = kDefaultTimeToFirstPurge;
+ else
+ time_to_first_suspension_ =
+ base::TimeDelta::FromSeconds(time_to_first_purge_sec);
}
void TabManager::Stop() {
« no previous file with comments | « chrome/browser/memory/tab_manager.h ('k') | chrome/browser/memory/tab_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698