| 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 "ppapi/proxy/ppb_tcp_server_socket_private_proxy.h" | 5 #include "ppapi/proxy/ppb_tcp_server_socket_private_proxy.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "ppapi/c/pp_errors.h" | 10 #include "ppapi/c/pp_errors.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 if (succeeded) { | 71 if (succeeded) { |
| 72 *tcp_socket_buffer_ = | 72 *tcp_socket_buffer_ = |
| 73 PPB_TCPSocket_Private_Proxy::CreateProxyResourceForConnectedSocket( | 73 PPB_TCPSocket_Private_Proxy::CreateProxyResourceForConnectedSocket( |
| 74 pp_instance(), | 74 pp_instance(), |
| 75 accepted_socket_id, | 75 accepted_socket_id, |
| 76 local_addr, | 76 local_addr, |
| 77 remote_addr); | 77 remote_addr); |
| 78 } | 78 } |
| 79 tcp_socket_buffer_ = NULL; | 79 tcp_socket_buffer_ = NULL; |
| 80 | 80 |
| 81 TrackedCallback::ClearAndRun(&accept_callback_, | 81 accept_callback_->Run(succeeded ? PP_OK : PP_ERROR_FAILED); |
| 82 succeeded ? PP_OK : PP_ERROR_FAILED); | |
| 83 } | 82 } |
| 84 | 83 |
| 85 void TCPServerSocket::SendListen(const PP_NetAddress_Private& addr, | 84 void TCPServerSocket::SendListen(const PP_NetAddress_Private& addr, |
| 86 int32_t backlog) { | 85 int32_t backlog) { |
| 87 SendToBrowser(new PpapiHostMsg_PPBTCPServerSocket_Listen( | 86 SendToBrowser(new PpapiHostMsg_PPBTCPServerSocket_Listen( |
| 88 API_ID_PPB_TCPSERVERSOCKET_PRIVATE, | 87 API_ID_PPB_TCPSERVERSOCKET_PRIVATE, |
| 89 plugin_dispatcher_id_, | 88 plugin_dispatcher_id_, |
| 90 pp_resource(), | 89 pp_resource(), |
| 91 addr, | 90 addr, |
| 92 backlog)); | 91 backlog)); |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 local_addr, | 190 local_addr, |
| 192 remote_addr); | 191 remote_addr); |
| 193 } else if (accepted_socket_id != 0) { | 192 } else if (accepted_socket_id != 0) { |
| 194 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( | 193 PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( |
| 195 new PpapiHostMsg_PPBTCPSocket_Disconnect(accepted_socket_id)); | 194 new PpapiHostMsg_PPBTCPSocket_Disconnect(accepted_socket_id)); |
| 196 } | 195 } |
| 197 } | 196 } |
| 198 | 197 |
| 199 } // namespace proxy | 198 } // namespace proxy |
| 200 } // namespace ppapi | 199 } // namespace ppapi |
| OLD | NEW |