| 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 cde6cede1f0810c79d13b57acbe799e983b330d1..491806088f40be1e504da09d6ca222fc91f2fbd9 100644
|
| --- a/components/offline_pages/background/request_coordinator.cc
|
| +++ b/components/offline_pages/background/request_coordinator.cc
|
| @@ -91,37 +91,28 @@ bool RequestCoordinator::SavePageLater(
|
| return true;
|
| }
|
| void RequestCoordinator::GetQueuedRequests(
|
| - const std::string& client_namespace,
|
| const QueuedRequestCallback& callback) {
|
| // Get all matching requests from the request queue, send them to our
|
| // callback. We bind the namespace and callback to the front of the callback
|
| // param set.
|
| queue_->GetRequests(base::Bind(&RequestCoordinator::GetQueuedRequestsCallback,
|
| - weak_ptr_factory_.GetWeakPtr(),
|
| - client_namespace, callback));
|
| + weak_ptr_factory_.GetWeakPtr(), callback));
|
| }
|
|
|
| -// For each request matching the client_namespace, return the ClientId.
|
| void RequestCoordinator::GetQueuedRequestsCallback(
|
| - const std::string& client_namespace,
|
| const QueuedRequestCallback& callback,
|
| RequestQueue::GetRequestsResult result,
|
| const std::vector<SavePageRequest>& requests) {
|
| - std::vector<ClientId> client_ids;
|
|
|
| - for (const auto& request : requests) {
|
| - if (client_namespace == request.client_id().name_space)
|
| - client_ids.push_back(request.client_id());
|
| - }
|
| -
|
| - callback.Run(client_ids);
|
| + callback.Run(requests);
|
| }
|
|
|
| void RequestCoordinator::RemoveRequests(
|
| - const std::vector<ClientId>& client_ids) {
|
| - queue_->RemoveRequestsByClientId(
|
| - client_ids, base::Bind(&RequestCoordinator::UpdateMultipleRequestCallback,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| + const std::vector<int64_t>& request_ids) {
|
| + queue_->RemoveRequests(
|
| + request_ids,
|
| + base::Bind(&RequestCoordinator::UpdateMultipleRequestCallback,
|
| + weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| void RequestCoordinator::AddRequestResultCallback(
|
| @@ -310,8 +301,10 @@ void RequestCoordinator::OfflinerDoneCallback(const SavePageRequest& request,
|
| // completed. Since we call MarkAttemptCompleted within the if branches,
|
| // the completed_attempt_count has not yet been updated when we are checking
|
| // the if condition.
|
| - queue_->RemoveRequest(
|
| - request.request_id(),
|
| + std::vector<int64_t> remove_requests;
|
| + remove_requests.push_back(request.request_id());
|
| + queue_->RemoveRequests(
|
| + remove_requests,
|
| base::Bind(&RequestCoordinator::UpdateRequestCallback,
|
| weak_ptr_factory_.GetWeakPtr(), request.client_id()));
|
| } else {
|
|
|