| 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/client/plugin/pepper_packet_socket_factory.h" | 5 #include "remoting/client/plugin/pepper_packet_socket_factory.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/base/io_buffer.h" | 9 #include "net/base/io_buffer.h" |
| 10 #include "ppapi/cpp/private/net_address_private.h" | 10 #include "ppapi/cpp/private/net_address_private.h" |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 190 |
| 191 int UdpPacketSocket::Send(const void* data, size_t data_size) { | 191 int UdpPacketSocket::Send(const void* data, size_t data_size) { |
| 192 // UDP sockets are not connected - this method should never be called. | 192 // UDP sockets are not connected - this method should never be called. |
| 193 NOTREACHED(); | 193 NOTREACHED(); |
| 194 return EWOULDBLOCK; | 194 return EWOULDBLOCK; |
| 195 } | 195 } |
| 196 | 196 |
| 197 int UdpPacketSocket::SendTo(const void* data, | 197 int UdpPacketSocket::SendTo(const void* data, |
| 198 size_t data_size, | 198 size_t data_size, |
| 199 const talk_base::SocketAddress& address) { | 199 const talk_base::SocketAddress& address) { |
| 200 DCHECK_EQ(state_, STATE_BOUND); | 200 if (state_ != STATE_BOUND) { |
| 201 // TODO(sergeyu): StunPort may try to send stun request before we |
| 202 // are bound. Fix that problem and change this to DCHECK. |
| 203 return EINVAL; |
| 204 } |
| 201 | 205 |
| 202 if (error_ != 0) { | 206 if (error_ != 0) { |
| 203 return error_; | 207 return error_; |
| 204 } | 208 } |
| 205 | 209 |
| 206 PP_NetAddress_Private pp_address; | 210 PP_NetAddress_Private pp_address; |
| 207 if (!SocketAddressToPpAddress(address, &pp_address)) { | 211 if (!SocketAddressToPpAddress(address, &pp_address)) { |
| 208 return EINVAL; | 212 return EINVAL; |
| 209 } | 213 } |
| 210 | 214 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 const talk_base::SocketAddress& remote_address, | 348 const talk_base::SocketAddress& remote_address, |
| 345 const talk_base::ProxyInfo& proxy_info, | 349 const talk_base::ProxyInfo& proxy_info, |
| 346 const std::string& user_agent, | 350 const std::string& user_agent, |
| 347 bool ssl) { | 351 bool ssl) { |
| 348 // We don't use TCP sockets for remoting connections. | 352 // We don't use TCP sockets for remoting connections. |
| 349 NOTREACHED(); | 353 NOTREACHED(); |
| 350 return NULL; | 354 return NULL; |
| 351 } | 355 } |
| 352 | 356 |
| 353 } // namespace remoting | 357 } // namespace remoting |
| OLD | NEW |