| 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 | 10 |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 // Resume a list of previously paused requests, making them available. | 105 // Resume a list of previously paused requests, making them available. |
| 106 void ResumeRequests(const std::vector<int64_t>& request_ids); | 106 void ResumeRequests(const std::vector<int64_t>& request_ids); |
| 107 | 107 |
| 108 // Get all save page request items in the callback. | 108 // Get all save page request items in the callback. |
| 109 void GetAllRequests(const GetRequestsCallback& callback); | 109 void GetAllRequests(const GetRequestsCallback& callback); |
| 110 | 110 |
| 111 // Starts processing of one or more queued save page later requests. | 111 // Starts processing of one or more queued save page later requests. |
| 112 // Returns whether processing was started and that caller should expect | 112 // Returns whether processing was started and that caller should expect |
| 113 // a callback. If processing was already active, returns false. | 113 // a callback. If processing was already active, returns false. |
| 114 bool StartProcessing(const DeviceConditions& device_conditions, | 114 bool StartProcessing(bool is_background_scheduled, |
| 115 const DeviceConditions& device_conditions, |
| 115 const base::Callback<void(bool)>& callback); | 116 const base::Callback<void(bool)>& callback); |
| 116 | 117 |
| 117 // Stops the current request processing if active. This is a way for | 118 // Stops the current request processing if active. This is a way for |
| 118 // caller to abort processing; otherwise, processing will complete on | 119 // caller to abort processing; otherwise, processing will complete on |
| 119 // its own. In either case, the callback will be called when processing | 120 // its own. In either case, the callback will be called when processing |
| 120 // is stopped or complete. | 121 // is stopped or complete. |
| 121 void StopProcessing(Offliner::RequestStatus stop_status); | 122 void StopProcessing(Offliner::RequestStatus stop_status); |
| 122 | 123 |
| 123 // Used to denote that the foreground thread is ready for the offliner | 124 // Used to denote that the foreground thread is ready for the offliner |
| 124 // to start work on a previously entered, but unavailable request. | 125 // to start work on a previously entered, but unavailable request. |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 base::TimeDelta offliner_timeout_; | 364 base::TimeDelta offliner_timeout_; |
| 364 // Allows us to pass a weak pointer to callbacks. | 365 // Allows us to pass a weak pointer to callbacks. |
| 365 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; | 366 base::WeakPtrFactory<RequestCoordinator> weak_ptr_factory_; |
| 366 | 367 |
| 367 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); | 368 DISALLOW_COPY_AND_ASSIGN(RequestCoordinator); |
| 368 }; | 369 }; |
| 369 | 370 |
| 370 } // namespace offline_pages | 371 } // namespace offline_pages |
| 371 | 372 |
| 372 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ | 373 #endif // COMPONENTS_OFFLINE_PAGES_BACKGROUND_REQUEST_COORDINATOR_H_ |
| OLD | NEW |