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

Unified Diff: chrome/browser/sessions/session_restore_delegate.cc

Issue 1059343002: Add experiment to disable loading of background tabs during session restore. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add comment about |active_tabs|. Created 5 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 | « no previous file | chrome/browser/sessions/session_restore_stats_collector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sessions/session_restore_delegate.cc
diff --git a/chrome/browser/sessions/session_restore_delegate.cc b/chrome/browser/sessions/session_restore_delegate.cc
index a24167ae1f24bfbbbee5a6f895ec54570c6097ca..e1b8d823040f72235ac821546ff4aaba548c07e6 100644
--- a/chrome/browser/sessions/session_restore_delegate.cc
+++ b/chrome/browser/sessions/session_restore_delegate.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/sessions/session_restore_delegate.h"
+#include "base/metrics/field_trial.h"
#include "chrome/browser/sessions/session_restore_stats_collector.h"
#include "chrome/browser/sessions/tab_loader.h"
@@ -11,6 +12,14 @@
void SessionRestoreDelegate::RestoreTabs(
const std::vector<RestoredTab>& tabs,
const base::TimeTicks& restore_started) {
- SessionRestoreStatsCollector::TrackTabs(tabs, restore_started);
- TabLoader::RestoreTabs(tabs, restore_started);
+ // TODO(georgesak): make tests aware of that behavior so that they succeed if
+ // tab loading is disabled.
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find("SessionRestoreBackgroundLoading");
+ bool active_only = true;
+ if (!trial || trial->group_name() != "Disabled") {
+ TabLoader::RestoreTabs(tabs, restore_started);
+ active_only = false;
+ }
+ SessionRestoreStatsCollector::TrackTabs(tabs, restore_started, active_only);
}
« no previous file with comments | « no previous file | chrome/browser/sessions/session_restore_stats_collector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698