| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ | 6 #define CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 }; | 145 }; |
| 146 | 146 |
| 147 CertificateReportingService( | 147 CertificateReportingService( |
| 148 safe_browsing::SafeBrowsingService* safe_browsing_service, | 148 safe_browsing::SafeBrowsingService* safe_browsing_service, |
| 149 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, | 149 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter, |
| 150 Profile* profile, | 150 Profile* profile, |
| 151 uint8_t server_public_key[/* 32 */], | 151 uint8_t server_public_key[/* 32 */], |
| 152 uint32_t server_public_key_version, | 152 uint32_t server_public_key_version, |
| 153 size_t max_queued_report_count, | 153 size_t max_queued_report_count, |
| 154 base::TimeDelta max_report_age, | 154 base::TimeDelta max_report_age, |
| 155 base::Clock* clock); | 155 base::Clock* clock, |
| 156 const base::Callback<void()>& reset_callback); |
| 156 | 157 |
| 157 ~CertificateReportingService() override; | 158 ~CertificateReportingService() override; |
| 158 | 159 |
| 159 // KeyedService implementation: | 160 // KeyedService implementation: |
| 160 void Shutdown() override; | 161 void Shutdown() override; |
| 161 | 162 |
| 162 // Sends a serialized report. If the report upload fails, the upload is | 163 // Sends a serialized report. If the report upload fails, the upload is |
| 163 // retried at a future time. | 164 // retried at a future time. |
| 164 void Send(const std::string& serialized_report); | 165 void Send(const std::string& serialized_report); |
| 165 | 166 |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 // Maximum number of reports to be queued for retry. | 220 // Maximum number of reports to be queued for retry. |
| 220 const size_t max_queued_report_count_; | 221 const size_t max_queued_report_count_; |
| 221 | 222 |
| 222 // Maximum age of the reports to be queued for retry, from the time the | 223 // Maximum age of the reports to be queued for retry, from the time the |
| 223 // certificate error was first encountered by the user. Any report older than | 224 // certificate error was first encountered by the user. Any report older than |
| 224 // this age is ignored and is not re-uploaded. | 225 // this age is ignored and is not re-uploaded. |
| 225 const base::TimeDelta max_report_age_; | 226 const base::TimeDelta max_report_age_; |
| 226 | 227 |
| 227 base::Clock* const clock_; | 228 base::Clock* const clock_; |
| 228 | 229 |
| 230 // Called when the service is reset. Used for testing. |
| 231 base::Callback<void()> reset_callback_; |
| 232 |
| 229 // Encryption parameters. | 233 // Encryption parameters. |
| 230 uint8_t* server_public_key_; | 234 uint8_t* server_public_key_; |
| 231 uint32_t server_public_key_version_; | 235 uint32_t server_public_key_version_; |
| 232 | 236 |
| 233 DISALLOW_COPY_AND_ASSIGN(CertificateReportingService); | 237 DISALLOW_COPY_AND_ASSIGN(CertificateReportingService); |
| 234 }; | 238 }; |
| 235 | 239 |
| 236 #endif // CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ | 240 #endif // CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ |
| OLD | NEW |