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..dbea6fdf7ee7d7f6dae3212abb79df426aaadd75 100644 |
--- a/chrome/browser/memory/tab_manager.h |
+++ b/chrome/browser/memory/tab_manager.h |
@@ -50,10 +50,6 @@ class TabManagerDelegate; |
// support for new platforms is added. |
class TabManager : public TabStripModelObserver { |
public: |
- // TODO(georgesak): Make this private once all external dependencies are |
- // removed. |
- class WebContentsData; |
- |
TabManager(); |
~TabManager() override; |
@@ -72,6 +68,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. |
@@ -98,6 +97,8 @@ class TabManager : public TabStripModelObserver { |
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ReloadDiscardedTabContextMenu); |
FRIEND_TEST_ALL_PREFIXES(TabManagerTest, TabManagerBasics); |
+ class WebContentsData; |
+ |
static void PurgeMemoryAndDiscardTab(); |
// Returns true if the |url| represents an internal Chrome web UI page that |
@@ -144,14 +145,25 @@ class TabManager : public TabStripModelObserver { |
base::MemoryPressureListener::MemoryPressureLevel memory_pressure_level); |
// TabStripModelObserver overrides. |
+ void TabInsertedAt(content::WebContents* contents, |
+ int index, |
+ bool foreground) override; |
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); |