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

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

Issue 2462513002: Add Resume logic of Purge+Suspend to TabManager. (Closed)
Patch Set: Fixed Created 4 years, 1 month 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/tab_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/memory/tab_manager.h
diff --git a/chrome/browser/memory/tab_manager.h b/chrome/browser/memory/tab_manager.h
index 1196c08dcdf5d62b2ae05634b0ef3f88caa58292..e4d7fee434a3d3333cecdd2cf5172aea2bcec0b0 100644
--- a/chrome/browser/memory/tab_manager.h
+++ b/chrome/browser/memory/tab_manager.h
@@ -159,6 +159,9 @@ class TabManager : public TabStripModelObserver {
static int64_t IdFromWebContents(content::WebContents* web_contents);
private:
+ FRIEND_TEST_ALL_PREFIXES(TabManagerTest,
+ ActivateTabResetPurgeAndSuspendState);
+ FRIEND_TEST_ALL_PREFIXES(TabManagerTest, NextPurgeAndSuspendState);
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, AutoDiscardable);
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce);
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications);
@@ -270,6 +273,14 @@ class TabManager : public TabStripModelObserver {
RESUMED,
SUSPENDED,
};
+ // Returns WebContents whose contents id matches the given tab_contents_id.
+ content::WebContents* GetWebContentsById(int64_t tab_contents_id);
+
+ // Returns the next state of the purge and suspend.
+ PurgeAndSuspendState GetNextPurgeAndSuspendState(
+ content::WebContents* content,
+ base::TimeTicks current_time,
+ const base::TimeDelta& time_to_first_suspension) const;
// Purges and suspends renderers in backgrounded tabs.
void PurgeAndSuspendBackgroundedTabs();
« 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