| 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 |
| 93 // Returns the current state of purge-and-suspend. | 97 // Returns the current state of purge-and-suspend. |
| 94 // TODO(tasak): remove this after PurgeAndSuspend code is moved into | 98 // TODO(tasak): remove this after PurgeAndSuspend code is moved into |
| 95 // MemoryCoordinator. | 99 // MemoryCoordinator. |
| 96 TabManager::PurgeAndSuspendState GetPurgeAndSuspendState() const; | 100 TabManager::PurgeAndSuspendState GetPurgeAndSuspendState() const; |
| 97 | 101 |
| 98 private: | 102 private: |
| 99 // Needed to access tab_data_. | 103 // Needed to access tab_data_. |
| 100 FRIEND_TEST_ALL_PREFIXES(TabManagerWebContentsDataTest, CopyState); | 104 FRIEND_TEST_ALL_PREFIXES(TabManagerWebContentsDataTest, CopyState); |
| 101 | 105 |
| 102 struct Data { | 106 struct Data { |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 | 146 |
| 143 // The current state of purge-and-suspend. | 147 // The current state of purge-and-suspend. |
| 144 PurgeAndSuspendState purge_and_suspend_state_; | 148 PurgeAndSuspendState purge_and_suspend_state_; |
| 145 | 149 |
| 146 DISALLOW_COPY_AND_ASSIGN(WebContentsData); | 150 DISALLOW_COPY_AND_ASSIGN(WebContentsData); |
| 147 }; | 151 }; |
| 148 | 152 |
| 149 } // namespace memory | 153 } // namespace memory |
| 150 | 154 |
| 151 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ | 155 #endif // CHROME_BROWSER_MEMORY_TAB_MANAGER_WEB_CONTENTS_DATA_H_ |
| OLD | NEW |