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

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: Fix metrics by keeping right number of tabs restored. Created 5 years, 9 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/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..1c4ce24d8636edd9c74da6a718b30454087e37c7 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);
+ base::FieldTrial* trial =
+ base::FieldTrialList::Find("SessionRestoreBackgroundLoading");
+ // If there is no trial, enable experiment to get coverage on the perf
+ // waterfall.
+ 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);
}

Powered by Google App Engine
This is Rietveld 408576698