| 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 15 matching lines...) Expand all Loading... |
| 26 virtual void ProbeComplete(bool result) = 0; | 26 virtual void ProbeComplete(bool result) = 0; |
| 27 protected: | 27 protected: |
| 28 virtual ~HTTPSProberDelegate() {} | 28 virtual ~HTTPSProberDelegate() {} |
| 29 }; | 29 }; |
| 30 | 30 |
| 31 // HTTPSProber is a singleton object that manages HTTPS probes. A HTTPS probe | 31 // HTTPSProber is a singleton object that manages HTTPS probes. A HTTPS probe |
| 32 // determines if we can connect to a given host over HTTPS. It's used when | 32 // determines if we can connect to a given host over HTTPS. It's used when |
| 33 // transparently upgrading from HTTP to HTTPS (for example, for SPDY). | 33 // transparently upgrading from HTTP to HTTPS (for example, for SPDY). |
| 34 class HTTPSProber : public URLRequest::Delegate { | 34 class HTTPSProber : public URLRequest::Delegate { |
| 35 public: | 35 public: |
| 36 HTTPSProber() {} | 36 HTTPSProber(); |
| 37 ~HTTPSProber(); |
| 37 | 38 |
| 38 // HaveProbed returns true if the given host is known to have been probed | 39 // HaveProbed returns true if the given host is known to have been probed |
| 39 // since the browser was last started. | 40 // since the browser was last started. |
| 40 bool HaveProbed(const std::string& host) const; | 41 bool HaveProbed(const std::string& host) const; |
| 41 | 42 |
| 42 // InFlight returns true iff a probe for the given host is currently active. | 43 // InFlight returns true iff a probe for the given host is currently active. |
| 43 bool InFlight(const std::string& host) const; | 44 bool InFlight(const std::string& host) const; |
| 44 | 45 |
| 45 // 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 |
| 46 // 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 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 67 | 68 |
| 68 std::map<std::string, HTTPSProberDelegate*> inflight_probes_; | 69 std::map<std::string, HTTPSProberDelegate*> inflight_probes_; |
| 69 std::set<std::string> probed_; | 70 std::set<std::string> probed_; |
| 70 | 71 |
| 71 friend struct DefaultSingletonTraits<HTTPSProber>; | 72 friend struct DefaultSingletonTraits<HTTPSProber>; |
| 72 DISALLOW_COPY_AND_ASSIGN(HTTPSProber); | 73 DISALLOW_COPY_AND_ASSIGN(HTTPSProber); |
| 73 }; | 74 }; |
| 74 | 75 |
| 75 } // namespace net | 76 } // namespace net |
| 76 #endif | 77 #endif |
| OLD | NEW |