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

Unified Diff: net/url_request/certificate_report_sender.h

Issue 1850853004: Use CertificateReportSender error callback to record HPKP UMA metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: eroman comments Created 4 years, 8 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/transport_security_state_unittest.cc ('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
index f77d38e54cfc00f629178c7c5595f92a1ed92eaa..a5b686c048722a828d8cc164eaa7f2b226e53179 100644
--- a/net/url_request/certificate_report_sender.h
+++ b/net/url_request/certificate_report_sender.h
@@ -30,6 +30,8 @@ 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 };
@@ -44,17 +46,17 @@ class NET_EXPORT CertificateReportSender
// 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 a pointer to the URLRequest as an
- // argument.
- CertificateReportSender(
- URLRequestContext* request_context,
- CookiesPreference cookies_preference,
- const base::Callback<void(URLRequest*)>& error_callback);
+ // |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;
@@ -69,7 +71,7 @@ class NET_EXPORT CertificateReportSender
std::set<URLRequest*> inflight_requests_;
// Called when a sent report results in an error.
- base::Callback<void(URLRequest* request)> error_callback_;
+ ErrorCallback error_callback_;
DISALLOW_COPY_AND_ASSIGN(CertificateReportSender);
};
« no previous file with comments | « net/http/transport_security_state_unittest.cc ('k') | net/url_request/certificate_report_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698