| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "base/singleton.h" |
| 5 #include "net/url_request/https_prober.h" | 6 #include "net/url_request/https_prober.h" |
| 6 | 7 |
| 7 #include "net/url_request/url_request.h" | 8 #include "net/url_request/url_request.h" |
| 8 #include "net/url_request/url_request_context.h" | 9 #include "net/url_request/url_request_context.h" |
| 9 | 10 |
| 10 namespace net { | 11 namespace net { |
| 11 | 12 |
| 12 HTTPSProber::HTTPSProber() { | 13 HTTPSProber::HTTPSProber() { |
| 13 } | 14 } |
| 14 | 15 |
| 15 HTTPSProber::~HTTPSProber() { | 16 HTTPSProber::~HTTPSProber() { |
| 16 } | 17 } |
| 17 | 18 |
| 19 // static |
| 20 HTTPSProber* HTTPSProber::GetInstance() { |
| 21 return Singleton<HTTPSProber>::get(); |
| 22 } |
| 23 |
| 18 bool HTTPSProber::HaveProbed(const std::string& host) const { | 24 bool HTTPSProber::HaveProbed(const std::string& host) const { |
| 19 return probed_.find(host) != probed_.end(); | 25 return probed_.find(host) != probed_.end(); |
| 20 } | 26 } |
| 21 | 27 |
| 22 bool HTTPSProber::InFlight(const std::string& host) const { | 28 bool HTTPSProber::InFlight(const std::string& host) const { |
| 23 return inflight_probes_.find(host) != inflight_probes_.end(); | 29 return inflight_probes_.find(host) != inflight_probes_.end(); |
| 24 } | 30 } |
| 25 | 31 |
| 26 bool HTTPSProber::ProbeHost(const std::string& host, URLRequestContext* ctx, | 32 bool HTTPSProber::ProbeHost(const std::string& host, URLRequestContext* ctx, |
| 27 HTTPSProberDelegate* delegate) { | 33 HTTPSProberDelegate* delegate) { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 } else { | 83 } else { |
| 78 Failure(request); | 84 Failure(request); |
| 79 } | 85 } |
| 80 } | 86 } |
| 81 | 87 |
| 82 void HTTPSProber::OnReadCompleted(net::URLRequest* request, int bytes_read) { | 88 void HTTPSProber::OnReadCompleted(net::URLRequest* request, int bytes_read) { |
| 83 NOTREACHED(); | 89 NOTREACHED(); |
| 84 } | 90 } |
| 85 | 91 |
| 86 } // namespace net | 92 } // namespace net |
| OLD | NEW |