Chromium Code Reviews| Index: components/offline_pages/background/request_coordinator.cc |
| diff --git a/components/offline_pages/background/request_coordinator.cc b/components/offline_pages/background/request_coordinator.cc |
| index 05ce9ffe9f656143119f54df05814fd7d91a7ccf..01cb8bbb8bd72dc7705d0cfbd1d77698bc867cbc 100644 |
| --- a/components/offline_pages/background/request_coordinator.cc |
| +++ b/components/offline_pages/background/request_coordinator.cc |
| @@ -77,17 +77,10 @@ void RequestCoordinator::AddRequestResultCallback( |
| void RequestCoordinator::UpdateRequestCallback( |
| RequestQueue::UpdateRequestResult result) {} |
| -// Called by the request picker when a request has been picked. |
| -void RequestCoordinator::RequestPicked(const SavePageRequest& request) { |
| - // Send the request on to the offliner. |
| - SendRequestToOffliner(request); |
| -} |
| - |
| -void RequestCoordinator::RequestQueueEmpty() { |
| - // Clear the outstanding "safety" task in the scheduler. |
| - scheduler_->Unschedule(); |
| - // Return control to the scheduler when there is no more to do. |
| - scheduler_callback_.Run(true); |
| +void RequestCoordinator::StopProcessing() { |
| + is_canceled_ = true; |
| + if (offliner_ && is_busy_) |
| + offliner_->Cancel(); |
| } |
| // Returns true if the caller should expect a callback, false otherwise. For |
| @@ -117,15 +110,17 @@ void RequestCoordinator::TryNextRequest() { |
| weak_ptr_factory_.GetWeakPtr())); |
| } |
| -void RequestCoordinator::StopProcessing() { |
| - is_canceled_ = true; |
| - if (offliner_ && is_busy_) |
| - offliner_->Cancel(); |
| +// Called by the request picker when a request has been picked. |
| +void RequestCoordinator::RequestPicked(const SavePageRequest& request) { |
| + // Send the request on to the offliner. |
| + SendRequestToOffliner(request); |
| } |
| -Scheduler::TriggerConditions const& |
| -RequestCoordinator::GetTriggerConditionsForUserRequest() { |
| - return kUserRequestTriggerConditions; |
| +void RequestCoordinator::RequestQueueEmpty() { |
| + // Clear the outstanding "safety" task in the scheduler. |
| + scheduler_->Unschedule(); |
| + // Return control to the scheduler when there is no more to do. |
| + scheduler_callback_.Run(true); |
| } |
| void RequestCoordinator::SendRequestToOffliner(const SavePageRequest& request) { |
| @@ -173,6 +168,11 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request, |
| } |
| } |
| +Scheduler::TriggerConditions const& |
|
fgorski
2016/06/24 18:39:17
Could you also update the order here to const type
|
| +RequestCoordinator::GetTriggerConditionsForUserRequest() { |
| + return kUserRequestTriggerConditions; |
| +} |
| + |
| void RequestCoordinator::GetOffliner() { |
| if (!offliner_) { |
| offliner_ = factory_->GetOffliner(policy_.get()); |