Index: net/http/transport_security_reporter.h |
diff --git a/net/http/transport_security_reporter.h b/net/http/transport_security_reporter.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..28bcf57e8894d2cbb0330acae637e1695243c34d |
--- /dev/null |
+++ b/net/http/transport_security_reporter.h |
@@ -0,0 +1,48 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef NET_HTTP_TRANSPORT_SECURITY_REPORTER_H_ |
+#define NET_HTTP_TRANSPORT_SECURITY_REPORTER_H_ |
+ |
+#include <string> |
+ |
+#include "net/http/certificate_report_sender_impl.h" |
+#include "net/http/transport_security_state.h" |
+ |
+class GURL; |
+ |
+namespace net { |
+ |
+class SSLInfo; |
+class URLRequestContext; |
+ |
+// Builds, serializes, and sends violation reports detected by |
+// TransportSecurityState. |
+class NET_EXPORT TransportSecurityReporter |
+ : public TransportSecurityState::Reporter { |
+ public: |
+ TransportSecurityReporter(TransportSecurityState* state, |
+ scoped_ptr<CertificateReportSender> report_sender); |
+ ~TransportSecurityReporter() override; |
+ |
+ // TransportSecurityState::Reporter overrides |
+ bool GetHPKPReport(const std::string& hostname, |
+ const TransportSecurityState::PKPState& pkp_state, |
+ bool is_static_pin, |
+ uint16_t port, |
+ const X509Certificate* served_certificate_chain, |
+ const X509Certificate* validated_certificate_chain, |
+ GURL* report_uri, |
+ std::string* serialized_report) override; |
+ void SendHPKPReport(const GURL& report_uri, |
+ const std::string& report) override; |
+ |
+ private: |
+ TransportSecurityState* transport_security_state_; |
+ scoped_ptr<CertificateReportSender> report_sender_; |
+}; |
+ |
+} // namespace net |
+ |
+#endif // NET_HTTP_TRANSPORT_SECURITY_REPORTER_H_ |