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

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

Issue 2387603003: Resume a backgrounded renderer that was purged and suspended (Closed)
Patch Set: Added transition: => RUNNING 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
Index: chrome/browser/memory/tab_manager_web_contents_data.h
diff --git a/chrome/browser/memory/tab_manager_web_contents_data.h b/chrome/browser/memory/tab_manager_web_contents_data.h
index c24598293100339d45cac1997233491d94c38255..fdbf094f5d6484b42acebc6937484e856a06a132 100644
--- a/chrome/browser/memory/tab_manager_web_contents_data.h
+++ b/chrome/browser/memory/tab_manager_web_contents_data.h
@@ -79,6 +79,22 @@ class TabManager::WebContentsData
// Sets/clears the auto-discardable state of the tab.
void SetAutoDiscardableState(bool state);
+ // Sets the current purge-and-suspend state, and update the timestamp,
+ // i.e. the last purge-and-suspend modified time.
+ // TODO(tasak): remove this after PurgeAndSuspend code is moved into
+ // MemoryCoordinator.
+ void SetPurgeAndSuspendState(TabManager::PurgeAndSuspendState state);
+
+ // Returns the last purge-and-suspend modified time.
+ // TODO(tasak): remove this after PurgeAndSuspend code is moved into
+ // MemoryCoordinator.
+ base::TimeTicks LastPurgeAndSuspendModifiedTime() const;
+
+ // Returns the current state of purge-and-suspend.
+ // TODO(tasak): remove this after PurgeAndSuspend code is moved into
+ // MemoryCoordinator.
+ TabManager::PurgeAndSuspendState GetPurgeAndSuspendState() const;
+
private:
// Needed to access tab_data_.
FRIEND_TEST_ALL_PREFIXES(TabManagerWebContentsDataTest, CopyState);
@@ -121,6 +137,12 @@ class TabManager::WebContentsData
// this test clock. Otherwise it returns the system clock's value.
base::TickClock* test_tick_clock_;
+ // The last time purge-and-suspend state was modified.
+ base::TimeTicks last_purge_and_suspend_modified_time_;
+
+ // The current state of purge-and-suspend.
+ PurgeAndSuspendState purge_and_suspend_state_;
+
DISALLOW_COPY_AND_ASSIGN(WebContentsData);
};

Powered by Google App Engine
This is Rietveld 408576698