| 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 "remoting/jingle_glue/ssl_socket_adapter.h" | 5 #include "remoting/jingle_glue/ssl_socket_adapter.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "jingle/glue/utils.h" | 10 #include "jingle/glue/utils.h" |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 bool TransportSocket::IsConnected() const { | 210 bool TransportSocket::IsConnected() const { |
| 211 return (socket_->GetState() == talk_base::Socket::CS_CONNECTED); | 211 return (socket_->GetState() == talk_base::Socket::CS_CONNECTED); |
| 212 } | 212 } |
| 213 | 213 |
| 214 bool TransportSocket::IsConnectedAndIdle() const { | 214 bool TransportSocket::IsConnectedAndIdle() const { |
| 215 // Not implemented. | 215 // Not implemented. |
| 216 NOTREACHED(); | 216 NOTREACHED(); |
| 217 return false; | 217 return false; |
| 218 } | 218 } |
| 219 | 219 |
| 220 int TransportSocket::GetPeerAddress(net::AddressList* address) const { | 220 int TransportSocket::GetPeerAddress(net::IPEndPoint* address) const { |
| 221 talk_base::SocketAddress socket_address = socket_->GetRemoteAddress(); | 221 talk_base::SocketAddress socket_address = socket_->GetRemoteAddress(); |
| 222 net::IPEndPoint endpoint; | 222 if (jingle_glue::SocketAddressToIPEndPoint(socket_address, address)) { |
| 223 if (jingle_glue::SocketAddressToIPEndPoint(socket_address, &endpoint)) { | |
| 224 *address = net::AddressList(endpoint); | |
| 225 return net::OK; | 223 return net::OK; |
| 226 } else { | 224 } else { |
| 227 return net::ERR_FAILED; | 225 return net::ERR_FAILED; |
| 228 } | 226 } |
| 229 } | 227 } |
| 230 | 228 |
| 231 int TransportSocket::GetLocalAddress(net::IPEndPoint* address) const { | 229 int TransportSocket::GetLocalAddress(net::IPEndPoint* address) const { |
| 232 talk_base::SocketAddress socket_address = socket_->GetLocalAddress(); | 230 talk_base::SocketAddress socket_address = socket_->GetLocalAddress(); |
| 233 if (jingle_glue::SocketAddressToIPEndPoint(socket_address, address)) { | 231 if (jingle_glue::SocketAddressToIPEndPoint(socket_address, address)) { |
| 234 return net::OK; | 232 return net::OK; |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 write_buffer_len_ = buffer_len; | 366 write_buffer_len_ = buffer_len; |
| 369 return; | 367 return; |
| 370 } | 368 } |
| 371 } | 369 } |
| 372 was_used_to_convey_data_ = true; | 370 was_used_to_convey_data_ = true; |
| 373 callback.Run(result); | 371 callback.Run(result); |
| 374 } | 372 } |
| 375 } | 373 } |
| 376 | 374 |
| 377 } // namespace remoting | 375 } // namespace remoting |
| OLD | NEW |