OLD | NEW |
---|---|
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> |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 // The URI reports are sent to if a valid OCSP response is not stapled | 245 // The URI reports are sent to if a valid OCSP response is not stapled |
246 GURL report_uri; | 246 GURL report_uri; |
247 | 247 |
248 // True if subdomains are subject to this policy | 248 // True if subdomains are subject to this policy |
249 bool include_subdomains; | 249 bool include_subdomains; |
250 }; | 250 }; |
251 | 251 |
252 // An interface for asynchronously sending HPKP violation reports. | 252 // An interface for asynchronously sending HPKP violation reports. |
253 class NET_EXPORT ReportSenderInterface { | 253 class NET_EXPORT ReportSenderInterface { |
254 public: | 254 public: |
255 // Sends the given serialized |report| to |report_uri|. | 255 // Sends the given serialized |report| to |report_uri| with Content-Type |
256 virtual void Send(const GURL& report_uri, const std::string& report) = 0; | 256 // header as specified in |content_type|. |
eroman
2016/09/26 21:14:07
Can you add a note that content-type should be non
estark
2016/09/26 23:26:10
Done.
| |
257 virtual void Send(const GURL& report_uri, | |
258 const std::string& content_type, | |
eroman
2016/09/26 21:14:07
What about base::StringPiece for these parameters?
estark
2016/09/26 23:26:10
Done.
| |
259 const std::string& report) = 0; | |
257 | 260 |
258 // Sets a callback to be called when report sending fails. | 261 // Sets a callback to be called when report sending fails. |
259 virtual void SetErrorCallback( | 262 virtual void SetErrorCallback( |
260 const base::Callback<void(const GURL&, int)>& error_callback) = 0; | 263 const base::Callback<void(const GURL&, int)>& error_callback) = 0; |
261 | 264 |
262 protected: | 265 protected: |
263 virtual ~ReportSenderInterface() {} | 266 virtual ~ReportSenderInterface() {} |
264 }; | 267 }; |
265 | 268 |
266 // An interface for building and asynchronously sending reports when a | 269 // An interface for building and asynchronously sending reports when a |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
589 // rate-limiting. | 592 // rate-limiting. |
590 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> | 593 ExpiringCache<std::string, bool, base::TimeTicks, std::less<base::TimeTicks>> |
591 sent_reports_cache_; | 594 sent_reports_cache_; |
592 | 595 |
593 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); | 596 DISALLOW_COPY_AND_ASSIGN(TransportSecurityState); |
594 }; | 597 }; |
595 | 598 |
596 } // namespace net | 599 } // namespace net |
597 | 600 |
598 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ | 601 #endif // NET_HTTP_TRANSPORT_SECURITY_STATE_H_ |
OLD | NEW |