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

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

Issue 2373933003: [Offline pages] Updating RequestQueue::RemoveRequests to use a TaskQueue (Closed)
Patch Set: Addressing final feedback Created 4 years, 2 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
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_picker.h" 5 #include "components/offline_pages/background/request_picker.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "components/offline_pages/background/save_page_request.h" 9 #include "components/offline_pages/background/save_page_request.h"
10 10
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 expired_requests->push_back(std::move(request)); 248 expired_requests->push_back(std::move(request));
249 } else { 249 } else {
250 valid_requests->push_back(std::move(request)); 250 valid_requests->push_back(std::move(request));
251 } 251 }
252 } 252 }
253 } 253 }
254 254
255 // Callback used after expired requests are deleted from the queue and notifies 255 // Callback used after expired requests are deleted from the queue and notifies
256 // the coordinator. 256 // the coordinator.
257 void RequestPicker::OnRequestExpired( 257 void RequestPicker::OnRequestExpired(
258 const RequestQueue::UpdateMultipleRequestResults& results, 258 std::unique_ptr<UpdateRequestsResult> result) {
259 const std::vector<std::unique_ptr<SavePageRequest>> requests) { 259 const RequestCoordinator::BackgroundSavePageResult save_page_result(
260 for (const auto& request : requests) { 260 RequestCoordinator::BackgroundSavePageResult::EXPIRED);
261 const RequestCoordinator::BackgroundSavePageResult result( 261 for (const auto& request : result->updated_items) {
262 RequestCoordinator::BackgroundSavePageResult::EXPIRED);
263 event_logger_->RecordDroppedSavePageRequest( 262 event_logger_->RecordDroppedSavePageRequest(
264 request->client_id().name_space, result, 263 request.client_id().name_space, save_page_result, request.request_id());
265 request->request_id()); 264 notifier_->NotifyCompleted(request, save_page_result);
266 notifier_->NotifyCompleted(*request, result);
267 } 265 }
268 } 266 }
269 267
270 } // namespace offline_pages 268 } // namespace offline_pages
OLDNEW
« no previous file with comments | « components/offline_pages/background/request_picker.h ('k') | components/offline_pages/background/request_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698