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

Side by Side 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, 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/sessions/session_restore_delegate.h" 5 #include "chrome/browser/sessions/session_restore_delegate.h"
6 6
7 #include "base/metrics/field_trial.h"
7 #include "chrome/browser/sessions/session_restore_stats_collector.h" 8 #include "chrome/browser/sessions/session_restore_stats_collector.h"
8 #include "chrome/browser/sessions/tab_loader.h" 9 #include "chrome/browser/sessions/tab_loader.h"
9 10
10 // static 11 // static
11 void SessionRestoreDelegate::RestoreTabs( 12 void SessionRestoreDelegate::RestoreTabs(
12 const std::vector<RestoredTab>& tabs, 13 const std::vector<RestoredTab>& tabs,
13 const base::TimeTicks& restore_started) { 14 const base::TimeTicks& restore_started) {
14 SessionRestoreStatsCollector::TrackTabs(tabs, restore_started); 15 base::FieldTrial* trial =
15 TabLoader::RestoreTabs(tabs, restore_started); 16 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.
17 // If there is no trial, enable experiment to get coverage on the perf
18 // waterfall.
19 if (trial && trial->group_name() != "Disabled") {
20 SessionRestoreStatsCollector::TrackTabs(tabs, restore_started);
21 TabLoader::RestoreTabs(tabs, restore_started);
22 } else {
23 // If tab loading is disabled, only track active tabs.
24 std::vector<RestoredTab> active_tabs;
25 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.
26 if (restored_tab.is_active)
27 active_tabs.push_back(restored_tab);
28 SessionRestoreStatsCollector::TrackTabs(active_tabs, restore_started);
29 }
16 } 30 }
OLDNEW
« 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