OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/autofill/autofill_download.h" | 5 #include "chrome/browser/autofill/autofill_download.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <ostream> | 8 #include <ostream> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 DCHECK(request_context); | 164 DCHECK(request_context); |
165 std::string request_url; | 165 std::string request_url; |
166 if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY) | 166 if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY) |
167 request_url = kAutofillQueryServerRequestUrl; | 167 request_url = kAutofillQueryServerRequestUrl; |
168 else | 168 else |
169 request_url = kAutofillUploadServerRequestUrl; | 169 request_url = kAutofillUploadServerRequestUrl; |
170 request_url += kClientName; | 170 request_url += kClientName; |
171 | 171 |
172 // Id is ignored for regular chrome, in unit test id's for fake fetcher | 172 // Id is ignored for regular chrome, in unit test id's for fake fetcher |
173 // factory will be 0, 1, 2, ... | 173 // factory will be 0, 1, 2, ... |
174 content::URLFetcher* fetcher = content::URLFetcher::Create( | 174 net::URLFetcher* fetcher = content::URLFetcher::Create( |
175 fetcher_id_for_unittest_++, GURL(request_url), content::URLFetcher::POST, | 175 fetcher_id_for_unittest_++, GURL(request_url), net::URLFetcher::POST, |
176 this); | 176 this); |
177 url_fetchers_[fetcher] = request_data; | 177 url_fetchers_[fetcher] = request_data; |
178 fetcher->SetAutomaticallyRetryOn5xx(false); | 178 fetcher->SetAutomaticallyRetryOn5xx(false); |
179 fetcher->SetRequestContext(request_context); | 179 fetcher->SetRequestContext(request_context); |
180 fetcher->SetUploadData("text/plain", form_xml); | 180 fetcher->SetUploadData("text/plain", form_xml); |
181 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | | 181 fetcher->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | |
182 net::LOAD_DO_NOT_SEND_COOKIES); | 182 net::LOAD_DO_NOT_SEND_COOKIES); |
183 fetcher->Start(); | 183 fetcher->Start(); |
184 return true; | 184 return true; |
185 } | 185 } |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 SetPositiveUploadRate(new_positive_upload_rate); | 309 SetPositiveUploadRate(new_positive_upload_rate); |
310 SetNegativeUploadRate(new_negative_upload_rate); | 310 SetNegativeUploadRate(new_negative_upload_rate); |
311 } | 311 } |
312 | 312 |
313 observer_->OnUploadedPossibleFieldTypes(); | 313 observer_->OnUploadedPossibleFieldTypes(); |
314 } | 314 } |
315 } | 315 } |
316 delete it->first; | 316 delete it->first; |
317 url_fetchers_.erase(it); | 317 url_fetchers_.erase(it); |
318 } | 318 } |
OLD | NEW |