Chromium Code Reviews| 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 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 253 // as to other device conditions). | 253 // as to other device conditions). |
| 254 void StartImmediatelyIfConnected(); | 254 void StartImmediatelyIfConnected(); |
| 255 | 255 |
| 256 OfflinerImmediateStartStatus TryImmediateStart(); | 256 OfflinerImmediateStartStatus TryImmediateStart(); |
| 257 | 257 |
| 258 // Check the request queue, and schedule a task corresponding | 258 // Check the request queue, and schedule a task corresponding |
| 259 // to the least restrictive type of request in the queue. | 259 // to the least restrictive type of request in the queue. |
| 260 void ScheduleAsNeeded(); | 260 void ScheduleAsNeeded(); |
| 261 | 261 |
| 262 // Callback from the request picker when it has chosen our next request. | 262 // Callback from the request picker when it has chosen our next request. |
| 263 void RequestPicked(const SavePageRequest& request); | 263 void RequestPicked(const SavePageRequest& request, const bool cleanup_needed); |
| 264 | 264 |
| 265 // Callback from the request picker when no more requests are in the queue. | 265 // Callback from the request picker when no more requests are in the queue. |
| 266 // The parameter is a signal for what (if any) conditions to schedule future | 266 // The parameter is a signal for what (if any) conditions to schedule future |
| 267 // processing for. | 267 // processing for. |
| 268 void RequestNotPicked(bool non_user_requested_tasks_remaining); | 268 void RequestNotPicked(const bool non_user_requested_tasks_remaining, |
|
fgorski
2016/12/02 21:44:04
I don't think you need to define "const bool" here
Pete Williamson
2016/12/05 20:39:46
Done.
| |
| 269 const bool cleanup_needed); | |
| 269 | 270 |
| 270 // Callback from request picker that receives the current available queued | 271 // Callback from request picker that receives the current available queued |
| 271 // request count as well as the total queued request count (which may be | 272 // request count as well as the total queued request count (which may be |
| 272 // different if unavailable requests are queued such as paused requests). | 273 // different if unavailable requests are queued such as paused requests). |
| 273 // It also receives a flag as to whether this request picking is due to the | 274 // It also receives a flag as to whether this request picking is due to the |
| 274 // start of a request processing window. | 275 // start of a request processing window. |
| 275 void RequestCounts(bool is_start_of_processing, | 276 void RequestCounts(bool is_start_of_processing, |
| 276 size_t total_requests, | 277 size_t total_requests, |
| 277 size_t available_requests); | 278 size_t available_requests); |
| 278 | 279 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 406 base::Callback<void(bool)> immediate_schedule_callback_; | 407 base::Callback<void(bool)> immediate_schedule_callback_; |
| 407 // Allows us to pass a weak pointer to callbacks. | 408 // Allows us to pass a weak pointer to callbacks. |
| 408 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 409 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
| 409 | 410 |
| 410 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 411 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
| 411 }; | 412 }; |
| 412 | 413 |
| 413 } // namespace offline_pages | 414 } // namespace offline_pages |
| 414 | 415 |
| 415 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 416 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| OLD | NEW |