OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ | 5 #ifndef COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ |
6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ | 6 #define COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 const Type type; | 62 const Type type; |
63 | 63 |
64 // The time when the window or tab was closed. | 64 // The time when the window or tab was closed. |
65 base::Time timestamp; | 65 base::Time timestamp; |
66 | 66 |
67 // Is this entry from the last session? This is set to true for entries that | 67 // Is this entry from the last session? This is set to true for entries that |
68 // were closed during the last session, and false for entries that were | 68 // were closed during the last session, and false for entries that were |
69 // closed during this session. | 69 // closed during this session. |
70 bool from_last_session = false; | 70 bool from_last_session = false; |
71 | 71 |
| 72 // Estimates memory usage. By default returns 0. |
| 73 virtual size_t EstimateMemoryUsage() const; |
| 74 |
72 protected: | 75 protected: |
73 explicit Entry(Type type); | 76 explicit Entry(Type type); |
74 | 77 |
75 private: | 78 private: |
76 DISALLOW_COPY_AND_ASSIGN(Entry); | 79 DISALLOW_COPY_AND_ASSIGN(Entry); |
77 }; | 80 }; |
78 | 81 |
79 // Represents a previously open tab. | 82 // Represents a previously open tab. |
80 struct SESSIONS_EXPORT Tab : public Entry { | 83 struct SESSIONS_EXPORT Tab : public Entry { |
81 Tab(); | 84 Tab(); |
82 ~Tab() override; | 85 ~Tab() override; |
83 | 86 |
| 87 size_t EstimateMemoryUsage() const override; |
| 88 |
84 // The navigations. | 89 // The navigations. |
85 std::vector<SerializedNavigationEntry> navigations; | 90 std::vector<SerializedNavigationEntry> navigations; |
86 | 91 |
87 // Index of the selected navigation in navigations. | 92 // Index of the selected navigation in navigations. |
88 int current_navigation_index = -1; | 93 int current_navigation_index = -1; |
89 | 94 |
90 // The ID of the browser to which this tab belonged, so it can be restored | 95 // The ID of the browser to which this tab belonged, so it can be restored |
91 // there. May be 0 (an invalid SessionID) when restoring an entire session. | 96 // there. May be 0 (an invalid SessionID) when restoring an entire session. |
92 SessionID::id_type browser_id = 0; | 97 SessionID::id_type browser_id = 0; |
93 | 98 |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 // A class that is used to associate platform-specific data with | 195 // A class that is used to associate platform-specific data with |
191 // TabRestoreService::Tab. See LiveTab::GetPlatformSpecificTabData(). | 196 // TabRestoreService::Tab. See LiveTab::GetPlatformSpecificTabData(). |
192 class SESSIONS_EXPORT PlatformSpecificTabData { | 197 class SESSIONS_EXPORT PlatformSpecificTabData { |
193 public: | 198 public: |
194 virtual ~PlatformSpecificTabData(); | 199 virtual ~PlatformSpecificTabData(); |
195 }; | 200 }; |
196 | 201 |
197 } // namespace sessions | 202 } // namespace sessions |
198 | 203 |
199 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ | 204 #endif // COMPONENTS_SESSIONS_CORE_TAB_RESTORE_SERVICE_H_ |
OLD | NEW |