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 <list> | 8 #include <list> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 explicit TabLoader(base::TimeTicks restore_started); | 61 explicit TabLoader(base::TimeTicks restore_started); |
62 ~TabLoader() override; | 62 ~TabLoader() override; |
63 | 63 |
64 // This is invoked once by RestoreTabs to start loading. | 64 // This is invoked once by RestoreTabs to start loading. |
65 void StartLoading(const std::vector<RestoredTab>& tabs); | 65 void StartLoading(const std::vector<RestoredTab>& tabs); |
66 | 66 |
67 // Loads the next tab. If there are no more tabs to load this deletes itself, | 67 // Loads the next tab. If there are no more tabs to load this deletes itself, |
68 // otherwise |force_load_timer_| is restarted. | 68 // otherwise |force_load_timer_| is restarted. |
69 void LoadNextTab(); | 69 void LoadNextTab(); |
70 | 70 |
71 // Starts a timer to load load the next tab once expired before the current | 71 // Starts |force_load_timer_| to load the first non-visible tab if the timer |
72 // tab loading is finished. | 72 // expires before a visible tab has finished loading. This uses the same |
| 73 // timer but a different timeout value than StartTimer. |
| 74 void StartFirstTimer(); |
| 75 |
| 76 // Starts |force_load_timer_| to load the next tab if the timer expires |
| 77 // before the current tab loading is finished. This uses the same timer but a |
| 78 // different timeout value than StartFirstTimer. |
73 void StartTimer(); | 79 void StartTimer(); |
74 | 80 |
75 // Removes the listeners from the specified tab and removes the tab from | 81 // Removes the listeners from the specified tab and removes the tab from |
76 // the set of tabs to load and list of tabs we're waiting to get a load | 82 // the set of tabs to load and list of tabs we're waiting to get a load |
77 // from. | 83 // from. |
78 void RemoveTab(content::NavigationController* controller); | 84 void RemoveTab(content::NavigationController* controller); |
79 | 85 |
80 // Invoked from |force_load_timer_|. Doubles |force_load_delay_multiplier_| | 86 // Invoked from |force_load_timer_|. Doubles |force_load_delay_multiplier_| |
81 // and invokes |LoadNextTab| to load the next tab | 87 // and invokes |LoadNextTab| to load the next tab |
82 void ForceLoadTimerFired(); | 88 void ForceLoadTimerFired(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 // For keeping TabLoader alive while it's loading even if no | 131 // For keeping TabLoader alive while it's loading even if no |
126 // SessionRestoreImpls reference it. | 132 // SessionRestoreImpls reference it. |
127 scoped_refptr<TabLoader> this_retainer_; | 133 scoped_refptr<TabLoader> this_retainer_; |
128 | 134 |
129 static TabLoader* shared_tab_loader_; | 135 static TabLoader* shared_tab_loader_; |
130 | 136 |
131 DISALLOW_COPY_AND_ASSIGN(TabLoader); | 137 DISALLOW_COPY_AND_ASSIGN(TabLoader); |
132 }; | 138 }; |
133 | 139 |
134 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ | 140 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ |
OLD | NEW |