Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_SSL_CERTIFICATE_ERROR_REPORT_H_ | |
| 6 #define CHROME_BROWSER_SSL_CERTIFICATE_ERROR_REPORT_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "chrome/browser/ssl/cert_logger.pb.h" | |
|
Ryan Sleevi
2015/05/13 01:02:12
In general, including .pb.h in header files is a r
estark
2015/05/13 01:44:49
Good to know; I changed it to be a pointer member.
| |
| 11 | |
| 12 namespace net { | |
| 13 class SSLInfo; | |
| 14 }; // namespace net | |
|
Ryan Sleevi
2015/05/13 01:02:12
no ;
estark
2015/05/13 01:44:49
Done.
| |
| 15 | |
| 16 namespace chrome_browser_ssl { | |
| 17 | |
| 18 class CertLoggerRequest; | |
|
Ryan Sleevi
2015/05/13 01:02:12
You can't forward declare this, because line 50 ne
estark
2015/05/13 01:44:49
Changed line 50 to be a scoped_ptr
| |
| 19 | |
| 20 // This class builds and serializes reports for invalid SSL certificate | |
| 21 // chains, intended to be sent with | |
| 22 // chrome_browser_net::CertificateErrorReporter. | |
| 23 class CertificateErrorReport { | |
| 24 public: | |
| 25 // Constructs an empty report. | |
| 26 CertificateErrorReport(); | |
| 27 | |
| 28 // Constructs a report for the given |hostname| using the SSL | |
| 29 // properties in |ssl_info|. | |
| 30 CertificateErrorReport(const std::string& hostname, | |
| 31 const net::SSLInfo& ssl_info); | |
| 32 | |
| 33 ~CertificateErrorReport(); | |
| 34 | |
| 35 // Initializes an empty report by parsing the given serialized | |
| 36 // report. |serialized_report| should be a serialized | |
| 37 // CertLoggerRequest protobuf. Returns true if the report could be | |
| 38 // successfully parsed and false otherwise. | |
| 39 bool InitializeFromString(const std::string& serialized_report); | |
| 40 | |
| 41 // Serializes the report. The output will be a serialized | |
| 42 // CertLoggerRequest protobuf. Returns true if the serialization was | |
| 43 // successful and false otherwise. | |
| 44 bool Serialize(std::string* output) const; | |
| 45 | |
| 46 // Gets the hostname to which this report corresponds. | |
| 47 const std::string& hostname() const; | |
| 48 | |
| 49 private: | |
| 50 CertLoggerRequest cert_report_; | |
| 51 }; | |
| 52 | |
| 53 } // namespace chrome_browser_ssl | |
| 54 | |
| 55 #endif // CHROME_BROWSER_SSL_CERTIFICATE_ERROR_REPORT_H_ | |
| OLD | NEW |