| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 URLFetcher::POST, | 181 URLFetcher::POST, |
| 182 this); | 182 this); |
| 183 url_fetchers_[fetcher] = request_data; | 183 url_fetchers_[fetcher] = request_data; |
| 184 fetcher->set_automatically_retry_on_5xx(false); | 184 fetcher->set_automatically_retry_on_5xx(false); |
| 185 fetcher->set_request_context(Profile::GetDefaultRequestContext()); | 185 fetcher->set_request_context(Profile::GetDefaultRequestContext()); |
| 186 fetcher->set_upload_data("text/plain", form_xml); | 186 fetcher->set_upload_data("text/plain", form_xml); |
| 187 fetcher->Start(); | 187 fetcher->Start(); |
| 188 return true; | 188 return true; |
| 189 } | 189 } |
| 190 | 190 |
| 191 void AutoFillDownloadManager::OnURLFetchComplete(const URLFetcher* source, | 191 void AutoFillDownloadManager::OnURLFetchComplete( |
| 192 const GURL& url, | 192 const URLFetcher* source, |
| 193 const URLRequestStatus& status, | 193 const GURL& url, |
| 194 int response_code, | 194 const net::URLRequestStatus& status, |
| 195 const ResponseCookies& cookies, | 195 int response_code, |
| 196 const std::string& data) { | 196 const ResponseCookies& cookies, |
| 197 const std::string& data) { |
| 197 std::map<URLFetcher *, FormRequestData>::iterator it = | 198 std::map<URLFetcher *, FormRequestData>::iterator it = |
| 198 url_fetchers_.find(const_cast<URLFetcher*>(source)); | 199 url_fetchers_.find(const_cast<URLFetcher*>(source)); |
| 199 if (it == url_fetchers_.end()) { | 200 if (it == url_fetchers_.end()) { |
| 200 // Looks like crash on Mac is possibly caused with callback entering here | 201 // Looks like crash on Mac is possibly caused with callback entering here |
| 201 // with unknown fetcher when network is refreshed. | 202 // with unknown fetcher when network is refreshed. |
| 202 return; | 203 return; |
| 203 } | 204 } |
| 204 std::string type_of_request( | 205 std::string type_of_request( |
| 205 it->second.request_type == AutoFillDownloadManager::REQUEST_QUERY ? | 206 it->second.request_type == AutoFillDownloadManager::REQUEST_QUERY ? |
| 206 "query" : "upload"); | 207 "query" : "upload"); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 SetNegativeUploadRate(new_negative_upload_rate); | 264 SetNegativeUploadRate(new_negative_upload_rate); |
| 264 } | 265 } |
| 265 | 266 |
| 266 if (observer_) | 267 if (observer_) |
| 267 observer_->OnUploadedAutoFillHeuristics(it->second.form_signatures[0]); | 268 observer_->OnUploadedAutoFillHeuristics(it->second.form_signatures[0]); |
| 268 } | 269 } |
| 269 } | 270 } |
| 270 delete it->first; | 271 delete it->first; |
| 271 url_fetchers_.erase(it); | 272 url_fetchers_.erase(it); |
| 272 } | 273 } |
| OLD | NEW |