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

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

Issue 1548203002: Convert Pass()→std::move() in //components/[n-z]* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix bad headers Created 4 years, 11 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 9
9 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
10 #include "base/metrics/sparse_histogram.h" 11 #include "base/metrics/sparse_histogram.h"
11 #include "components/password_manager/core/browser/affiliation_api.pb.h" 12 #include "components/password_manager/core/browser/affiliation_api.pb.h"
12 #include "components/password_manager/core/browser/affiliation_utils.h" 13 #include "components/password_manager/core/browser/affiliation_utils.h"
13 #include "components/password_manager/core/browser/test_affiliation_fetcher_fact ory.h" 14 #include "components/password_manager/core/browser/test_affiliation_fetcher_fact ory.h"
14 #include "google_apis/google_api_keys.h" 15 #include "google_apis/google_api_keys.h"
15 #include "net/base/load_flags.h" 16 #include "net/base/load_flags.h"
16 #include "net/base/url_util.h" 17 #include "net/base/url_util.h"
17 #include "net/http/http_status_code.h" 18 #include "net/http/http_status_code.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 DCHECK_EQ(source, fetcher_.get()); 198 DCHECK_EQ(source, fetcher_.get());
198 199
199 // Note that invoking the |delegate_| may destroy |this| synchronously, so the 200 // Note that invoking the |delegate_| may destroy |this| synchronously, so the
200 // invocation must happen last. 201 // invocation must happen last.
201 scoped_ptr<AffiliationFetcherDelegate::Result> result_data( 202 scoped_ptr<AffiliationFetcherDelegate::Result> result_data(
202 new AffiliationFetcherDelegate::Result); 203 new AffiliationFetcherDelegate::Result);
203 if (fetcher_->GetStatus().status() == net::URLRequestStatus::SUCCESS && 204 if (fetcher_->GetStatus().status() == net::URLRequestStatus::SUCCESS &&
204 fetcher_->GetResponseCode() == net::HTTP_OK) { 205 fetcher_->GetResponseCode() == net::HTTP_OK) {
205 if (ParseResponse(result_data.get())) { 206 if (ParseResponse(result_data.get())) {
206 ReportStatistics(AFFILIATION_FETCH_RESULT_SUCCESS, nullptr); 207 ReportStatistics(AFFILIATION_FETCH_RESULT_SUCCESS, nullptr);
207 delegate_->OnFetchSucceeded(result_data.Pass()); 208 delegate_->OnFetchSucceeded(std::move(result_data));
208 } else { 209 } else {
209 ReportStatistics(AFFILIATION_FETCH_RESULT_MALFORMED, nullptr); 210 ReportStatistics(AFFILIATION_FETCH_RESULT_MALFORMED, nullptr);
210 delegate_->OnMalformedResponse(); 211 delegate_->OnMalformedResponse();
211 } 212 }
212 } else { 213 } else {
213 ReportStatistics(AFFILIATION_FETCH_RESULT_FAILURE, fetcher_.get()); 214 ReportStatistics(AFFILIATION_FETCH_RESULT_FAILURE, fetcher_.get());
214 delegate_->OnFetchFailed(); 215 delegate_->OnFetchFailed();
215 } 216 }
216 } 217 }
217 218
218 } // namespace password_manager 219 } // namespace password_manager
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698