| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BASE_HTTPS_PROBER_H_ | 5 #ifndef NET_BASE_HTTPS_PROBER_H_ |
| 6 #define NET_BASE_HTTPS_PROBER_H_ | 6 #define NET_BASE_HTTPS_PROBER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // ProbeHost starts a new probe for the given host. If the host is known to | 46 // ProbeHost starts a new probe for the given host. If the host is known to |
| 47 // have been probed since the browser was started, false is returned and no | 47 // have been probed since the browser was started, false is returned and no |
| 48 // other action is taken. If a probe to the given host in currently inflight, | 48 // other action is taken. If a probe to the given host in currently inflight, |
| 49 // false will be returned, and no other action is taken. Otherwise, a new | 49 // false will be returned, and no other action is taken. Otherwise, a new |
| 50 // probe is started, true is returned and the Delegate will be called with the | 50 // probe is started, true is returned and the Delegate will be called with the |
| 51 // results (true means a successful handshake). | 51 // results (true means a successful handshake). |
| 52 bool ProbeHost(const std::string& host, URLRequestContext* ctx, | 52 bool ProbeHost(const std::string& host, URLRequestContext* ctx, |
| 53 HTTPSProberDelegate* delegate); | 53 HTTPSProberDelegate* delegate); |
| 54 | 54 |
| 55 // Implementation of net::URLRequest::Delegate | 55 // Implementation of net::URLRequest::Delegate |
| 56 void OnAuthRequired(net::URLRequest* request, | 56 virtual void OnAuthRequired(net::URLRequest* request, |
| 57 net::AuthChallengeInfo* auth_info); | 57 net::AuthChallengeInfo* auth_info); |
| 58 void OnSSLCertificateError(net::URLRequest* request, | 58 virtual void OnSSLCertificateError(net::URLRequest* request, |
| 59 int cert_error, | 59 int cert_error, |
| 60 net::X509Certificate* cert); | 60 net::X509Certificate* cert); |
| 61 void OnResponseStarted(net::URLRequest* request); | 61 virtual void OnResponseStarted(net::URLRequest* request); |
| 62 void OnReadCompleted(net::URLRequest* request, int bytes_read); | 62 virtual void OnReadCompleted(net::URLRequest* request, int bytes_read); |
| 63 | 63 |
| 64 private: | 64 private: |
| 65 void Success(net::URLRequest* request); | 65 void Success(net::URLRequest* request); |
| 66 void Failure(net::URLRequest* request); | 66 void Failure(net::URLRequest* request); |
| 67 void DoCallback(net::URLRequest* request, bool result); | 67 void DoCallback(net::URLRequest* request, bool result); |
| 68 | 68 |
| 69 std::map<std::string, HTTPSProberDelegate*> inflight_probes_; | 69 std::map<std::string, HTTPSProberDelegate*> inflight_probes_; |
| 70 std::set<std::string> probed_; | 70 std::set<std::string> probed_; |
| 71 | 71 |
| 72 friend struct DefaultSingletonTraits<HTTPSProber>; | 72 friend struct DefaultSingletonTraits<HTTPSProber>; |
| 73 DISALLOW_COPY_AND_ASSIGN(HTTPSProber); | 73 DISALLOW_COPY_AND_ASSIGN(HTTPSProber); |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 } // namespace net | 76 } // namespace net |
| 77 #endif | 77 #endif |
| OLD | NEW |