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/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 const base::Closure& task); | 156 const base::Closure& task); |
157 | 157 |
158 // Returns true if we appear to be running in production, false if we appear | 158 // Returns true if we appear to be running in production, false if we appear |
159 // to be running as part of a unit test or if the FILE thread has gone away. | 159 // to be running as part of a unit test or if the FILE thread has gone away. |
160 bool RunningInProduction() const; | 160 bool RunningInProduction() const; |
161 | 161 |
162 // Max number of navigation entries in each direction we'll persist. | 162 // Max number of navigation entries in each direction we'll persist. |
163 static const int max_persist_navigation_count; | 163 static const int max_persist_navigation_count; |
164 | 164 |
165 private: | 165 private: |
| 166 friend class BetterSessionRestoreCrashTest; |
| 167 |
166 // The profile. This may be null during testing. | 168 // The profile. This may be null during testing. |
167 Profile* profile_; | 169 Profile* profile_; |
168 | 170 |
169 // The backend. | 171 // The backend. |
170 scoped_refptr<SessionBackend> backend_; | 172 scoped_refptr<SessionBackend> backend_; |
171 | 173 |
172 // Used to invoke Save. | 174 // Used to invoke Save. |
173 base::WeakPtrFactory<BaseSessionService> weak_factory_; | 175 base::WeakPtrFactory<BaseSessionService> weak_factory_; |
174 | 176 |
175 // Commands we need to send over to the backend. | 177 // Commands we need to send over to the backend. |
176 std::vector<SessionCommand*> pending_commands_; | 178 std::vector<SessionCommand*> pending_commands_; |
177 | 179 |
178 // Whether the backend file should be recreated the next time we send | 180 // Whether the backend file should be recreated the next time we send |
179 // over the commands. | 181 // over the commands. |
180 bool pending_reset_; | 182 bool pending_reset_; |
181 | 183 |
182 // The number of commands sent to the backend before doing a reset. | 184 // The number of commands sent to the backend before doing a reset. |
183 int commands_since_reset_; | 185 int commands_since_reset_; |
184 | 186 |
185 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 187 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
186 }; | 188 }; |
187 | 189 |
188 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 190 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
OLD | NEW |