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 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/rand_util.h" | 10 #include "base/rand_util.h" |
11 #include "base/stl_util-inl.h" | 11 #include "base/stl_util-inl.h" |
12 #include "chrome/browser/autofill/autofill_xml_parser.h" | 12 #include "chrome/browser/autofill/autofill_xml_parser.h" |
13 #include "chrome/browser/prefs/pref_service.h" | 13 #include "chrome/browser/prefs/pref_service.h" |
14 #include "chrome/browser/profile.h" | 14 #include "chrome/browser/profile.h" |
15 #include "chrome/common/pref_names.h" | 15 #include "chrome/common/pref_names.h" |
16 #include "net/http/http_response_headers.h" | 16 #include "net/http/http_response_headers.h" |
17 | 17 |
18 #define DISABLED_REQUEST_URL "http://disabled" | 18 #define DISABLED_REQUEST_URL "http://disabled" |
19 | 19 |
20 #if defined(GOOGLE_CHROME_BUILD) | 20 #if defined(GOOGLE_CHROME_BUILD) |
21 #include "chrome/browser/autofill/internal/autofill_download_internal.h" | 21 #include "chrome/browser/autofill/internal/autofill_download_internal.h" |
22 #else | 22 #else |
23 #define AUTO_FILL_QUERY_SERVER_REQUEST_URL DISABLED_REQUEST_URL | 23 #define AUTO_FILL_QUERY_SERVER_REQUEST_URL DISABLED_REQUEST_URL |
24 #define AUTO_FILL_UPLOAD_SERVER_REQUEST_URL DISABLED_REQUEST_URL | 24 #define AUTO_FILL_UPLOAD_SERVER_REQUEST_URL DISABLED_REQUEST_URL |
25 #define AUTO_FILL_QUERY_SERVER_NAME_START_IN_HEADER "SOMESERVER/" | 25 #define AUTO_FILL_QUERY_SERVER_NAME_START_IN_HEADER "SOMESERVER/" |
26 #endif | 26 #endif |
27 | 27 |
| 28 struct AutoFillDownloadManager::FormRequestData { |
| 29 std::vector<std::string> form_signatures; |
| 30 AutoFillRequestType request_type; |
| 31 }; |
| 32 |
28 AutoFillDownloadManager::AutoFillDownloadManager(Profile* profile) | 33 AutoFillDownloadManager::AutoFillDownloadManager(Profile* profile) |
29 : profile_(profile), | 34 : profile_(profile), |
30 observer_(NULL), | 35 observer_(NULL), |
31 next_query_request_(base::Time::Now()), | 36 next_query_request_(base::Time::Now()), |
32 next_upload_request_(base::Time::Now()), | 37 next_upload_request_(base::Time::Now()), |
33 positive_upload_rate_(0), | 38 positive_upload_rate_(0), |
34 negative_upload_rate_(0), | 39 negative_upload_rate_(0), |
35 fetcher_id_for_unittest_(0), | 40 fetcher_id_for_unittest_(0), |
36 is_testing_(false) { | 41 is_testing_(false) { |
37 // |profile_| could be NULL in some unit-tests. | 42 // |profile_| could be NULL in some unit-tests. |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 } | 264 } |
260 | 265 |
261 if (observer_) | 266 if (observer_) |
262 observer_->OnUploadedAutoFillHeuristics(it->second.form_signatures[0]); | 267 observer_->OnUploadedAutoFillHeuristics(it->second.form_signatures[0]); |
263 } | 268 } |
264 } | 269 } |
265 delete it->first; | 270 delete it->first; |
266 url_fetchers_.erase(it); | 271 url_fetchers_.erase(it); |
267 } | 272 } |
268 | 273 |
OLD | NEW |