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

Unified Diff: components/offline_pages/background/request_picker.cc

Issue 2332923003: Fix post submit problems for the vector of smart pointers change. (Closed)
Patch Set: Merge with request picker changes. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_pages/background/request_picker.cc
diff --git a/components/offline_pages/background/request_picker.cc b/components/offline_pages/background/request_picker.cc
index a199a372212959e7ebfb210e439e7a2f06ad8f54..e0b03d4aacf6ef240d9a8a37b91bac27d0a77391 100644
--- a/components/offline_pages/background/request_picker.cc
+++ b/components/offline_pages/background/request_picker.cc
@@ -242,7 +242,6 @@ void RequestPicker::SplitRequests(
std::vector<std::unique_ptr<SavePageRequest>> requests,
std::vector<std::unique_ptr<SavePageRequest>>* valid_requests,
std::vector<std::unique_ptr<SavePageRequest>>* expired_requests) {
- std::vector<std::unique_ptr<SavePageRequest>>::iterator request;
for (auto& request : requests) {
if (base::Time::Now() - request->creation_time() >=
base::TimeDelta::FromSeconds(kRequestExpirationTimeInSeconds)) {
@@ -258,14 +257,13 @@ void RequestPicker::SplitRequests(
void RequestPicker::OnRequestExpired(
const RequestQueue::UpdateMultipleRequestResults& results,
const std::vector<std::unique_ptr<SavePageRequest>> requests) {
- std::vector<std::unique_ptr<SavePageRequest>>::const_iterator request;
- for (request = requests.begin(); request != requests.end(); ++request) {
+ for (const auto& request : requests) {
const RequestCoordinator::BackgroundSavePageResult result(
RequestCoordinator::BackgroundSavePageResult::EXPIRED);
event_logger_->RecordDroppedSavePageRequest(
- request->get()->client_id().name_space, result,
- request->get()->request_id());
- notifier_->NotifyCompleted(*(request->get()), result);
+ request->client_id().name_space, result,
+ request->request_id());
+ notifier_->NotifyCompleted(*request, result);
}
}
« 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