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 #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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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 a timer to load load the next tab once expired before the current |
| 72 // tab loading is finished. | 72 // tab loading is finished. The first timer is used only once when loading the |
| 73 // first batch of visible tabs. | |
| 74 void StartFirstTimer(); | |
|
gab
2015/05/15 18:21:03
I think it's more readable if we separate these tw
Nico
2015/05/15 18:36:32
+1
chrisha
2015/05/15 18:47:12
Done.
| |
| 73 void StartTimer(); | 75 void StartTimer(); |
| 74 | 76 |
| 75 // Removes the listeners from the specified tab and removes the tab from | 77 // 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 | 78 // the set of tabs to load and list of tabs we're waiting to get a load |
| 77 // from. | 79 // from. |
| 78 void RemoveTab(content::NavigationController* controller); | 80 void RemoveTab(content::NavigationController* controller); |
| 79 | 81 |
| 80 // Invoked from |force_load_timer_|. Doubles |force_load_delay_multiplier_| | 82 // Invoked from |force_load_timer_|. Doubles |force_load_delay_multiplier_| |
| 81 // and invokes |LoadNextTab| to load the next tab | 83 // and invokes |LoadNextTab| to load the next tab |
| 82 void ForceLoadTimerFired(); | 84 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 | 127 // For keeping TabLoader alive while it's loading even if no |
| 126 // SessionRestoreImpls reference it. | 128 // SessionRestoreImpls reference it. |
| 127 scoped_refptr<TabLoader> this_retainer_; | 129 scoped_refptr<TabLoader> this_retainer_; |
| 128 | 130 |
| 129 static TabLoader* shared_tab_loader_; | 131 static TabLoader* shared_tab_loader_; |
| 130 | 132 |
| 131 DISALLOW_COPY_AND_ASSIGN(TabLoader); | 133 DISALLOW_COPY_AND_ASSIGN(TabLoader); |
| 132 }; | 134 }; |
| 133 | 135 |
| 134 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ | 136 #endif // CHROME_BROWSER_SESSIONS_TAB_LOADER_H_ |
| OLD | NEW |