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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 | 142 |
143 // Returns true if the entry at specified |url| should be written to disk. | 143 // Returns true if the entry at specified |url| should be written to disk. |
144 bool ShouldTrackEntry(const GURL& url); | 144 bool ShouldTrackEntry(const GURL& url); |
145 | 145 |
146 // Invokes ReadLastSessionCommands with request on the backend thread. | 146 // Invokes ReadLastSessionCommands with request on the backend thread. |
147 // If testing, ReadLastSessionCommands is invoked directly. | 147 // If testing, ReadLastSessionCommands is invoked directly. |
148 Handle ScheduleGetLastSessionCommands( | 148 Handle ScheduleGetLastSessionCommands( |
149 InternalGetCommandsRequest* request, | 149 InternalGetCommandsRequest* request, |
150 CancelableRequestConsumerBase* consumer); | 150 CancelableRequestConsumerBase* consumer); |
151 | 151 |
| 152 // Returns true if we appear to be running in production, false if |
| 153 // we appear to be running as part of a unit test or if the FILE |
| 154 // thread has gone away. |
| 155 bool RunningInProduction() const; |
| 156 |
152 // In production, this posts the task to the FILE thread. For | 157 // In production, this posts the task to the FILE thread. For |
153 // tests, it immediately runs the specified task on the current | 158 // tests, it immediately runs the specified task on the current |
154 // thread. | 159 // thread. |
155 bool RunTaskOnBackendThread(const tracked_objects::Location& from_here, | 160 bool RunTaskOnBackendThread(const tracked_objects::Location& from_here, |
156 const base::Closure& task); | 161 const base::Closure& task); |
157 | 162 |
158 // Max number of navigation entries in each direction we'll persist. | 163 // Max number of navigation entries in each direction we'll persist. |
159 static const int max_persist_navigation_count; | 164 static const int max_persist_navigation_count; |
160 | 165 |
161 private: | 166 private: |
(...skipping 22 matching lines...) Expand all Loading... |
184 // The number of commands sent to the backend before doing a reset. | 189 // The number of commands sent to the backend before doing a reset. |
185 int commands_since_reset_; | 190 int commands_since_reset_; |
186 | 191 |
187 // Whether to save the HTTP bodies of the POST requests. | 192 // Whether to save the HTTP bodies of the POST requests. |
188 bool save_post_data_; | 193 bool save_post_data_; |
189 | 194 |
190 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 195 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
191 }; | 196 }; |
192 | 197 |
193 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 198 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
OLD | NEW |