Chromium Code Reviews| 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 <memory> | 10 #include <memory> |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 236 // for more details. | 236 // for more details. |
| 237 base::TimeTicks NowTicks() const; | 237 base::TimeTicks NowTicks() const; |
| 238 | 238 |
| 239 // Dispatches a memory pressure message to a single child process, and | 239 // Dispatches a memory pressure message to a single child process, and |
| 240 // schedules another call to itself as long as memory pressure continues. | 240 // schedules another call to itself as long as memory pressure continues. |
| 241 void DoChildProcessDispatch(); | 241 void DoChildProcessDispatch(); |
| 242 | 242 |
| 243 // Implementation of DiscardTab. | 243 // Implementation of DiscardTab. |
| 244 bool DiscardTabImpl(); | 244 bool DiscardTabImpl(); |
| 245 | 245 |
| 246 // Returns true if tabs can be discarded only once. | |
| 247 bool ShouldOnlyDiscardOnce(); | |
|
Georges Khalil
2016/05/17 15:18:01
nit: Finally, I think CanOnlyDiscardOnce makes mor
Anderson Silva
2016/05/17 15:34:07
Acknowledged.
| |
| 248 | |
| 246 // Timer to periodically update the stats of the renderers. | 249 // Timer to periodically update the stats of the renderers. |
| 247 base::RepeatingTimer update_timer_; | 250 base::RepeatingTimer update_timer_; |
| 248 | 251 |
| 249 // Timer to periodically report whether a tab has been discarded since the | 252 // Timer to periodically report whether a tab has been discarded since the |
| 250 // last time the timer has fired. | 253 // last time the timer has fired. |
| 251 base::RepeatingTimer recent_tab_discard_timer_; | 254 base::RepeatingTimer recent_tab_discard_timer_; |
| 252 | 255 |
| 253 // A listener to global memory pressure events. | 256 // A listener to global memory pressure events. |
| 254 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; | 257 std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_; |
| 255 | 258 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 | 329 |
| 327 // Weak pointer factory used for posting delayed tasks to task_runner_. | 330 // Weak pointer factory used for posting delayed tasks to task_runner_. |
| 328 base::WeakPtrFactory<TabManager> weak_ptr_factory_; | 331 base::WeakPtrFactory<TabManager> weak_ptr_factory_; |
| 329 | 332 |
| 330 DISALLOW_COPY_AND_ASSIGN(TabManager); | 333 DISALLOW_COPY_AND_ASSIGN(TabManager); |
| 331 }; | 334 }; |
| 332 | 335 |
| 333 } // namespace memory | 336 } // namespace memory |
| 334 | 337 |
| 335 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ | 338 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ |
| OLD | NEW |