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 #ifndef CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ |
6 #define CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ | 6 #define CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <list> | 10 #include <list> |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 void SetTabLoadingEnabled(bool enable_tab_loading) override; | 58 void SetTabLoadingEnabled(bool enable_tab_loading) override; |
59 | 59 |
60 // Called to start restoring tabs. | 60 // Called to start restoring tabs. |
61 static void RestoreTabs(const std::vector<RestoredTab>& tabs, | 61 static void RestoreTabs(const std::vector<RestoredTab>& tabs, |
62 const base::TimeTicks& restore_started); | 62 const base::TimeTicks& restore_started); |
63 | 63 |
64 private: | 64 private: |
65 FRIEND_TEST_ALL_PREFIXES(TabLoaderTest, OnMemoryStateChange); | 65 FRIEND_TEST_ALL_PREFIXES(TabLoaderTest, OnMemoryStateChange); |
66 FRIEND_TEST_ALL_PREFIXES(TabRestoreTest, | 66 FRIEND_TEST_ALL_PREFIXES(TabRestoreTest, |
67 TabsFromRestoredWindowsAreLoadedGradually); | 67 TabsFromRestoredWindowsAreLoadedGradually); |
| 68 FRIEND_TEST_ALL_PREFIXES(SessionRestorePageLoadMetricsBrowserTest, |
| 69 LoadingInForegroundTabInSessionRestore); |
| 70 FRIEND_TEST_ALL_PREFIXES(SessionRestorePageLoadMetricsBrowserTest, |
| 71 ReopenClosedTabInSessionRestore); |
68 | 72 |
69 friend class base::RefCounted<TabLoader>; | 73 friend class base::RefCounted<TabLoader>; |
70 | 74 |
71 using TabsLoading = std::set<content::NavigationController*>; | 75 using TabsLoading = std::set<content::NavigationController*>; |
72 using TabsToLoad = std::list<content::NavigationController*>; | 76 using TabsToLoad = std::list<content::NavigationController*>; |
73 | 77 |
74 explicit TabLoader(base::TimeTicks restore_started); | 78 explicit TabLoader(base::TimeTicks restore_started); |
75 ~TabLoader() override; | 79 ~TabLoader() override; |
76 | 80 |
77 // This is invoked once by RestoreTabs to start loading. | 81 // This is invoked once by RestoreTabs to start loading. |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 // explicitly referenced so that it can be notified of deferred tab loads due | 172 // explicitly referenced so that it can be notified of deferred tab loads due |
169 // to memory pressure. | 173 // to memory pressure. |
170 scoped_refptr<SessionRestoreStatsCollector> stats_collector_; | 174 scoped_refptr<SessionRestoreStatsCollector> stats_collector_; |
171 | 175 |
172 static TabLoader* shared_tab_loader_; | 176 static TabLoader* shared_tab_loader_; |
173 | 177 |
174 DISALLOW_COPY_AND_ASSIGN(TabLoader); | 178 DISALLOW_COPY_AND_ASSIGN(TabLoader); |
175 }; | 179 }; |
176 | 180 |
177 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ | 181 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ |
OLD | NEW |