Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1039)

Side by Side Diff: components/certificate_reporting/error_reporter.h

Issue 2483993002: Add report_id to ErrorReporter interface. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 //
64 const std::string& serialized_report); 64 // |report_id| is passed back to error and success callbacks. Clients not
65 // using it can set it to any value.
66 virtual void SendExtendedReportingReport(const std::string& serialized_report,
67 int report_id);
65 68
66 // Used by tests. 69 // Used by tests.
67 static bool DecryptErrorReport( 70 static bool DecryptErrorReport(
68 const uint8_t server_private_key[32], 71 const uint8_t server_private_key[32],
69 const EncryptedCertLoggerRequest& encrypted_report, 72 const EncryptedCertLoggerRequest& encrypted_report,
70 std::string* decrypted_serialized_report); 73 std::string* decrypted_serialized_report);
71 74
75 void SetErrorCallback(
76 const base::Callback<void(const GURL&, int, int)>& callback);
77 void SetSuccessCallback(const base::Callback<void(int)>& callback);
estark 2016/11/11 01:15:49 nit: blank line before
meacer 2016/11/11 19:59:29 Done.
78
79 void set_upload_url_for_testing(const GURL& url) { upload_url_ = url; }
80
72 private: 81 private:
73 std::unique_ptr<net::ReportSender> certificate_report_sender_; 82 std::unique_ptr<net::ReportSender> certificate_report_sender_;
74 83
75 const GURL upload_url_; 84 GURL upload_url_;
76 85
77 const uint8_t* server_public_key_; 86 const uint8_t* server_public_key_;
78 const uint32_t server_public_key_version_; 87 const uint32_t server_public_key_version_;
79 88
80 DISALLOW_COPY_AND_ASSIGN(ErrorReporter); 89 DISALLOW_COPY_AND_ASSIGN(ErrorReporter);
81 }; 90 };
82 91
83 } // namespace certificate_reporting 92 } // namespace certificate_reporting
84 93
85 #endif // COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_ 94 #endif // COMPONENTS_CERTIFICATE_REPORTING_CERTIFICATE_ERROR_REPORTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698