| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 6 #define CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 SessionID::id_type command_id, | 106 SessionID::id_type command_id, |
| 107 SessionID::id_type tab_id, | 107 SessionID::id_type tab_id, |
| 108 const std::string& user_agent_override); | 108 const std::string& user_agent_override); |
| 109 | 109 |
| 110 // Creates a SessionCommand stores a browser window's app name. | 110 // Creates a SessionCommand stores a browser window's app name. |
| 111 SessionCommand* CreateSetWindowAppNameCommand( | 111 SessionCommand* CreateSetWindowAppNameCommand( |
| 112 SessionID::id_type command_id, | 112 SessionID::id_type command_id, |
| 113 SessionID::id_type window_id, | 113 SessionID::id_type window_id, |
| 114 const std::string& app_name); | 114 const std::string& app_name); |
| 115 | 115 |
| 116 SessionCommand* CreateSetTabSessionSyncIdCommand( |
| 117 SessionID::id_type command_id, |
| 118 SessionID::id_type tab_id, |
| 119 const int64& sync_id); |
| 120 |
| 116 // Converts a SessionCommand previously created by | 121 // Converts a SessionCommand previously created by |
| 117 // CreateUpdateTabNavigationCommand into a | 122 // CreateUpdateTabNavigationCommand into a |
| 118 // sessions::SerializedNavigationEntry. Returns true on success. If | 123 // sessions::SerializedNavigationEntry. Returns true on success. If |
| 119 // successful |tab_id| is set to the id of the restored tab. | 124 // successful |tab_id| is set to the id of the restored tab. |
| 120 bool RestoreUpdateTabNavigationCommand( | 125 bool RestoreUpdateTabNavigationCommand( |
| 121 const SessionCommand& command, | 126 const SessionCommand& command, |
| 122 sessions::SerializedNavigationEntry* navigation, | 127 sessions::SerializedNavigationEntry* navigation, |
| 123 SessionID::id_type* tab_id); | 128 SessionID::id_type* tab_id); |
| 124 | 129 |
| 125 // Extracts a SessionCommand as previously created by | 130 // Extracts a SessionCommand as previously created by |
| (...skipping 11 matching lines...) Expand all Loading... |
| 137 SessionID::id_type* tab_id, | 142 SessionID::id_type* tab_id, |
| 138 std::string* user_agent_override); | 143 std::string* user_agent_override); |
| 139 | 144 |
| 140 // Extracts a SessionCommand as previously created by | 145 // Extracts a SessionCommand as previously created by |
| 141 // CreateSetWindowAppNameCommand into the window id and application name. | 146 // CreateSetWindowAppNameCommand into the window id and application name. |
| 142 bool RestoreSetWindowAppNameCommand( | 147 bool RestoreSetWindowAppNameCommand( |
| 143 const SessionCommand& command, | 148 const SessionCommand& command, |
| 144 SessionID::id_type* window_id, | 149 SessionID::id_type* window_id, |
| 145 std::string* app_name); | 150 std::string* app_name); |
| 146 | 151 |
| 152 bool RestoreSetTabSessionSyncIdCommand(const SessionCommand& command, |
| 153 SessionID::id_type* tab_id, |
| 154 int64* sync_id); |
| 155 |
| 147 // Returns true if the entry at specified |url| should be written to disk. | 156 // Returns true if the entry at specified |url| should be written to disk. |
| 148 bool ShouldTrackEntry(const GURL& url); | 157 bool ShouldTrackEntry(const GURL& url); |
| 149 | 158 |
| 150 // Invokes SessionBackend::ReadLastSessionCommands with callback on the | 159 // Invokes SessionBackend::ReadLastSessionCommands with callback on the |
| 151 // backend thread. | 160 // backend thread. |
| 152 // If testing, SessionBackend::ReadLastSessionCommands is invoked directly. | 161 // If testing, SessionBackend::ReadLastSessionCommands is invoked directly. |
| 153 CancelableTaskTracker::TaskId ScheduleGetLastSessionCommands( | 162 CancelableTaskTracker::TaskId ScheduleGetLastSessionCommands( |
| 154 const InternalGetCommandsCallback& callback, | 163 const InternalGetCommandsCallback& callback, |
| 155 CancelableTaskTracker* tracker); | 164 CancelableTaskTracker* tracker); |
| 156 | 165 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 186 // over the commands. | 195 // over the commands. |
| 187 bool pending_reset_; | 196 bool pending_reset_; |
| 188 | 197 |
| 189 // The number of commands sent to the backend before doing a reset. | 198 // The number of commands sent to the backend before doing a reset. |
| 190 int commands_since_reset_; | 199 int commands_since_reset_; |
| 191 | 200 |
| 192 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 201 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
| 193 }; | 202 }; |
| 194 | 203 |
| 195 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 204 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
| OLD | NEW |