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

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: 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
« no previous file with comments | « no previous file | no next file » | 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..18adde4f2d58bbae6e4ac0d6e857978b5e573649 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,19 @@
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");
sky 2015/04/03 20:59:09 Can you elaborate on the value of running a field
Georges Khalil 2015/04/03 21:51:33 Discussed offline.
+ // If there is no trial, enable experiment to get coverage on the perf
+ // waterfall.
+ if (trial && trial->group_name() != "Disabled") {
+ SessionRestoreStatsCollector::TrackTabs(tabs, restore_started);
+ TabLoader::RestoreTabs(tabs, restore_started);
+ } else {
+ // If tab loading is disabled, only track active tabs.
+ std::vector<RestoredTab> active_tabs;
+ for (const auto& restored_tab : tabs)
sky 2015/04/03 20:59:09 nit: braces here.
Georges Khalil 2015/04/03 21:51:33 Acknowledged.
+ if (restored_tab.is_active)
+ active_tabs.push_back(restored_tab);
+ SessionRestoreStatsCollector::TrackTabs(active_tabs, restore_started);
+ }
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698