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

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

Issue 2373653002: [TabManager] Enable tab discarding by default. (Closed)
Patch Set: . Created 4 years, 3 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_manager_browsertest.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 fc69c65b67e0231bf2ec7350f2eeaa7bb457849f..c5362cd4d949762d9c815202c3b0250bb4b9c75d 100644
--- a/chrome/browser/memory/tab_manager.cc
+++ b/chrome/browser/memory/tab_manager.cc
@@ -135,6 +135,7 @@ TabManager::TabManager()
: discard_count_(0),
recent_tab_discard_(false),
discard_once_(false),
+ minimum_protection_time_(base::TimeDelta::FromMinutes(10)),
browser_tab_strip_tracker_(this, nullptr, nullptr),
test_tick_clock_(nullptr),
under_memory_pressure_(false),
@@ -157,12 +158,15 @@ TabManager::~TabManager() {
void TabManager::Start() {
#if defined(OS_WIN) || defined(OS_MACOSX)
- // If the feature is not enabled, do nothing.
+ // Note that discarding is now enabled by default. This check is kept as a
+ // kill switch.
+ // TODO(georgesak): remote this when deemed not needed anymore.
if (!base::FeatureList::IsEnabled(features::kAutomaticTabDiscarding))
return;
// Check the variation parameter to see if a tab is to be protected for an
- // amount of time after being backgrounded. The value is in seconds.
+ // amount of time after being backgrounded. The value is in seconds. Default
+ // is 10 minutes if the variation is absent.
std::string minimum_protection_time_string =
variations::GetVariationParamValue(features::kAutomaticTabDiscarding.name,
"MinimumProtectionTime");
« no previous file with comments | « no previous file | chrome/browser/memory/tab_manager_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698