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 "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_tcp_server_socket_private_impl.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "webkit/plugins/ppapi/host_globals.h" | 8 #include "webkit/plugins/ppapi/host_globals.h" |
9 #include "webkit/plugins/ppapi/plugin_delegate.h" | 9 #include "webkit/plugins/ppapi/plugin_delegate.h" |
10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 10 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 if (succeeded) { | 44 if (succeeded) { |
45 *tcp_socket_buffer_ = | 45 *tcp_socket_buffer_ = |
46 PPB_TCPSocket_Private_Impl::CreateConnectedSocket(pp_instance(), | 46 PPB_TCPSocket_Private_Impl::CreateConnectedSocket(pp_instance(), |
47 accepted_socket_id, | 47 accepted_socket_id, |
48 local_addr, | 48 local_addr, |
49 remote_addr); | 49 remote_addr); |
50 } | 50 } |
51 tcp_socket_buffer_ = NULL; | 51 tcp_socket_buffer_ = NULL; |
52 | 52 |
53 ::ppapi::TrackedCallback::ClearAndRun(&accept_callback_, | 53 accept_callback_->Run(succeeded ? PP_OK : PP_ERROR_FAILED); |
54 succeeded ? PP_OK : PP_ERROR_FAILED); | |
55 } | 54 } |
56 | 55 |
57 void PPB_TCPServerSocket_Private_Impl::SendListen( | 56 void PPB_TCPServerSocket_Private_Impl::SendListen( |
58 const PP_NetAddress_Private& addr, | 57 const PP_NetAddress_Private& addr, |
59 int32_t backlog) { | 58 int32_t backlog) { |
60 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | 59 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); |
61 if (!plugin_delegate) | 60 if (!plugin_delegate) |
62 return; | 61 return; |
63 | 62 |
64 plugin_delegate->TCPServerSocketListen(pp_resource(), addr, backlog); | 63 plugin_delegate->TCPServerSocketListen(pp_resource(), addr, backlog); |
(...skipping 10 matching lines...) Expand all Loading... |
75 void PPB_TCPServerSocket_Private_Impl::SendStopListening() { | 74 void PPB_TCPServerSocket_Private_Impl::SendStopListening() { |
76 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); | 75 PluginDelegate* plugin_delegate = ResourceHelper::GetPluginDelegate(this); |
77 if (!plugin_delegate) | 76 if (!plugin_delegate) |
78 return; | 77 return; |
79 | 78 |
80 plugin_delegate->TCPServerSocketStopListening(pp_resource(), socket_id_); | 79 plugin_delegate->TCPServerSocketStopListening(pp_resource(), socket_id_); |
81 } | 80 } |
82 | 81 |
83 } // namespace ppapi | 82 } // namespace ppapi |
84 } // namespace webkit | 83 } // namespace webkit |
OLD | NEW |