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

Unified Diff: net/url_request/certificate_report_sender.h

Issue 2026213002: Refactor CertificateReportSender (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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/net.gypi ('k') | net/url_request/certificate_report_sender.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/url_request/certificate_report_sender.h
diff --git a/net/url_request/certificate_report_sender.h b/net/url_request/certificate_report_sender.h
deleted file mode 100644
index f71fbe418f8a97eed1fa6cdeef728bc6a5d31999..0000000000000000000000000000000000000000
--- a/net/url_request/certificate_report_sender.h
+++ /dev/null
@@ -1,81 +0,0 @@
-// 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_URL_REQUEST_CERTIFICATE_REPORT_SENDER_H_
-#define NET_URL_REQUEST_CERTIFICATE_REPORT_SENDER_H_
-
-#include <memory>
-#include <set>
-#include <string>
-
-#include "base/callback.h"
-#include "base/macros.h"
-#include "net/http/transport_security_state.h"
-#include "net/url_request/url_request.h"
-
-class GURL;
-
-namespace net {
-
-class URLRequestContext;
-
-// CertificateReportSender asynchronously sends serialized certificate
-// reports to a URI. It takes serialized reports as a sequence of bytes
-// so as to be agnostic to the format of the report being sent (JSON,
-// protobuf, etc.) and the particular data that it contains. Multiple
-// reports can be in-flight at once. This class owns inflight requests
-// and cleans them up when necessary.
-class NET_EXPORT CertificateReportSender
- : public URLRequest::Delegate,
- public TransportSecurityState::ReportSender {
- public:
- using ErrorCallback = base::Callback<void(const GURL&, int)>;
-
- // Represents whether or not to send cookies along with reports.
- enum CookiesPreference { SEND_COOKIES, DO_NOT_SEND_COOKIES };
-
- // Constructs a CertificateReportSender that sends reports with the
- // given |request_context| and includes or excludes cookies based on
- // |cookies_preference|. |request_context| must outlive the
- // CertificateReportSender.
- CertificateReportSender(URLRequestContext* request_context,
- CookiesPreference cookies_preference);
-
- // Constructs a CertificateReportSender that sends reports with the
- // given |request_context| and includes or excludes cookies based on
- // |cookies_preference|. |request_context| must outlive the
- // CertificateReportSender. When sending a report results in an error,
- // |error_callback| is called with the report URI and net error as
- // arguments.
- CertificateReportSender(URLRequestContext* request_context,
- CookiesPreference cookies_preference,
- const ErrorCallback& error_callback);
-
- ~CertificateReportSender() override;
-
- // TransportSecurityState::ReportSender implementation.
- void Send(const GURL& report_uri, const std::string& report) override;
- void SetErrorCallback(const ErrorCallback& error_callback) override;
-
- // net::URLRequest::Delegate implementation.
- void OnResponseStarted(URLRequest* request) override;
- void OnReadCompleted(URLRequest* request, int bytes_read) override;
-
- private:
- net::URLRequestContext* const request_context_;
-
- CookiesPreference cookies_preference_;
-
- // Owns the contained requests.
- std::set<URLRequest*> inflight_requests_;
-
- // Called when a sent report results in an error.
- ErrorCallback error_callback_;
-
- DISALLOW_COPY_AND_ASSIGN(CertificateReportSender);
-};
-
-} // namespace net
-
-#endif // NET_URL_REQUEST_CERTIFICATE_REPORT_H_
« no previous file with comments | « net/net.gypi ('k') | net/url_request/certificate_report_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698