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

Side by Side Diff: components/password_manager/core/browser/affiliation_fetcher.cc

Issue 1852093002: components/password_manager: scoped_ptr -> unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and revert an accidental .proto change Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/password_manager/core/browser/affiliation_fetcher.h" 5 #include "components/password_manager/core/browser/affiliation_fetcher.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 193
194 return true; 194 return true;
195 } 195 }
196 196
197 void AffiliationFetcher::OnURLFetchComplete(const net::URLFetcher* source) { 197 void AffiliationFetcher::OnURLFetchComplete(const net::URLFetcher* source) {
198 DCHECK_EQ(source, fetcher_.get()); 198 DCHECK_EQ(source, fetcher_.get());
199 199
200 // Note that invoking the |delegate_| may destroy |this| synchronously, so the 200 // Note that invoking the |delegate_| may destroy |this| synchronously, so the
201 // invocation must happen last. 201 // invocation must happen last.
202 scoped_ptr<AffiliationFetcherDelegate::Result> result_data( 202 std::unique_ptr<AffiliationFetcherDelegate::Result> result_data(
203 new AffiliationFetcherDelegate::Result); 203 new AffiliationFetcherDelegate::Result);
204 if (fetcher_->GetStatus().status() == net::URLRequestStatus::SUCCESS && 204 if (fetcher_->GetStatus().status() == net::URLRequestStatus::SUCCESS &&
205 fetcher_->GetResponseCode() == net::HTTP_OK) { 205 fetcher_->GetResponseCode() == net::HTTP_OK) {
206 if (ParseResponse(result_data.get())) { 206 if (ParseResponse(result_data.get())) {
207 ReportStatistics(AFFILIATION_FETCH_RESULT_SUCCESS, nullptr); 207 ReportStatistics(AFFILIATION_FETCH_RESULT_SUCCESS, nullptr);
208 delegate_->OnFetchSucceeded(std::move(result_data)); 208 delegate_->OnFetchSucceeded(std::move(result_data));
209 } else { 209 } else {
210 ReportStatistics(AFFILIATION_FETCH_RESULT_MALFORMED, nullptr); 210 ReportStatistics(AFFILIATION_FETCH_RESULT_MALFORMED, nullptr);
211 delegate_->OnMalformedResponse(); 211 delegate_->OnMalformedResponse();
212 } 212 }
213 } else { 213 } else {
214 ReportStatistics(AFFILIATION_FETCH_RESULT_FAILURE, fetcher_.get()); 214 ReportStatistics(AFFILIATION_FETCH_RESULT_FAILURE, fetcher_.get());
215 delegate_->OnFetchFailed(); 215 delegate_->OnFetchFailed();
216 } 216 }
217 } 217 }
218 218
219 } // namespace password_manager 219 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698