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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 Handle ScheduleGetLastSessionCommands( | 175 Handle ScheduleGetLastSessionCommands( |
176 InternalGetCommandsRequest* request, | 176 InternalGetCommandsRequest* request, |
177 CancelableRequestConsumerBase* consumer); | 177 CancelableRequestConsumerBase* consumer); |
178 | 178 |
179 // In production, this posts the task to the FILE thread. For | 179 // In production, this posts the task to the FILE thread. For |
180 // tests, it immediately runs the specified task on the current | 180 // tests, it immediately runs the specified task on the current |
181 // thread. | 181 // thread. |
182 bool RunTaskOnBackendThread(const tracked_objects::Location& from_here, | 182 bool RunTaskOnBackendThread(const tracked_objects::Location& from_here, |
183 const base::Closure& task); | 183 const base::Closure& task); |
184 | 184 |
| 185 // Returns true if we appear to be running in production, false if we appear |
| 186 // to be running as part of a unit test or if the FILE thread has gone away. |
| 187 bool RunningInProduction() const; |
| 188 |
185 // Max number of navigation entries in each direction we'll persist. | 189 // Max number of navigation entries in each direction we'll persist. |
186 static const int max_persist_navigation_count; | 190 static const int max_persist_navigation_count; |
187 | 191 |
188 private: | 192 private: |
189 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, KeepPostDataWithoutPasswords); | 193 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, KeepPostDataWithoutPasswords); |
190 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, RemovePostData); | 194 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, RemovePostData); |
191 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, RemovePostDataWithPasswords); | 195 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, RemovePostDataWithPasswords); |
192 | 196 |
193 // The profile. This may be null during testing. | 197 // The profile. This may be null during testing. |
194 Profile* profile_; | 198 Profile* profile_; |
(...skipping 14 matching lines...) Expand all Loading... |
209 // The number of commands sent to the backend before doing a reset. | 213 // The number of commands sent to the backend before doing a reset. |
210 int commands_since_reset_; | 214 int commands_since_reset_; |
211 | 215 |
212 // Whether to save the HTTP bodies of the POST requests. | 216 // Whether to save the HTTP bodies of the POST requests. |
213 bool save_post_data_; | 217 bool save_post_data_; |
214 | 218 |
215 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 219 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
216 }; | 220 }; |
217 | 221 |
218 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 222 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
OLD | NEW |