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 14 matching lines...) Expand all Loading... |
25 net::URLRequestContext* request_context); | 25 net::URLRequestContext* request_context); |
26 | 26 |
27 virtual ~ChromeFraudulentCertificateReporter(); | 27 virtual ~ChromeFraudulentCertificateReporter(); |
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 net::URLRequest* CreateURLRequest(net::URLRequestContext* context); | 31 virtual net::URLRequest* CreateURLRequest(net::URLRequestContext* context); |
32 | 32 |
33 // net::FraudulentCertificateReporter | 33 // net::FraudulentCertificateReporter |
34 virtual void SendReport(const std::string& hostname, | 34 virtual void SendReport(const std::string& hostname, |
35 const net::SSLInfo& ssl_info, | 35 const net::SSLInfo& ssl_info) OVERRIDE; |
36 bool sni_available) OVERRIDE; | |
37 | 36 |
38 // net::URLRequest::Delegate | 37 // net::URLRequest::Delegate |
39 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 38 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
40 virtual void OnReadCompleted(net::URLRequest* request, | 39 virtual void OnReadCompleted(net::URLRequest* request, |
41 int bytes_read) OVERRIDE; | 40 int bytes_read) OVERRIDE; |
42 | 41 |
43 protected: | 42 protected: |
44 net::URLRequestContext* const request_context_; | 43 net::URLRequestContext* const request_context_; |
45 | 44 |
46 private: | 45 private: |
47 // Performs post-report cleanup. | 46 // Performs post-report cleanup. |
48 void RequestComplete(net::URLRequest* request); | 47 void RequestComplete(net::URLRequest* request); |
49 | 48 |
50 const GURL upload_url_; | 49 const GURL upload_url_; |
51 std::set<net::URLRequest*> inflight_requests_; | 50 std::set<net::URLRequest*> inflight_requests_; |
52 | 51 |
53 DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter); | 52 DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter); |
54 }; | 53 }; |
55 | 54 |
56 } // namespace chrome_browser_net | 55 } // namespace chrome_browser_net |
57 | 56 |
58 #endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ | 57 #endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ |
59 | 58 |
OLD | NEW |