OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_MEMORY_TAB_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ |
6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ | 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // Record whether an out of memory occured during a recent time interval. This | 126 // Record whether an out of memory occured during a recent time interval. This |
127 // allows the normalization of low memory statistics versus usage. | 127 // allows the normalization of low memory statistics versus usage. |
128 void RecordRecentTabDiscard(); | 128 void RecordRecentTabDiscard(); |
129 | 129 |
130 // Purges data structures in the browser that can be easily recomputed. | 130 // Purges data structures in the browser that can be easily recomputed. |
131 void PurgeBrowserMemory(); | 131 void PurgeBrowserMemory(); |
132 | 132 |
133 // Returns the number of tabs open in all browser instances. | 133 // Returns the number of tabs open in all browser instances. |
134 int GetTabCount() const; | 134 int GetTabCount() const; |
135 | 135 |
136 // Adds all the stats of the tabs in |browser_list| into |stats_list|. If | 136 // Adds all the stats of the tabs to |stats_list|. |
137 // |active_desktop| is true, consider its first window as being active. | 137 void AddTabStats(TabStatsList* stats_list); |
138 void AddTabStats(BrowserList* browser_list, | |
139 bool active_desktop, | |
140 TabStatsList* stats_list); | |
141 | 138 |
142 // Callback for when |update_timer_| fires. Takes care of executing the tasks | 139 // Callback for when |update_timer_| fires. Takes care of executing the tasks |
143 // that need to be run periodically (see comment in implementation). | 140 // that need to be run periodically (see comment in implementation). |
144 void UpdateTimerCallback(); | 141 void UpdateTimerCallback(); |
145 | 142 |
146 // Goes through a list of checks to see if a tab is allowed to be discarded by | 143 // Goes through a list of checks to see if a tab is allowed to be discarded by |
147 // the automatic tab discarding mechanism. Note that this is not used when | 144 // the automatic tab discarding mechanism. Note that this is not used when |
148 // discarding a particular tab from about:discards. | 145 // discarding a particular tab from about:discards. |
149 bool CanDiscardTab(int64_t target_web_contents_id) const; | 146 bool CanDiscardTab(int64_t target_web_contents_id) const; |
150 | 147 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 // Pointer to a test clock. If this is set, NowTicks() returns the value of | 224 // Pointer to a test clock. If this is set, NowTicks() returns the value of |
228 // this test clock. Otherwise it returns the system clock's value. | 225 // this test clock. Otherwise it returns the system clock's value. |
229 base::TickClock* test_tick_clock_; | 226 base::TickClock* test_tick_clock_; |
230 | 227 |
231 DISALLOW_COPY_AND_ASSIGN(TabManager); | 228 DISALLOW_COPY_AND_ASSIGN(TabManager); |
232 }; | 229 }; |
233 | 230 |
234 } // namespace memory | 231 } // namespace memory |
235 | 232 |
236 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ | 233 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ |
OLD | NEW |