| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "jingle/glue/proxy_resolving_client_socket.h" | 5 #include "jingle/glue/proxy_resolving_client_socket.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 connect_callback_( | 37 connect_callback_( |
| 38 base::Bind(&ProxyResolvingClientSocket::ProcessConnectDone, | 38 base::Bind(&ProxyResolvingClientSocket::ProcessConnectDone, |
| 39 base::Unretained(this))), | 39 base::Unretained(this))), |
| 40 ssl_config_(ssl_config), | 40 ssl_config_(ssl_config), |
| 41 pac_request_(NULL), | 41 pac_request_(NULL), |
| 42 dest_host_port_pair_(dest_host_port_pair), | 42 dest_host_port_pair_(dest_host_port_pair), |
| 43 // Assume that we intend to do TLS on this socket; all | 43 // Assume that we intend to do TLS on this socket; all |
| 44 // current use cases do. | 44 // current use cases do. |
| 45 proxy_url_("https://" + dest_host_port_pair_.ToString()), | 45 proxy_url_("https://" + dest_host_port_pair_.ToString()), |
| 46 tried_direct_connect_fallback_(false), | 46 tried_direct_connect_fallback_(false), |
| 47 bound_net_log_(net::BoundNetLog::Make( | 47 bound_net_log_(net::NetLogWithSource::Make( |
| 48 request_context_getter->GetURLRequestContext()->net_log(), | 48 request_context_getter->GetURLRequestContext()->net_log(), |
| 49 net::NetLogSourceType::SOCKET)), | 49 net::NetLogSourceType::SOCKET)), |
| 50 weak_factory_(this) { | 50 weak_factory_(this) { |
| 51 DCHECK(request_context_getter.get()); | 51 DCHECK(request_context_getter.get()); |
| 52 net::URLRequestContext* request_context = | 52 net::URLRequestContext* request_context = |
| 53 request_context_getter->GetURLRequestContext(); | 53 request_context_getter->GetURLRequestContext(); |
| 54 DCHECK(request_context); | 54 DCHECK(request_context); |
| 55 DCHECK(!dest_host_port_pair_.host().empty()); | 55 DCHECK(!dest_host_port_pair_.host().empty()); |
| 56 DCHECK_GT(dest_host_port_pair_.port(), 0); | 56 DCHECK_GT(dest_host_port_pair_.port(), 0); |
| 57 DCHECK(proxy_url_.is_valid()); | 57 DCHECK(proxy_url_.is_valid()); |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 | 364 |
| 365 int ProxyResolvingClientSocket::GetLocalAddress( | 365 int ProxyResolvingClientSocket::GetLocalAddress( |
| 366 net::IPEndPoint* address) const { | 366 net::IPEndPoint* address) const { |
| 367 if (transport_.get() && transport_->socket()) | 367 if (transport_.get() && transport_->socket()) |
| 368 return transport_->socket()->GetLocalAddress(address); | 368 return transport_->socket()->GetLocalAddress(address); |
| 369 NOTREACHED(); | 369 NOTREACHED(); |
| 370 return net::ERR_SOCKET_NOT_CONNECTED; | 370 return net::ERR_SOCKET_NOT_CONNECTED; |
| 371 } | 371 } |
| 372 | 372 |
| 373 const net::BoundNetLog& ProxyResolvingClientSocket::NetLog() const { | 373 const net::NetLogWithSource& ProxyResolvingClientSocket::NetLog() const { |
| 374 if (transport_.get() && transport_->socket()) | 374 if (transport_.get() && transport_->socket()) |
| 375 return transport_->socket()->NetLog(); | 375 return transport_->socket()->NetLog(); |
| 376 NOTREACHED(); | 376 NOTREACHED(); |
| 377 return bound_net_log_; | 377 return bound_net_log_; |
| 378 } | 378 } |
| 379 | 379 |
| 380 void ProxyResolvingClientSocket::SetSubresourceSpeculation() { | 380 void ProxyResolvingClientSocket::SetSubresourceSpeculation() { |
| 381 if (transport_.get() && transport_->socket()) | 381 if (transport_.get() && transport_->socket()) |
| 382 transport_->socket()->SetSubresourceSpeculation(); | 382 transport_->socket()->SetSubresourceSpeculation(); |
| 383 else | 383 else |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 423 return 0; | 423 return 0; |
| 424 } | 424 } |
| 425 | 425 |
| 426 void ProxyResolvingClientSocket::CloseTransportSocket() { | 426 void ProxyResolvingClientSocket::CloseTransportSocket() { |
| 427 if (transport_.get() && transport_->socket()) | 427 if (transport_.get() && transport_->socket()) |
| 428 transport_->socket()->Disconnect(); | 428 transport_->socket()->Disconnect(); |
| 429 transport_.reset(); | 429 transport_.reset(); |
| 430 } | 430 } |
| 431 | 431 |
| 432 } // namespace jingle_glue | 432 } // namespace jingle_glue |
| OLD | NEW |