Chromium Code Reviews| 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 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ | 5 #ifndef CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ |
| 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ | 6 #define CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <list> | 9 #include <list> |
| 10 #include <map> | 10 #include <map> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <utility> | 12 #include <utility> |
| 13 #include <vector> | 13 #include <vector> |
| 14 | 14 |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "chrome/browser/autofill/autofill_download_url.h" | |
|
Albert Bodenhamer
2012/10/23 23:57:11
Forward declare rather than include.
ahutter
2012/10/24 17:33:45
Done.
| |
| 18 #include "chrome/browser/autofill/autofill_type.h" | 19 #include "chrome/browser/autofill/autofill_type.h" |
| 19 #include "net/url_request/url_fetcher_delegate.h" | 20 #include "net/url_request/url_fetcher_delegate.h" |
| 20 | 21 |
| 21 class AutofillMetrics; | 22 class AutofillMetrics; |
| 22 class FormStructure; | 23 class FormStructure; |
| 23 | 24 |
| 24 namespace content { | 25 namespace content { |
| 25 class BrowserContext; | 26 class BrowserContext; |
| 26 } // namespace content | 27 } // namespace content |
| 27 | 28 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 130 | 131 |
| 131 // The pointer value is const, so this can only be set in the | 132 // The pointer value is const, so this can only be set in the |
| 132 // constructor. Must not be null. | 133 // constructor. Must not be null. |
| 133 content::BrowserContext* const browser_context_; // WEAK | 134 content::BrowserContext* const browser_context_; // WEAK |
| 134 | 135 |
| 135 // The observer to notify when server predictions are successfully received. | 136 // The observer to notify when server predictions are successfully received. |
| 136 // The pointer value is const, so this can only be set in the constructor. | 137 // The pointer value is const, so this can only be set in the constructor. |
| 137 // Must not be null. | 138 // Must not be null. |
| 138 AutofillDownloadManager::Observer* const observer_; // WEAK | 139 AutofillDownloadManager::Observer* const observer_; // WEAK |
| 139 | 140 |
| 141 AutofillDownloadUrl* autofill_download_url_; | |
|
Ilya Sherman
2012/10/23 23:45:13
Why is this stored as a pointer?
Albert Bodenhamer
2012/10/23 23:57:11
scoped_ptr<>
ahutter
2012/10/24 17:33:45
Done.
| |
| 142 | |
| 140 // For each requested form for both query and upload we create a separate | 143 // For each requested form for both query and upload we create a separate |
| 141 // request and save its info. As url fetcher is identified by its address | 144 // request and save its info. As url fetcher is identified by its address |
| 142 // we use a map between fetchers and info. | 145 // we use a map between fetchers and info. |
| 143 std::map<net::URLFetcher*, FormRequestData> url_fetchers_; | 146 std::map<net::URLFetcher*, FormRequestData> url_fetchers_; |
| 144 | 147 |
| 145 // Cached QUERY requests. | 148 // Cached QUERY requests. |
| 146 QueryRequestCache cached_forms_; | 149 QueryRequestCache cached_forms_; |
| 147 size_t max_form_cache_size_; | 150 size_t max_form_cache_size_; |
| 148 | 151 |
| 149 // Time when next query/upload requests are allowed. If 50x HTTP received, | 152 // Time when next query/upload requests are allowed. If 50x HTTP received, |
| 150 // exponential back off is initiated, so this times will be in the future | 153 // exponential back off is initiated, so this times will be in the future |
| 151 // for awhile. | 154 // for awhile. |
| 152 base::Time next_query_request_; | 155 base::Time next_query_request_; |
| 153 base::Time next_upload_request_; | 156 base::Time next_upload_request_; |
| 154 | 157 |
| 155 // |positive_upload_rate_| is for matched forms, | 158 // |positive_upload_rate_| is for matched forms, |
| 156 // |negative_upload_rate_| for non matched. | 159 // |negative_upload_rate_| for non matched. |
| 157 double positive_upload_rate_; | 160 double positive_upload_rate_; |
| 158 double negative_upload_rate_; | 161 double negative_upload_rate_; |
| 159 | 162 |
| 160 // Needed for unit-test. | 163 // Needed for unit-test. |
| 161 int fetcher_id_for_unittest_; | 164 int fetcher_id_for_unittest_; |
| 162 }; | 165 }; |
| 163 | 166 |
| 164 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ | 167 #endif // CHROME_BROWSER_AUTOFILL_AUTOFILL_DOWNLOAD_H_ |
| OLD | NEW |