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

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

Issue 1117703002: Adjust URLFetcher::Create API so that object is returned as scoped_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unneeded Pass() calls Created 5 years, 7 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 "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "components/password_manager/core/browser/affiliation_api.pb.h" 9 #include "components/password_manager/core/browser/affiliation_api.pb.h"
10 #include "components/password_manager/core/browser/affiliation_utils.h" 10 #include "components/password_manager/core/browser/affiliation_utils.h"
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 81
82 // static 82 // static
83 void AffiliationFetcher::SetFactoryForTesting( 83 void AffiliationFetcher::SetFactoryForTesting(
84 TestAffiliationFetcherFactory* factory) { 84 TestAffiliationFetcherFactory* factory) {
85 g_testing_factory = factory; 85 g_testing_factory = factory;
86 } 86 }
87 87
88 void AffiliationFetcher::StartRequest() { 88 void AffiliationFetcher::StartRequest() {
89 DCHECK(!fetcher_); 89 DCHECK(!fetcher_);
90 90
91 fetcher_.reset( 91 fetcher_ =
92 net::URLFetcher::Create(BuildQueryURL(), net::URLFetcher::POST, this)); 92 net::URLFetcher::Create(BuildQueryURL(), net::URLFetcher::POST, this);
93 fetcher_->SetRequestContext(request_context_getter_.get()); 93 fetcher_->SetRequestContext(request_context_getter_.get());
94 fetcher_->SetUploadData("application/x-protobuf", PreparePayload()); 94 fetcher_->SetUploadData("application/x-protobuf", PreparePayload());
95 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | 95 fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES |
96 net::LOAD_DO_NOT_SEND_COOKIES | 96 net::LOAD_DO_NOT_SEND_COOKIES |
97 net::LOAD_DO_NOT_SEND_AUTH_DATA | 97 net::LOAD_DO_NOT_SEND_AUTH_DATA |
98 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE); 98 net::LOAD_BYPASS_CACHE | net::LOAD_DISABLE_CACHE);
99 fetcher_->SetAutomaticallyRetryOn5xx(false); 99 fetcher_->SetAutomaticallyRetryOn5xx(false);
100 fetcher_->SetAutomaticallyRetryOnNetworkChanges(0); 100 fetcher_->SetAutomaticallyRetryOnNetworkChanges(0);
101 fetcher_->Start(); 101 fetcher_->Start();
102 } 102 }
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 ReportStatistics(AFFILIATION_FETCH_RESULT_MALFORMED, nullptr); 207 ReportStatistics(AFFILIATION_FETCH_RESULT_MALFORMED, nullptr);
208 delegate_->OnMalformedResponse(); 208 delegate_->OnMalformedResponse();
209 } 209 }
210 } else { 210 } else {
211 ReportStatistics(AFFILIATION_FETCH_RESULT_FAILURE, fetcher_.get()); 211 ReportStatistics(AFFILIATION_FETCH_RESULT_FAILURE, fetcher_.get());
212 delegate_->OnFetchFailed(); 212 delegate_->OnFetchFailed();
213 } 213 }
214 } 214 }
215 215
216 } // namespace password_manager 216 } // namespace password_manager
OLDNEW
« no previous file with comments | « components/omnibox/search_provider.cc ('k') | components/policy/core/common/cloud/device_management_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698