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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 // provided in the constructor. Failed reports will be added to the retry | 119 // provided in the constructor. Failed reports will be added to the retry |
120 // list. | 120 // list. |
121 void SendPending(); | 121 void SendPending(); |
122 | 122 |
123 // Getter and setters for testing: | 123 // Getter and setters for testing: |
124 size_t inflight_report_count_for_testing() const; | 124 size_t inflight_report_count_for_testing() const; |
125 BoundedReportList* GetQueueForTesting() const; | 125 BoundedReportList* GetQueueForTesting() const; |
126 | 126 |
127 private: | 127 private: |
128 void SendInternal(const Report& report); | 128 void SendInternal(const Report& report); |
129 void ErrorCallback(int report_id, const GURL& url, int error); | 129 // Called when a report upload fails either because of a net error or a |
| 130 // non-HTTP 200 response code. See |
| 131 // TransportSecurityState::ReportSenderInterface for parameters. |
| 132 void ErrorCallback(int report_id, |
| 133 const GURL& url, |
| 134 int net_error, |
| 135 int http_response_code); |
| 136 // Called when a report upload is successful. |
130 void SuccessCallback(int report_id); | 137 void SuccessCallback(int report_id); |
131 | 138 |
132 std::unique_ptr<certificate_reporting::ErrorReporter> error_reporter_; | 139 std::unique_ptr<certificate_reporting::ErrorReporter> error_reporter_; |
133 std::unique_ptr<BoundedReportList> retry_list_; | 140 std::unique_ptr<BoundedReportList> retry_list_; |
134 base::Clock* const clock_; | 141 base::Clock* const clock_; |
135 // Maximum age of a queued report. Reports older than this are discarded in | 142 // Maximum age of a queued report. Reports older than this are discarded in |
136 // the next SendPending() call. | 143 // the next SendPending() call. |
137 const base::TimeDelta report_ttl_; | 144 const base::TimeDelta report_ttl_; |
138 const bool retries_enabled_; | 145 const bool retries_enabled_; |
139 // Current report id, starting from zero and monotonically incrementing. | 146 // Current report id, starting from zero and monotonically incrementing. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 base::Callback<void()> reset_callback_; | 240 base::Callback<void()> reset_callback_; |
234 | 241 |
235 // Encryption parameters. | 242 // Encryption parameters. |
236 uint8_t* server_public_key_; | 243 uint8_t* server_public_key_; |
237 uint32_t server_public_key_version_; | 244 uint32_t server_public_key_version_; |
238 | 245 |
239 DISALLOW_COPY_AND_ASSIGN(CertificateReportingService); | 246 DISALLOW_COPY_AND_ASSIGN(CertificateReportingService); |
240 }; | 247 }; |
241 | 248 |
242 #endif // CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ | 249 #endif // CHROME_BROWSER_SAFE_BROWSING_CERTIFICATE_REPORTING_SERVICE_H_ |
OLD | NEW |