| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ | 5 #ifndef CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ |
| 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ | 6 #define CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "chrome/browser/memory/tab_manager.h" | 10 #include "chrome/browser/memory/tab_manager.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 // i.e. the last purge-and-suspend modified time. | 83 // i.e. the last purge-and-suspend modified time. |
| 84 // TODO(tasak): remove this after PurgeAndSuspend code is moved into | 84 // TODO(tasak): remove this after PurgeAndSuspend code is moved into |
| 85 // MemoryCoordinator. | 85 // MemoryCoordinator. |
| 86 void SetPurgeAndSuspendState(TabManager::PurgeAndSuspendState state); | 86 void SetPurgeAndSuspendState(TabManager::PurgeAndSuspendState state); |
| 87 | 87 |
| 88 // Returns the last purge-and-suspend modified time. | 88 // Returns the last purge-and-suspend modified time. |
| 89 // TODO(tasak): remove this after PurgeAndSuspend code is moved into | 89 // TODO(tasak): remove this after PurgeAndSuspend code is moved into |
| 90 // MemoryCoordinator. | 90 // MemoryCoordinator. |
| 91 base::TimeTicks LastPurgeAndSuspendModifiedTime() const; | 91 base::TimeTicks LastPurgeAndSuspendModifiedTime() const; |
| 92 | 92 |
| 93 // Sets the timestamp of the last modified time the purge-and-suspend state | |
| 94 // of the tab was changed for testing. | |
| 95 void SetLastPurgeAndSuspendModifiedTimeForTesting(base::TimeTicks timestamp); | |
| 96 | |
| 97 // Returns the current state of purge-and-suspend. | 93 // Returns the current state of purge-and-suspend. |
| 98 // TODO(tasak): remove this after PurgeAndSuspend code is moved into | 94 // TODO(tasak): remove this after PurgeAndSuspend code is moved into |
| 99 // MemoryCoordinator. | 95 // MemoryCoordinator. |
| 100 TabManager::PurgeAndSuspendState GetPurgeAndSuspendState() const; | 96 TabManager::PurgeAndSuspendState GetPurgeAndSuspendState() const; |
| 101 | 97 |
| 102 private: | 98 private: |
| 103 // Needed to access tab_data_. | 99 // Needed to access tab_data_. |
| 104 FRIEND_TEST_ALL_PREFIXES(TabManagerWebContentsDataTest, CopyState); | 100 FRIEND_TEST_ALL_PREFIXES(TabManagerWebContentsDataTest, CopyState); |
| 105 | 101 |
| 106 struct Data { | 102 struct Data { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 142 |
| 147 // The current state of purge-and-suspend. | 143 // The current state of purge-and-suspend. |
| 148 PurgeAndSuspendState purge_and_suspend_state_; | 144 PurgeAndSuspendState purge_and_suspend_state_; |
| 149 | 145 |
| 150 DISALLOW_COPY_AND_ASSIGN(WebContentsData); | 146 DISALLOW_COPY_AND_ASSIGN(WebContentsData); |
| 151 }; | 147 }; |
| 152 | 148 |
| 153 } // namespace memory | 149 } // namespace memory |
| 154 | 150 |
| 155 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ | 151 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ |
| OLD | NEW |