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

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

Issue 2473553004: Request Picker task (Closed)
Patch Set: CR fixes per DougArnett Created 4 years, 1 month 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
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/remove_requests_task.h" 5 #include "components/offline_pages/background/remove_requests_task.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 8
9 namespace offline_pages { 9 namespace offline_pages {
10 10
(...skipping 18 matching lines...) Expand all
29 return; 29 return;
30 } 30 }
31 31
32 store_->RemoveRequests(request_ids_, 32 store_->RemoveRequests(request_ids_,
33 base::Bind(&RemoveRequestsTask::CompleteWithResult, 33 base::Bind(&RemoveRequestsTask::CompleteWithResult,
34 weak_ptr_factory_.GetWeakPtr())); 34 weak_ptr_factory_.GetWeakPtr()));
35 } 35 }
36 36
37 void RemoveRequestsTask::CompleteEarly(ItemActionStatus status) { 37 void RemoveRequestsTask::CompleteEarly(ItemActionStatus status) {
38 // TODO(fgorski): store_->state() once implemented 38 // TODO(fgorski): store_->state() once implemented
39 std::unique_ptr<UpdateRequestsResult> result( 39 std::unique_ptr<QueueResults::UpdateRequestsResult> result(
40 new UpdateRequestsResult(StoreState::LOADED)); 40 new QueueResults::UpdateRequestsResult(StoreState::LOADED));
41 for (int64_t request_id : request_ids_) 41 for (int64_t request_id : request_ids_)
42 result->item_statuses.push_back(std::make_pair(request_id, status)); 42 result->item_statuses.push_back(std::make_pair(request_id, status));
43 CompleteWithResult(std::move(result)); 43 CompleteWithResult(std::move(result));
44 } 44 }
45 45
46 void RemoveRequestsTask::CompleteWithResult( 46 void RemoveRequestsTask::CompleteWithResult(
47 std::unique_ptr<UpdateRequestsResult> result) { 47 std::unique_ptr<QueueResults::UpdateRequestsResult> result) {
48 callback_.Run(std::move(result)); 48 callback_.Run(std::move(result));
49 TaskComplete(); 49 TaskComplete();
50 } 50 }
51 51
52 } // namespace offline_pages 52 } // namespace offline_pages
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698