OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ | 5 #ifndef COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ |
6 #define COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ | 6 #define COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 // | 53 // |
54 // |SendReport| actually sends the report over the network; callers are | 54 // |SendReport| actually sends the report over the network; callers are |
55 // responsible for enforcing any preconditions (such as obtaining user | 55 // responsible for enforcing any preconditions (such as obtaining user |
56 // opt-in, only sending reports for certain hostnames, checking for | 56 // opt-in, only sending reports for certain hostnames, checking for |
57 // incognito mode, etc.). | 57 // incognito mode, etc.). |
58 // | 58 // |
59 // On some platforms (but not all), ErrorReporter can use | 59 // On some platforms (but not all), ErrorReporter can use |
60 // an HTTP endpoint to send encrypted extended reporting reports. On | 60 // an HTTP endpoint to send encrypted extended reporting reports. On |
61 // unsupported platforms, callers must send extended reporting reports | 61 // unsupported platforms, callers must send extended reporting reports |
62 // over SSL. | 62 // over SSL. |
63 virtual void SendExtendedReportingReport( | 63 virtual void SendExtendedReportingReport( |
estark
2017/04/27 00:35:57
nit: can you document what the |error_callback| ar
meacer
2017/04/27 00:56:42
Done.
| |
64 const std::string& serialized_report, | 64 const std::string& serialized_report, |
65 const base::Callback<void()>& success_callback, | 65 const base::Callback<void()>& success_callback, |
66 const base::Callback<void(const GURL&, int)>& error_callback); | 66 const base::Callback<void(const GURL&, int, int)>& error_callback); |
67 | 67 |
68 // Used by tests. | 68 // Used by tests. |
69 static bool DecryptErrorReport( | 69 static bool DecryptErrorReport( |
70 const uint8_t server_private_key[32], | 70 const uint8_t server_private_key[32], |
71 const EncryptedCertLoggerRequest& encrypted_report, | 71 const EncryptedCertLoggerRequest& encrypted_report, |
72 std::string* decrypted_serialized_report); | 72 std::string* decrypted_serialized_report); |
73 | 73 |
74 void set_upload_url_for_testing(const GURL& url) { upload_url_ = url; } | 74 void set_upload_url_for_testing(const GURL& url) { upload_url_ = url; } |
75 | 75 |
76 private: | 76 private: |
77 std::unique_ptr<net::ReportSender> certificate_report_sender_; | 77 std::unique_ptr<net::ReportSender> certificate_report_sender_; |
78 | 78 |
79 GURL upload_url_; | 79 GURL upload_url_; |
80 | 80 |
81 const uint8_t* server_public_key_; | 81 const uint8_t* server_public_key_; |
82 const uint32_t server_public_key_version_; | 82 const uint32_t server_public_key_version_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(ErrorReporter); | 84 DISALLOW_COPY_AND_ASSIGN(ErrorReporter); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace certificate_reporting | 87 } // namespace certificate_reporting |
88 | 88 |
89 #endif // COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ | 89 #endif // COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ |
OLD | NEW |