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

Unified Diff: chrome/browser/memory/oom_priority_manager.h

Issue 1249693002: Improve the about/discards UI, allowing each tab to be individually closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolve comments on #6 Created 5 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/memory/oom_priority_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/oom_priority_manager.h
diff --git a/chrome/browser/memory/oom_priority_manager.h b/chrome/browser/memory/oom_priority_manager.h
index ec59b32ac834f307ad016252b7a9a2784d1d947d..5401e61571fdfbdbd7f04fc51f8a2ea55ca64372 100644
--- a/chrome/browser/memory/oom_priority_manager.h
+++ b/chrome/browser/memory/oom_priority_manager.h
@@ -56,15 +56,20 @@ class OomPriorityManager {
void Start();
void Stop();
- // Returns list of tab titles sorted from most interesting (don't kill)
- // to least interesting (OK to kill).
- std::vector<base::string16> GetTabTitles();
+ // Returns the list of the stats for all renderers. Must be called on the UI
+ // thread.
+ TabStatsList GetTabStats();
- // Discards a tab to free the memory occupied by its renderer.
- // Tab still exists in the tab-strip; clicking on it will reload it.
- // Returns true if it successfully found a tab and discarded it.
+ // Discards a tab to free the memory occupied by its renderer. The tab still
+ // exists in the tab-strip; clicking on it will reload it. Returns true if it
+ // successfully found a tab and discarded it.
bool DiscardTab();
+ // Discards a tab with the given unique ID. The tab still exists in the
+ // tab-strip; clicking on it will reload it. Returns true if it successfully
+ // found a tab and discarded it.
+ bool DiscardTabById(int64 target_web_contents_id);
+
// Log memory statistics for the running processes, then discards a tab.
// Tab discard happens sometime later, as collecting the statistics touches
// multiple threads and takes time.
@@ -83,9 +88,6 @@ class OomPriorityManager {
// can be easily reloaded and hence makes a good choice to discard.
static bool IsInternalPage(const GURL& url);
- // Discards a tab with the given unique ID. Returns true if discard occurred.
- bool DiscardTabById(int64 target_web_contents_id);
-
// Records UMA histogram statistics for a tab discard. We record statistics
// for user triggered discards via chrome://discards/ because that allows us
// to manually test the system.
@@ -101,9 +103,6 @@ class OomPriorityManager {
// Returns the number of tabs open in all browser instances.
int GetTabCount() const;
- // Returns the list of the stats for all renderers.
- TabStatsList GetTabStatsOnUIThread();
-
// Adds all the stats of the tabs in |browser_list| into |stats_list|. If
// |active_desktop| is true, we consider its first window as being active.
void AddTabStats(BrowserList* browser_list,
« no previous file with comments | « no previous file | chrome/browser/memory/oom_priority_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698