Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: chrome/browser/memory/tab_manager.h

Issue 1914143002: Experimental 'purging and suspending' backgrounded tabs behind the flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address on haraken's review Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/memory/tab_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 // If |active_model| is true, consider its first tab as being active. 188 // If |active_model| is true, consider its first tab as being active.
189 void AddTabStats(const TabStripModel* model, 189 void AddTabStats(const TabStripModel* model,
190 bool is_app, 190 bool is_app,
191 bool active_model, 191 bool active_model,
192 TabStatsList* stats_list); 192 TabStatsList* stats_list);
193 193
194 // Callback for when |update_timer_| fires. Takes care of executing the tasks 194 // Callback for when |update_timer_| fires. Takes care of executing the tasks
195 // that need to be run periodically (see comment in implementation). 195 // that need to be run periodically (see comment in implementation).
196 void UpdateTimerCallback(); 196 void UpdateTimerCallback();
197 197
198 // Purges and suspends renderers in backgrounded tabs.
199 void PurgeAndSuspendBackgroundedTabs();
200
198 // Does the actual discard by destroying the WebContents in |model| at |index| 201 // Does the actual discard by destroying the WebContents in |model| at |index|
199 // and replacing it by an empty one. Returns the new WebContents or NULL if 202 // and replacing it by an empty one. Returns the new WebContents or NULL if
200 // the operation fails (return value used only in testing). 203 // the operation fails (return value used only in testing).
201 content::WebContents* DiscardWebContentsAt(int index, TabStripModel* model); 204 content::WebContents* DiscardWebContentsAt(int index, TabStripModel* model);
202 205
203 // Called by the memory pressure listener when the memory pressure rises. 206 // Called by the memory pressure listener when the memory pressure rises.
204 void OnMemoryPressure( 207 void OnMemoryPressure(
205 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); 208 base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level);
206 209
207 // TabStripModelObserver overrides. 210 // TabStripModelObserver overrides.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 326
324 // Weak pointer factory used for posting delayed tasks to task_runner_. 327 // Weak pointer factory used for posting delayed tasks to task_runner_.
325 base::WeakPtrFactory<TabManager> weak_ptr_factory_; 328 base::WeakPtrFactory<TabManager> weak_ptr_factory_;
326 329
327 DISALLOW_COPY_AND_ASSIGN(TabManager); 330 DISALLOW_COPY_AND_ASSIGN(TabManager);
328 }; 331 };
329 332
330 } // namespace memory 333 } // namespace memory
331 334
332 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_ 335 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/memory/tab_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698