| 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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 const base::Closure& task); | 182 const base::Closure& task); |
| 183 | 183 |
| 184 // Returns true if we appear to be running in production, false if we appear | 184 // Returns true if we appear to be running in production, false if we appear |
| 185 // to be running as part of a unit test or if the FILE thread has gone away. | 185 // to be running as part of a unit test or if the FILE thread has gone away. |
| 186 bool RunningInProduction() const; | 186 bool RunningInProduction() const; |
| 187 | 187 |
| 188 // Max number of navigation entries in each direction we'll persist. | 188 // Max number of navigation entries in each direction we'll persist. |
| 189 static const int max_persist_navigation_count; | 189 static const int max_persist_navigation_count; |
| 190 | 190 |
| 191 private: | 191 private: |
| 192 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, KeepPostDataWithoutPasswords); | |
| 193 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, RemovePostData); | |
| 194 FRIEND_TEST_ALL_PREFIXES(SessionServiceTest, RemovePostDataWithPasswords); | |
| 195 | |
| 196 // The profile. This may be null during testing. | 192 // The profile. This may be null during testing. |
| 197 Profile* profile_; | 193 Profile* profile_; |
| 198 | 194 |
| 199 // The backend. | 195 // The backend. |
| 200 scoped_refptr<SessionBackend> backend_; | 196 scoped_refptr<SessionBackend> backend_; |
| 201 | 197 |
| 202 // Used to invoke Save. | 198 // Used to invoke Save. |
| 203 base::WeakPtrFactory<BaseSessionService> weak_factory_; | 199 base::WeakPtrFactory<BaseSessionService> weak_factory_; |
| 204 | 200 |
| 205 // Commands we need to send over to the backend. | 201 // Commands we need to send over to the backend. |
| 206 std::vector<SessionCommand*> pending_commands_; | 202 std::vector<SessionCommand*> pending_commands_; |
| 207 | 203 |
| 208 // Whether the backend file should be recreated the next time we send | 204 // Whether the backend file should be recreated the next time we send |
| 209 // over the commands. | 205 // over the commands. |
| 210 bool pending_reset_; | 206 bool pending_reset_; |
| 211 | 207 |
| 212 // The number of commands sent to the backend before doing a reset. | 208 // The number of commands sent to the backend before doing a reset. |
| 213 int commands_since_reset_; | 209 int commands_since_reset_; |
| 214 | 210 |
| 215 // Whether to save the HTTP bodies of the POST requests. | |
| 216 bool save_post_data_; | |
| 217 | |
| 218 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 211 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
| 219 }; | 212 }; |
| 220 | 213 |
| 221 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 214 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
| OLD | NEW |