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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 // true the the current file is recreated. | 60 // true the the current file is recreated. |
61 // | 61 // |
62 // NOTE: this deletes SessionCommands in commands as well as the supplied | 62 // NOTE: this deletes SessionCommands in commands as well as the supplied |
63 // vector. | 63 // vector. |
64 void AppendCommands(ScopedVector<SessionCommand>* commands, bool reset_first); | 64 void AppendCommands(ScopedVector<SessionCommand>* commands, bool reset_first); |
65 | 65 |
66 // Invoked from the service to read the commands that make up the last | 66 // Invoked from the service to read the commands that make up the last |
67 // session, invokes ReadLastSessionCommandsImpl to do the work. | 67 // session, invokes ReadLastSessionCommandsImpl to do the work. |
68 void ReadLastSessionCommands( | 68 void ReadLastSessionCommands( |
69 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled, | 69 const base::CancelableTaskTracker::IsCanceledCallback& is_canceled, |
70 const BaseSessionService::InternalGetCommandsCallback& callback); | 70 const BaseSessionService::GetCommandsCallback& callback); |
71 | 71 |
72 // Reads the commands from the last file. | 72 // Reads the commands from the last file. |
73 // | 73 // |
74 // On success, the read commands are added to commands. | 74 // On success, the read commands are added to commands. |
75 bool ReadLastSessionCommandsImpl(ScopedVector<SessionCommand>* commands); | 75 bool ReadLastSessionCommandsImpl(ScopedVector<SessionCommand>* commands); |
76 | 76 |
77 // Deletes the file containing the commands for the last session. | 77 // Deletes the file containing the commands for the last session. |
78 void DeleteLastSession(); | 78 void DeleteLastSession(); |
79 | 79 |
80 // Moves the current session to the last and resets the current. This is | 80 // 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... |
130 // Main thread, all others on the IO thread, hence lazy initialization. | 130 // Main thread, all others on the IO thread, hence lazy initialization. |
131 bool inited_; | 131 bool inited_; |
132 | 132 |
133 // If true, the file is empty (no commands have been added to it). | 133 // If true, the file is empty (no commands have been added to it). |
134 bool empty_file_; | 134 bool empty_file_; |
135 | 135 |
136 DISALLOW_COPY_AND_ASSIGN(SessionBackend); | 136 DISALLOW_COPY_AND_ASSIGN(SessionBackend); |
137 }; | 137 }; |
138 | 138 |
139 #endif // CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ | 139 #endif // CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ |
OLD | NEW |