| 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 #include "components/offline_pages/background/request_queue.h" | 5 #include "components/offline_pages/background/request_queue.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
| 10 #include "components/offline_pages/background/request_queue_store.h" | 10 #include "components/offline_pages/background/request_queue_store.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 update_callback.Run( | 122 update_callback.Run( |
| 123 RequestQueue::UpdateRequestResult::REQUEST_DOES_NOT_EXIST); | 123 RequestQueue::UpdateRequestResult::REQUEST_DOES_NOT_EXIST); |
| 124 return; | 124 return; |
| 125 } | 125 } |
| 126 | 126 |
| 127 // Since the request exists, update it. | 127 // Since the request exists, update it. |
| 128 store_->AddOrUpdateRequest(update_request, | 128 store_->AddOrUpdateRequest(update_request, |
| 129 base::Bind(&UpdateRequestDone, update_callback)); | 129 base::Bind(&UpdateRequestDone, update_callback)); |
| 130 } | 130 } |
| 131 | 131 |
| 132 void RequestQueue::RemoveRequest(int64_t request_id, | 132 void RequestQueue::RemoveRequests(const std::vector<int64_t>& request_ids, |
| 133 const UpdateRequestCallback& callback) { | 133 const UpdateRequestCallback& callback) { |
| 134 std::vector<int64_t> request_ids{request_id}; | |
| 135 store_->RemoveRequests(request_ids, base::Bind(RemoveRequestDone, callback)); | 134 store_->RemoveRequests(request_ids, base::Bind(RemoveRequestDone, callback)); |
| 136 } | 135 } |
| 137 | 136 |
| 138 void RequestQueue::RemoveRequestsByClientId( | |
| 139 const std::vector<ClientId>& client_ids, | |
| 140 const UpdateRequestCallback& callback) { | |
| 141 store_->RemoveRequestsByClientId(client_ids, | |
| 142 base::Bind(RemoveRequestDone, callback)); | |
| 143 } | |
| 144 | |
| 145 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {} | 137 void RequestQueue::PurgeRequests(const PurgeRequestsCallback& callback) {} |
| 146 | 138 |
| 147 } // namespace offline_pages | 139 } // namespace offline_pages |
| OLD | NEW |