OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ | 5 #ifndef CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ |
6 #define CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ | 6 #define CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 public net::URLRequest::Delegate { | 22 public net::URLRequest::Delegate { |
23 public: | 23 public: |
24 explicit ChromeFraudulentCertificateReporter( | 24 explicit ChromeFraudulentCertificateReporter( |
25 net::URLRequestContext* request_context); | 25 net::URLRequestContext* request_context); |
26 | 26 |
27 ~ChromeFraudulentCertificateReporter() override; | 27 ~ChromeFraudulentCertificateReporter() override; |
28 | 28 |
29 // Allows users of this class to override this and set their own URLRequest | 29 // Allows users of this class to override this and set their own URLRequest |
30 // type. Used by SendReport. | 30 // type. Used by SendReport. |
31 virtual scoped_ptr<net::URLRequest> CreateURLRequest( | 31 virtual scoped_ptr<net::URLRequest> CreateURLRequest( |
32 net::URLRequestContext* context); | 32 net::URLRequestContext* context, |
| 33 const GURL& upload_url); |
33 | 34 |
34 // net::FraudulentCertificateReporter | 35 // net::FraudulentCertificateReporter |
35 void SendReport(const std::string& hostname, | 36 void SendReport(ReportType type, |
| 37 const std::string& hostname, |
36 const net::SSLInfo& ssl_info) override; | 38 const net::SSLInfo& ssl_info) override; |
37 | 39 |
38 // net::URLRequest::Delegate | 40 // net::URLRequest::Delegate |
39 void OnResponseStarted(net::URLRequest* request) override; | 41 void OnResponseStarted(net::URLRequest* request) override; |
40 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; | 42 void OnReadCompleted(net::URLRequest* request, int bytes_read) override; |
41 | 43 |
42 protected: | 44 protected: |
43 net::URLRequestContext* const request_context_; | 45 net::URLRequestContext* const request_context_; |
| 46 const GURL pinning_violation_upload_url_; |
| 47 const GURL invalid_chain_upload_url_; |
44 | 48 |
45 private: | 49 private: |
46 // Performs post-report cleanup. | 50 // Performs post-report cleanup. |
47 void RequestComplete(net::URLRequest* request); | 51 void RequestComplete(net::URLRequest* request); |
48 | 52 |
49 const GURL upload_url_; | |
50 // Owns the contained requests. | 53 // Owns the contained requests. |
51 std::set<net::URLRequest*> inflight_requests_; | 54 std::set<net::URLRequest*> inflight_requests_; |
52 | 55 |
53 DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter); | 56 DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter); |
54 }; | 57 }; |
55 | 58 |
56 } // namespace chrome_browser_net | 59 } // namespace chrome_browser_net |
57 | 60 |
58 #endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ | 61 #endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ |
59 | |
OLD | NEW |