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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 const std::vector<SessionCommand*>& commands); | 114 const std::vector<SessionCommand*>& commands); |
115 | 115 |
116 const BaseSessionService::SessionType type_; | 116 const BaseSessionService::SessionType type_; |
117 | 117 |
118 // Returns the path to the last file. | 118 // Returns the path to the last file. |
119 FilePath GetLastSessionPath(); | 119 FilePath GetLastSessionPath(); |
120 | 120 |
121 // Returns the path to the current file. | 121 // Returns the path to the current file. |
122 FilePath GetCurrentSessionPath(); | 122 FilePath GetCurrentSessionPath(); |
123 | 123 |
| 124 // Writes data about session restore file cycling into preferences. |
| 125 void WriteDebugData(); |
| 126 |
124 // Directory files are relative to. | 127 // Directory files are relative to. |
125 const FilePath path_to_dir_; | 128 const FilePath path_to_dir_; |
126 | 129 |
127 // Whether the previous target file is valid. | 130 // Whether the previous target file is valid. |
128 bool last_session_valid_; | 131 bool last_session_valid_; |
129 | 132 |
130 // Handle to the target file. | 133 // Handle to the target file. |
131 scoped_ptr<net::FileStream> current_session_file_; | 134 scoped_ptr<net::FileStream> current_session_file_; |
132 | 135 |
133 // Whether we've inited. Remember, the constructor is run on the | 136 // Whether we've inited. Remember, the constructor is run on the |
134 // Main thread, all others on the IO thread, hence lazy initialization. | 137 // Main thread, all others on the IO thread, hence lazy initialization. |
135 bool inited_; | 138 bool inited_; |
136 | 139 |
137 // If true, the file is empty (no commands have been added to it). | 140 // If true, the file is empty (no commands have been added to it). |
138 bool empty_file_; | 141 bool empty_file_; |
139 | 142 |
140 DISALLOW_COPY_AND_ASSIGN(SessionBackend); | 143 DISALLOW_COPY_AND_ASSIGN(SessionBackend); |
141 }; | 144 }; |
142 | 145 |
143 #endif // CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ | 146 #endif // CHROME_BROWSER_SESSIONS_SESSION_BACKEND_H_ |
OLD | NEW |