| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 5 #ifndef COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 6 #define COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 208 void ScheduleAsNeeded(); | 208 void ScheduleAsNeeded(); |
| 209 | 209 |
| 210 // Callback from the request picker when it has chosen our next request. | 210 // Callback from the request picker when it has chosen our next request. |
| 211 void RequestPicked(const SavePageRequest& request); | 211 void RequestPicked(const SavePageRequest& request); |
| 212 | 212 |
| 213 // Callback from the request picker when no more requests are in the queue. | 213 // Callback from the request picker when no more requests are in the queue. |
| 214 // The parameter is a signal for what (if any) conditions to schedule future | 214 // The parameter is a signal for what (if any) conditions to schedule future |
| 215 // processing for. | 215 // processing for. |
| 216 void RequestNotPicked(bool non_user_requested_tasks_remaining); | 216 void RequestNotPicked(bool non_user_requested_tasks_remaining); |
| 217 | 217 |
| 218 void HandleWatchdogTimeout(); |
| 219 |
| 220 void StopProcessingWithStatus(Offliner::RequestStatus stop_status); |
| 221 |
| 218 // Cancels an in progress pre-rendering, and updates state appropriately. | 222 // Cancels an in progress pre-rendering, and updates state appropriately. |
| 219 void StopPrerendering(); | 223 void StopPrerendering(Offliner::RequestStatus stop_status); |
| 220 | 224 |
| 221 void SendRequestToOffliner(const SavePageRequest& request); | 225 void SendRequestToOffliner(const SavePageRequest& request); |
| 222 | 226 |
| 223 // Called by the offliner when an offlining request is completed. (and by | 227 // Called by the offliner when an offlining request is completed. (and by |
| 224 // tests). | 228 // tests). |
| 225 void OfflinerDoneCallback(const SavePageRequest& request, | 229 void OfflinerDoneCallback(const SavePageRequest& request, |
| 226 Offliner::RequestStatus status); | 230 Offliner::RequestStatus status); |
| 227 | 231 |
| 228 void TryNextRequest(); | 232 void TryNextRequest(); |
| 229 | 233 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 base::TimeDelta offliner_timeout_; | 311 base::TimeDelta offliner_timeout_; |
| 308 // Allows us to pass a weak pointer to callbacks. | 312 // Allows us to pass a weak pointer to callbacks. |
| 309 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 313 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
| 310 | 314 |
| 311 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 315 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
| 312 }; | 316 }; |
| 313 | 317 |
| 314 } // namespace offline_pages | 318 } // namespace offline_pages |
| 315 | 319 |
| 316 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 320 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| OLD | NEW |