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

Unified Diff: net/http/certificate_report_sender_impl.h

Issue 1211933005: Initial (partial) implementation of HPKP violation reporting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: style fixes, comments Created 5 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/certificate_report_sender.h ('k') | net/http/certificate_report_sender_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/certificate_report_sender_impl.h
diff --git a/net/http/certificate_report_sender_impl.h b/net/http/certificate_report_sender_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..8a4e9b73a33ade3ba328c6c91cab864bb7da2503
--- /dev/null
+++ b/net/http/certificate_report_sender_impl.h
@@ -0,0 +1,57 @@
+// 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_CERTIFICATE_REPORT_SENDER_IMPL_H_
+#define NET_HTTP_CERTIFICATE_REPORT_SENDER_IMPL_H_
+
+#include <set>
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "net/http/certificate_report_sender.h"
+#include "net/url_request/url_request.h"
+
+class GURL;
+
+namespace net {
+
+class URLRequestContext;
+
+class NET_EXPORT CertificateReportSenderImpl : public URLRequest::Delegate,
+ public CertificateReportSender {
+ public:
+ CertificateReportSenderImpl(URLRequestContext* request_context,
+ CookiesPreference cookies_preference);
+ ~CertificateReportSenderImpl() override;
+
+ // CertificateReportSender overrides
+ void Send(const GURL& report_uri, const std::string& report) override;
+
+ // net::URLRequest::Delegate
+ void OnResponseStarted(URLRequest* request) override;
+ void OnReadCompleted(URLRequest* request, int bytes_read) override;
+
+ private:
+ // Creates a URLRequest with which to send a certificate report to the
+ // server.
+ virtual scoped_ptr<URLRequest> CreateURLRequest(
+ net::URLRequestContext* context,
+ const GURL& report_uri);
+
+ // Performs post-report cleanup.
+ void RequestComplete(net::URLRequest* request);
+
+ net::URLRequestContext* const request_context_;
+
+ CookiesPreference cookies_preference_;
+
+ // Owns the contained requests.
+ std::set<URLRequest*> inflight_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(CertificateReportSenderImpl);
+};
+
+} // namespace net
+
+#endif // NET_HTTP_CERTIFICATE_REPORT_SENDER_H_
« no previous file with comments | « net/http/certificate_report_sender.h ('k') | net/http/certificate_report_sender_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698