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

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

Issue 1427613002: [TabManager] Move remaining discard logic from TabStripModel to TabManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: chrisha@ comments. Created 5 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 e4984ad7dacc6e191b4198480f449dd23123851a..951319af93243a0755cc52c542101c2562c3c87a 100644
--- a/chrome/browser/memory/tab_manager.h
+++ b/chrome/browser/memory/tab_manager.h
@@ -50,8 +50,7 @@ class TabManagerDelegate;
// support for new platforms is added.
class TabManager : public TabStripModelObserver {
public:
- // TODO(georgesak): Make this private once all external dependencies are
- // removed.
+ // Needs to be public for DEFINE_WEB_CONTENTS_USER_DATA_KEY.
class WebContentsData;
TabManager();
@@ -72,6 +71,9 @@ class TabManager : public TabStripModelObserver {
// thread.
TabStatsList GetTabStats();
+ // Returns true if |contents| is currently discarded.
+ bool IsTabDiscarded(content::WebContents* contents) const;
+
// 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.
@@ -147,11 +149,19 @@ class TabManager : public TabStripModelObserver {
void TabChangedAt(content::WebContents* contents,
int index,
TabChangeType change_type) override;
+ void ActiveTabChanged(content::WebContents* old_contents,
+ content::WebContents* new_contents,
+ int index,
+ int reason) override;
// Returns true if the tab is currently playing audio or has played audio
// recently.
bool IsAudioTab(content::WebContents* contents) const;
+ // Returns the WebContentsData associated with |contents|. Also takes care of
+ // creating one if needed.
+ WebContentsData* GetWebContentsData(content::WebContents* contents) const;
+
// Returns true if |first| is considered less desirable to be killed than
// |second|.
static bool CompareTabStats(TabStats first, TabStats second);
« 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