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

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

Issue 2389683002: Modify PurgeAndSuspend to see WebContents (Closed)
Patch Set: Add unittest Created 4 years, 2 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/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 e681782791bfda6063401bb0f54e6c55ecca55f1..481aec3726199455d9caee199463a0e0b34b41f8 100644
--- a/chrome/browser/memory/tab_manager.h
+++ b/chrome/browser/memory/tab_manager.h
@@ -156,6 +156,8 @@ class TabManager : public TabStripModelObserver {
static int64_t IdFromWebContents(content::WebContents* web_contents);
private:
+ FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CannotSuspendTabWithMedia);
+ FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanSuspendBasics);
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, AutoDiscardable);
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce);
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications);
@@ -244,6 +246,10 @@ class TabManager : public TabStripModelObserver {
// that need to be run periodically (see comment in implementation).
void UpdateTimerCallback();
+ // Goes through a list of checks to see if a tab is allowed to be purged and
+ // suspended by purge+susend backgrounded tab mechanism.
+ bool CanPurgeAndSuspendBackgroundedTab(int64_t target_web_contents_id) 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