Chromium Code Reviews| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 | 11 |
| 12 #include "net/url_request/fraudulent_certificate_reporter.h" | 12 #include "net/url_request/fraudulent_certificate_reporter.h" |
| 13 #include "net/url_request/url_request.h" | 13 #include "net/url_request/url_request.h" |
| 14 | 14 |
|
erikwright (departed)
2012/06/19 21:06:22
forward decl net::URLRequestContext.
shalev
2012/06/20 20:13:12
Done.
| |
| 15 namespace chrome_browser_net { | 15 namespace chrome_browser_net { |
| 16 | 16 |
| 17 class ChromeFraudulentCertificateReporter | 17 class ChromeFraudulentCertificateReporter |
| 18 : public net::FraudulentCertificateReporter, | 18 : public net::FraudulentCertificateReporter, |
| 19 public net::URLRequest::Delegate { | 19 public net::URLRequest::Delegate { |
| 20 public: | 20 public: |
| 21 explicit ChromeFraudulentCertificateReporter( | 21 explicit ChromeFraudulentCertificateReporter( |
| 22 net::URLRequestContext* request_context); | 22 net::URLRequestContext* request_context); |
| 23 | 23 |
| 24 virtual ~ChromeFraudulentCertificateReporter(); | 24 virtual ~ChromeFraudulentCertificateReporter(); |
| 25 | 25 |
| 26 // Allows users of this class to override this and set their own URLRequest | 26 // Allows users of this class to override this and set their own URLRequest |
| 27 // type. Used by SendReport. | 27 // type. Used by SendReport. |
| 28 virtual net::URLRequest* CreateURLRequest(); | 28 virtual net::URLRequest* CreateURLRequest(net::URLRequestContext* context); |
| 29 | 29 |
| 30 // net::FraudulentCertificateReporter | 30 // net::FraudulentCertificateReporter |
| 31 virtual void SendReport(const std::string& hostname, | 31 virtual void SendReport(const std::string& hostname, |
| 32 const net::SSLInfo& ssl_info, | 32 const net::SSLInfo& ssl_info, |
| 33 bool sni_available) OVERRIDE; | 33 bool sni_available) OVERRIDE; |
| 34 | 34 |
| 35 // net::URLRequest::Delegate | 35 // net::URLRequest::Delegate |
| 36 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; | 36 virtual void OnResponseStarted(net::URLRequest* request) OVERRIDE; |
| 37 virtual void OnReadCompleted(net::URLRequest* request, | 37 virtual void OnReadCompleted(net::URLRequest* request, |
| 38 int bytes_read) OVERRIDE; | 38 int bytes_read) OVERRIDE; |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 net::URLRequestContext* const request_context_; | 41 net::URLRequestContext* const request_context_; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // Performs post-report cleanup. | 44 // Performs post-report cleanup. |
| 45 void RequestComplete(net::URLRequest* request); | 45 void RequestComplete(net::URLRequest* request); |
| 46 | 46 |
| 47 const GURL upload_url_; | 47 const GURL upload_url_; |
| 48 std::set<net::URLRequest*> inflight_requests_; | 48 std::set<net::URLRequest*> inflight_requests_; |
| 49 | 49 |
| 50 DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter); | 50 DISALLOW_COPY_AND_ASSIGN(ChromeFraudulentCertificateReporter); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 } // namespace chrome_browser_net | 53 } // namespace chrome_browser_net |
| 54 | 54 |
| 55 #endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ | 55 #endif // CHROME_BROWSER_NET_CHROME_FRAUDULENT_CERTIFICATE_REPORTER_H_ |
| 56 | 56 |
| OLD | NEW |