| 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
|
|
|