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 "base/memory/scoped_ptr.h" | |
11 | |
12 namespace net { | |
13 class SSLInfo; | |
14 } // namespace net | |
15 | |
16 class CertLoggerRequest; | |
17 | |
18 // This class builds and serializes reports for invalid SSL certificate | |
19 // chains, intended to be sent with | |
20 // chrome_browser_net::CertificateErrorReporter. | |
mmenke
2015/05/13 20:40:26
nit: --chrome_browser_net::
estark
2015/05/13 20:42:13
How come? CertificateErrorReporter is still define
mmenke
2015/05/13 20:44:22
Oops...sorry, got "CertificateErrorReporter" and "
| |
21 class CertificateErrorReport { | |
22 public: | |
23 // Constructs an empty report. | |
24 CertificateErrorReport(); | |
25 | |
26 // Constructs a report for the given |hostname| using the SSL | |
27 // properties in |ssl_info|. | |
28 CertificateErrorReport(const std::string& hostname, | |
29 const net::SSLInfo& ssl_info); | |
30 | |
31 ~CertificateErrorReport(); | |
32 | |
33 // Initializes an empty report by parsing the given serialized | |
34 // report. |serialized_report| should be a serialized | |
35 // CertLoggerRequest protobuf. Returns true if the report could be | |
36 // successfully parsed and false otherwise. | |
37 bool InitializeFromString(const std::string& serialized_report); | |
38 | |
39 // Serializes the report. The output will be a serialized | |
40 // CertLoggerRequest protobuf. Returns true if the serialization was | |
41 // successful and false otherwise. | |
42 bool Serialize(std::string* output) const; | |
43 | |
44 // Gets the hostname to which this report corresponds. | |
45 const std::string& hostname() const; | |
46 | |
47 private: | |
48 scoped_ptr<CertLoggerRequest> cert_report_; | |
49 }; | |
50 | |
51 #endif // CHROME_BROWSER_SSL_CERTIFICATE_ERROR_REPORT_H_ | |
OLD | NEW |