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

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

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.cc
diff --git a/chrome/browser/memory/tab_manager_web_contents_data.cc b/chrome/browser/memory/tab_manager_web_contents_data.cc
index 88a7ebb537b25567a3eff2bf8843f41e52f4b507..497788accfca4fc6e848fc7cf875d55d63bb74b4 100644
--- a/chrome/browser/memory/tab_manager_web_contents_data.cc
+++ b/chrome/browser/memory/tab_manager_web_contents_data.cc
@@ -20,7 +20,11 @@ DEFINE_WEB_CONTENTS_USER_DATA_KEY(memory::TabManager::WebContentsData);
namespace memory {
TabManager::WebContentsData::WebContentsData(content::WebContents* web_contents)
- : WebContentsObserver(web_contents), test_tick_clock_(nullptr) {}
+ : WebContentsObserver(web_contents),
+ test_tick_clock_(nullptr),
+ last_purge_and_suspend_modified_time_(
+ base::TimeTicks::FromInternalValue(0)),
+ purge_and_suspend_state_(RUNNING) {}
TabManager::WebContentsData::~WebContentsData() {}
@@ -198,4 +202,20 @@ bool TabManager::WebContentsData::IsAutoDiscardable() {
return tab_data_.is_auto_discardable;
}
+void TabManager::WebContentsData::SetPurgeAndSuspendState(
+ PurgeAndSuspendState state) {
+ last_purge_and_suspend_modified_time_ = TimeTicks::Now();
+ purge_and_suspend_state_ = state;
+}
+
+base::TimeTicks TabManager::WebContentsData::LastPurgeAndSuspendModifiedTime()
+ const {
+ return last_purge_and_suspend_modified_time_;
+}
+
+TabManager::PurgeAndSuspendState
+TabManager::WebContentsData::GetPurgeAndSuspendState() const {
+ return purge_and_suspend_state_;
+}
+
} // namespace memory

Powered by Google App Engine
This is Rietveld 408576698