| 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/notifier/base/proxy_resolving_client_socket.h" | 5 #include "jingle/notifier/base/proxy_resolving_client_socket.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 return transport_->socket()->IsConnected(); | 298 return transport_->socket()->IsConnected(); |
| 299 } | 299 } |
| 300 | 300 |
| 301 bool ProxyResolvingClientSocket::IsConnectedAndIdle() const { | 301 bool ProxyResolvingClientSocket::IsConnectedAndIdle() const { |
| 302 if (!transport_.get() || !transport_->socket()) | 302 if (!transport_.get() || !transport_->socket()) |
| 303 return false; | 303 return false; |
| 304 return transport_->socket()->IsConnectedAndIdle(); | 304 return transport_->socket()->IsConnectedAndIdle(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 int ProxyResolvingClientSocket::GetPeerAddress( | 307 int ProxyResolvingClientSocket::GetPeerAddress( |
| 308 net::AddressList* address) const { | 308 net::IPEndPoint* address) const { |
| 309 if (transport_.get() && transport_->socket()) | 309 if (transport_.get() && transport_->socket()) |
| 310 return transport_->socket()->GetPeerAddress(address); | 310 return transport_->socket()->GetPeerAddress(address); |
| 311 NOTREACHED(); | 311 NOTREACHED(); |
| 312 return net::ERR_SOCKET_NOT_CONNECTED; | 312 return net::ERR_SOCKET_NOT_CONNECTED; |
| 313 } | 313 } |
| 314 | 314 |
| 315 int ProxyResolvingClientSocket::GetLocalAddress( | 315 int ProxyResolvingClientSocket::GetLocalAddress( |
| 316 net::IPEndPoint* address) const { | 316 net::IPEndPoint* address) const { |
| 317 if (transport_.get() && transport_->socket()) | 317 if (transport_.get() && transport_->socket()) |
| 318 return transport_->socket()->GetLocalAddress(address); | 318 return transport_->socket()->GetLocalAddress(address); |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 return net::kProtoUnknown; | 376 return net::kProtoUnknown; |
| 377 } | 377 } |
| 378 | 378 |
| 379 void ProxyResolvingClientSocket::CloseTransportSocket() { | 379 void ProxyResolvingClientSocket::CloseTransportSocket() { |
| 380 if (transport_.get() && transport_->socket()) | 380 if (transport_.get() && transport_->socket()) |
| 381 transport_->socket()->Disconnect(); | 381 transport_->socket()->Disconnect(); |
| 382 transport_.reset(); | 382 transport_.reset(); |
| 383 } | 383 } |
| 384 | 384 |
| 385 } // namespace notifier | 385 } // namespace notifier |
| OLD | NEW |