OLD | NEW |
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/autofill/core/browser/autofill_download_manager.h" | 5 #include "components/autofill/core/browser/autofill_download_manager.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/rand_util.h" | 9 #include "base/rand_util.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 bool AutofillDownloadManager::StartRequest( | 170 bool AutofillDownloadManager::StartRequest( |
171 const std::string& form_xml, | 171 const std::string& form_xml, |
172 const FormRequestData& request_data) { | 172 const FormRequestData& request_data) { |
173 net::URLRequestContextGetter* request_context = | 173 net::URLRequestContextGetter* request_context = |
174 driver_->GetURLRequestContext(); | 174 driver_->GetURLRequestContext(); |
175 DCHECK(request_context); | 175 DCHECK(request_context); |
176 GURL request_url = GetRequestUrl(request_data.request_type); | 176 GURL request_url = GetRequestUrl(request_data.request_type); |
177 | 177 |
178 // Id is ignored for regular chrome, in unit test id's for fake fetcher | 178 // Id is ignored for regular chrome, in unit test id's for fake fetcher |
179 // factory will be 0, 1, 2, ... | 179 // factory will be 0, 1, 2, ... |
180 net::URLFetcher* fetcher = net::URLFetcher::Create( | 180 net::URLFetcher* fetcher = |
181 fetcher_id_for_unittest_++, request_url, net::URLFetcher::POST, | 181 net::URLFetcher::Create(fetcher_id_for_unittest_++, request_url, |
182 this); | 182 net::URLFetcher::POST, this).release(); |
183 url_fetchers_[fetcher] = request_data; | 183 url_fetchers_[fetcher] = request_data; |
184 fetcher->SetAutomaticallyRetryOn5xx(false); | 184 fetcher->SetAutomaticallyRetryOn5xx(false); |
185 fetcher->SetRequestContext(request_context); | 185 fetcher->SetRequestContext(request_context); |
186 fetcher->SetUploadData("text/plain", form_xml); | 186 fetcher->SetUploadData("text/plain", form_xml); |
187 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | | 187 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | |
188 net::LOAD_DO_NOT_SEND_COOKIES); | 188 net::LOAD_DO_NOT_SEND_COOKIES); |
189 fetcher->Start(); | 189 fetcher->Start(); |
190 | 190 |
191 VLOG(1) << "Sending AutofillDownloadManager " | 191 VLOG(1) << "Sending AutofillDownloadManager " |
192 << RequestTypeToString(request_data.request_type) | 192 << RequestTypeToString(request_data.request_type) |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 } | 320 } |
321 | 321 |
322 observer_->OnUploadedPossibleFieldTypes(); | 322 observer_->OnUploadedPossibleFieldTypes(); |
323 } | 323 } |
324 } | 324 } |
325 delete it->first; | 325 delete it->first; |
326 url_fetchers_.erase(it); | 326 url_fetchers_.erase(it); |
327 } | 327 } |
328 | 328 |
329 } // namespace autofill | 329 } // namespace autofill |
OLD | NEW |