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

Side by Side Diff: net/http/transport_security_state.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: fix null dereference 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_H_ 5 #ifndef NET_HTTP_TRANSPORT_SECURITY_STATE_H_
6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_ 6 #define NET_HTTP_TRANSPORT_SECURITY_STATE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
11 #include <string> 11 #include <string>
12 #include <utility> 12 #include <utility>
13 #include <vector> 13 #include <vector>
14 14
15 #include "base/callback.h"
15 #include "base/gtest_prod_util.h" 16 #include "base/gtest_prod_util.h"
16 #include "base/macros.h" 17 #include "base/macros.h"
17 #include "base/threading/non_thread_safe.h" 18 #include "base/threading/non_thread_safe.h"
18 #include "base/time/time.h" 19 #include "base/time/time.h"
19 #include "net/base/expiring_cache.h" 20 #include "net/base/expiring_cache.h"
20 #include "net/base/net_export.h" 21 #include "net/base/net_export.h"
21 #include "net/cert/x509_cert_types.h" 22 #include "net/cert/x509_cert_types.h"
22 #include "net/cert/x509_certificate.h" 23 #include "net/cert/x509_certificate.h"
23 #include "url/gurl.h" 24 #include "url/gurl.h"
24 25
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 // provided. 197 // provided.
197 GURL report_uri; 198 GURL report_uri;
198 }; 199 };
199 200
200 // An interface for asynchronously sending HPKP violation reports. 201 // An interface for asynchronously sending HPKP violation reports.
201 class NET_EXPORT ReportSender { 202 class NET_EXPORT ReportSender {
202 public: 203 public:
203 // Sends the given serialized |report| to |report_uri|. 204 // Sends the given serialized |report| to |report_uri|.
204 virtual void Send(const GURL& report_uri, const std::string& report) = 0; 205 virtual void Send(const GURL& report_uri, const std::string& report) = 0;
205 206
207 // Sets a callback to be called when report sending fails.
208 virtual void SetErrorCallback(
209 const base::Callback<void(GURL, int)>& error_callback) = 0;
eroman 2016/04/02 01:55:25 why not a const GURL?
estark 2016/04/05 00:57:29 Done.
210
206 protected: 211 protected:
207 virtual ~ReportSender() {} 212 virtual ~ReportSender() {}
208 }; 213 };
209 214
210 // An interface for building and asynchronously sending reports when a 215 // An interface for building and asynchronously sending reports when a
211 // site expects valid Certificate Transparency information but it 216 // site expects valid Certificate Transparency information but it
212 // wasn't supplied. 217 // wasn't supplied.
213 class NET_EXPORT ExpectCTReporter { 218 class NET_EXPORT ExpectCTReporter {
214 public: 219 public:
215 // Called when the host in |host_port_pair| has opted in to have 220 // Called when the host in |host_port_pair| has opted in to have
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 // rate-limiting. 474 // rate-limiting.
470 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> 475 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>>
471 sent_reports_cache_; 476 sent_reports_cache_;
472 477
473 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); 478 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState);
474 }; 479 };
475 480
476 } // namespace net 481 } // namespace net
477 482
478 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ 483 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/transport_security_state.cc » ('j') | net/url_request/certificate_report_sender.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698