Chromium Code Reviews| Index: chrome/browser/memory/tab_manager.h |
| diff --git a/chrome/browser/memory/tab_manager.h b/chrome/browser/memory/tab_manager.h |
| index cd5c3480417bf76976c8a3849ae4d0e5fe6c5057..ac138320fdfc325b3bcc58ab8c1bd6cc853d55c1 100644 |
| --- a/chrome/browser/memory/tab_manager.h |
| +++ b/chrome/browser/memory/tab_manager.h |
| @@ -128,6 +128,12 @@ class TabManager : public TabStripModelObserver { |
| void AddObserver(TabManagerObserver* observer); |
| void RemoveObserver(TabManagerObserver* observer); |
| + // Sets/clears the discardable state of the tab. |
| + void SetDiscardableState(content::WebContents* contents, bool state); |
|
Georges Khalil
2016/07/21 21:21:41
nit: SetTabDiscardableState (for consistency).
Anderson Silva
2016/07/21 22:16:45
Done.
|
| + |
| + // Returns true if the tab is discardable by auto discarding feature. |
| + bool IsDiscardable(content::WebContents* contents); |
|
Georges Khalil
2016/07/21 21:21:41
ditto. Also, this can be const and put it before t
Anderson Silva
2016/07/21 22:16:45
Done.
|
| + |
| private: |
| FRIEND_TEST_ALL_PREFIXES(TabManagerTest, CanOnlyDiscardOnce); |
| FRIEND_TEST_ALL_PREFIXES(TabManagerTest, ChildProcessNotifications); |
| @@ -151,6 +157,11 @@ class TabManager : public TabStripModelObserver { |
| void OnDiscardedStateChange(content::WebContents* contents, |
| bool is_discarded); |
| + // Called by WebContentsData whenever the discardable state of a WebContents |
| + // changes, so that observers can be informed. |
| + void OnDiscardableStateChange(content::WebContents* contents, |
| + bool is_discardable); |
| + |
| // The time that a renderer is given to react to a memory pressure |
| // notification before another renderer is also notified. This prevents all |
| // renderers from receiving and acting upon notifications simultaneously, |