Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 } |
| OLD | NEW |