| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 : driver_(driver), | 148 : driver_(driver), |
| 149 observer_(observer), | 149 observer_(observer), |
| 150 max_form_cache_size_(kMaxFormCacheSize), | 150 max_form_cache_size_(kMaxFormCacheSize), |
| 151 fetcher_backoff_(&kAutofillBackoffPolicy), | 151 fetcher_backoff_(&kAutofillBackoffPolicy), |
| 152 fetcher_id_for_unittest_(0), | 152 fetcher_id_for_unittest_(0), |
| 153 weak_factory_(this) { | 153 weak_factory_(this) { |
| 154 DCHECK(observer_); | 154 DCHECK(observer_); |
| 155 } | 155 } |
| 156 | 156 |
| 157 AutofillDownloadManager::~AutofillDownloadManager() { | 157 AutofillDownloadManager::~AutofillDownloadManager() { |
| 158 STLDeleteContainerPairFirstPointers(url_fetchers_.begin(), | 158 base::STLDeleteContainerPairFirstPointers(url_fetchers_.begin(), |
| 159 url_fetchers_.end()); | 159 url_fetchers_.end()); |
| 160 } | 160 } |
| 161 | 161 |
| 162 bool AutofillDownloadManager::StartQueryRequest( | 162 bool AutofillDownloadManager::StartQueryRequest( |
| 163 const std::vector<FormStructure*>& forms) { | 163 const std::vector<FormStructure*>& forms) { |
| 164 // Do not send the request if it contains more fields than the server can | 164 // Do not send the request if it contains more fields than the server can |
| 165 // accept. | 165 // accept. |
| 166 if (CountActiveFieldsInForms(forms) > kMaxFieldsPerQueryRequest) | 166 if (CountActiveFieldsInForms(forms) > kMaxFieldsPerQueryRequest) |
| 167 return false; | 167 return false; |
| 168 | 168 |
| 169 AutofillQueryContents query; | 169 AutofillQueryContents query; |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } else { | 350 } else { |
| 351 VLOG(1) << "AutofillDownloadManager: upload request has succeeded."; | 351 VLOG(1) << "AutofillDownloadManager: upload request has succeeded."; |
| 352 observer_->OnUploadedPossibleFieldTypes(); | 352 observer_->OnUploadedPossibleFieldTypes(); |
| 353 } | 353 } |
| 354 } | 354 } |
| 355 delete it->first; | 355 delete it->first; |
| 356 url_fetchers_.erase(it); | 356 url_fetchers_.erase(it); |
| 357 } | 357 } |
| 358 | 358 |
| 359 } // namespace autofill | 359 } // namespace autofill |
| OLD | NEW |