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_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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 | 138 |
139 // Returns true if the entry at specified |url| should be written to disk. | 139 // Returns true if the entry at specified |url| should be written to disk. |
140 bool ShouldTrackEntry(const GURL& url); | 140 bool ShouldTrackEntry(const GURL& url); |
141 | 141 |
142 // Invokes ReadLastSessionCommands with request on the backend thread. | 142 // Invokes ReadLastSessionCommands with request on the backend thread. |
143 // If testing, ReadLastSessionCommands is invoked directly. | 143 // If testing, ReadLastSessionCommands is invoked directly. |
144 Handle ScheduleGetLastSessionCommands( | 144 Handle ScheduleGetLastSessionCommands( |
145 InternalGetCommandsRequest* request, | 145 InternalGetCommandsRequest* request, |
146 CancelableRequestConsumerBase* consumer); | 146 CancelableRequestConsumerBase* consumer); |
147 | 147 |
148 // Invokes ReadCurrentSessionCommands with request on the backend thread. | |
149 // If testing, ReadLastSessionCommands is invoked directly. | |
150 Handle ScheduleGetCurrentSessionCommands( | |
151 InternalGetCommandsRequest* request, | |
152 CancelableRequestConsumerBase* consumer); | |
153 | |
154 // In production, this posts the task to the FILE thread. For | 148 // In production, this posts the task to the FILE thread. For |
155 // tests, it immediately runs the specified task on the current | 149 // tests, it immediately runs the specified task on the current |
156 // thread. | 150 // thread. |
157 bool RunTaskOnBackendThread(const tracked_objects::Location& from_here, | 151 bool RunTaskOnBackendThread(const tracked_objects::Location& from_here, |
158 const base::Closure& task); | 152 const base::Closure& task); |
159 | 153 |
160 // Max number of navigation entries in each direction we'll persist. | 154 // Max number of navigation entries in each direction we'll persist. |
161 static const int max_persist_navigation_count; | 155 static const int max_persist_navigation_count; |
162 | 156 |
163 private: | 157 private: |
(...skipping 16 matching lines...) Expand all Loading... |
180 // over the commands. | 174 // over the commands. |
181 bool pending_reset_; | 175 bool pending_reset_; |
182 | 176 |
183 // The number of commands sent to the backend before doing a reset. | 177 // The number of commands sent to the backend before doing a reset. |
184 int commands_since_reset_; | 178 int commands_since_reset_; |
185 | 179 |
186 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); | 180 DISALLOW_COPY_AND_ASSIGN(BaseSessionService); |
187 }; | 181 }; |
188 | 182 |
189 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ | 183 #endif // CHROME_BROWSER_SESSIONS_BASE_SESSION_SERVICE_H_ |
OLD | NEW |