Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: components/offline_pages/background/request_coordinator.cc

Issue 2277663003: Always reschedule after resuming. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "components/offline_pages/background/request_coordinator.h" 5 #include "components/offline_pages/background/request_coordinator.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 if (canceled) 174 if (canceled)
175 TryNextRequest(); 175 TryNextRequest();
176 } 176 }
177 177
178 void RequestCoordinator::ResumeRequests( 178 void RequestCoordinator::ResumeRequests(
179 const std::vector<int64_t>& request_ids) { 179 const std::vector<int64_t>& request_ids) {
180 queue_->ChangeRequestsState( 180 queue_->ChangeRequestsState(
181 request_ids, SavePageRequest::RequestState::AVAILABLE, 181 request_ids, SavePageRequest::RequestState::AVAILABLE,
182 base::Bind(&RequestCoordinator::UpdateMultipleRequestsCallback, 182 base::Bind(&RequestCoordinator::UpdateMultipleRequestsCallback,
183 weak_ptr_factory_.GetWeakPtr())); 183 weak_ptr_factory_.GetWeakPtr()));
184 // TODO: Should we also schedule a task, in case there is not one scheduled? 184 scheduler_->Schedule(GetTriggerConditionsForUserRequest());
185 } 185 }
186 186
187 void RequestCoordinator::AddRequestResultCallback( 187 void RequestCoordinator::AddRequestResultCallback(
188 RequestQueue::AddRequestResult result, 188 RequestQueue::AddRequestResult result,
189 const SavePageRequest& request) { 189 const SavePageRequest& request) {
190 // Inform the scheduler that we have an outstanding task.. 190 // Inform the scheduler that we have an outstanding task..
191 scheduler_->Schedule(GetTriggerConditionsForUserRequest()); 191 scheduler_->Schedule(GetTriggerConditionsForUserRequest());
192 } 192 }
193 193
194 // Called in response to updating a request in the request queue. 194 // Called in response to updating a request in the request queue.
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
448 FOR_EACH_OBSERVER(Observer, observers_, OnChanged(request)); 448 FOR_EACH_OBSERVER(Observer, observers_, OnChanged(request));
449 } 449 }
450 450
451 void RequestCoordinator::GetOffliner() { 451 void RequestCoordinator::GetOffliner() {
452 if (!offliner_) { 452 if (!offliner_) {
453 offliner_ = factory_->GetOffliner(policy_.get()); 453 offliner_ = factory_->GetOffliner(policy_.get());
454 } 454 }
455 } 455 }
456 456
457 } // namespace offline_pages 457 } // namespace offline_pages
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698