| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_SESSION_BACKEND_H_ | 5 #ifndef CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ |
| 6 #define CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ | 6 #define CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 bool inited() const { return inited_; } | 57 bool inited() const { return inited_; } |
| 58 | 58 |
| 59 // Appends the specified commands to the current file. If reset_first is | 59 // Appends the specified commands to the current file. If reset_first is |
| 60 // true the the current file is recreated. | 60 // true the the current file is recreated. |
| 61 void AppendCommands(ScopedVector<SessionCommand> commands, bool reset_first); | 61 void AppendCommands(ScopedVector<SessionCommand> commands, bool reset_first); |
| 62 | 62 |
| 63 // Invoked from the service to read the commands that make up the last | 63 // Invoked from the service to read the commands that make up the last |
| 64 // session, invokes ReadLastSessionCommandsImpl to do the work. | 64 // session, invokes ReadLastSessionCommandsImpl to do the work. |
| 65 void ReadLastSessionCommands( | 65 void ReadLastSessionCommands( |
| 66 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled, | 66 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled, |
| 67 const BaseSessionService::InternalGetCommandsCallback& callback); | 67 const BaseSessionService::GetCommandsCallback& callback); |
| 68 | 68 |
| 69 // Reads the commands from the last file. | 69 // Reads the commands from the last file. |
| 70 // | 70 // |
| 71 // On success, the read commands are added to commands. | 71 // On success, the read commands are added to commands. |
| 72 bool ReadLastSessionCommandsImpl(ScopedVector<SessionCommand>* commands); | 72 bool ReadLastSessionCommandsImpl(ScopedVector<SessionCommand>* commands); |
| 73 | 73 |
| 74 // Deletes the file containing the commands for the last session. | 74 // Deletes the file containing the commands for the last session. |
| 75 void DeleteLastSession(); | 75 void DeleteLastSession(); |
| 76 | 76 |
| 77 // Moves the current session to the last and resets the current. This is | 77 // Moves the current session to the last and resets the current. This is |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 // Main thread, all others on the IO thread, hence lazy initialization. | 127 // Main thread, all others on the IO thread, hence lazy initialization. |
| 128 bool inited_; | 128 bool inited_; |
| 129 | 129 |
| 130 // If true, the file is empty (no commands have been added to it). | 130 // If true, the file is empty (no commands have been added to it). |
| 131 bool empty_file_; | 131 bool empty_file_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(SessionBackend); | 133 DISALLOW_COPY_AND_ASSIGN(SessionBackend); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 #endif // CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ | 136 #endif // CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ |
| OLD | NEW |