OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 The Native Client Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can | 3 * Use of this source code is governed by a BSD-style license that can |
4 * be found in the LICENSE file. | 4 * be found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 | 7 |
8 #include <signal.h> | 8 #include <signal.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include "native_client/src/trusted/plugin/browser_interface.h" | 10 #include "native_client/src/trusted/plugin/browser_interface.h" |
11 #include "native_client/src/trusted/plugin/connected_socket.h" | 11 #include "native_client/src/trusted/plugin/connected_socket.h" |
12 #include "native_client/src/trusted/plugin/plugin.h" | 12 #include "native_client/src/trusted/plugin/plugin.h" |
13 #include "native_client/src/trusted/plugin/scriptable_handle.h" | 13 #include "native_client/src/trusted/plugin/scriptable_handle.h" |
14 #include "native_client/src/trusted/plugin/socket_address.h" | 14 #include "native_client/src/trusted/plugin/socket_address.h" |
15 #include "native_client/src/trusted/plugin/utility.h" | 15 #include "native_client/src/trusted/plugin/utility.h" |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 bool RpcConnect(void* obj, plugin::SrpcParams *params) { | 19 bool RpcConnect(void* obj, plugin::SrpcParams *params) { |
20 plugin::SocketAddress* socket_addr = | 20 plugin::SocketAddress* socket_addr = |
21 reinterpret_cast<plugin::SocketAddress*>(obj); | 21 reinterpret_cast<plugin::SocketAddress*>(obj); |
22 plugin::ScriptableHandle* connected_socket = socket_addr->Connect(); | 22 plugin::ScriptableHandle* connected_socket = socket_addr->Connect(); |
23 if (NULL == connected_socket) { | 23 if (NULL == connected_socket) { |
24 return false; | 24 return false; |
25 } | 25 } |
26 params->outs()[0]->tag = NACL_SRPC_ARG_TYPE_OBJECT; | 26 params->outs()[0]->tag = NACL_SRPC_ARG_TYPE_OBJECT; |
27 params->outs()[0]->u.oval = connected_socket; | 27 params->outs()[0]->arrays.oval = connected_socket; |
28 return true; | 28 return true; |
29 } | 29 } |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 namespace plugin { | 33 namespace plugin { |
34 | 34 |
35 SocketAddress* SocketAddress::New(Plugin* plugin, nacl::DescWrapper* wrapper) { | 35 SocketAddress* SocketAddress::New(Plugin* plugin, nacl::DescWrapper* wrapper) { |
36 PLUGIN_PRINTF(("SocketAddress::New (plugin=%p)\n", | 36 PLUGIN_PRINTF(("SocketAddress::New (plugin=%p)\n", |
37 static_cast<void*>(plugin))); | 37 static_cast<void*>(plugin))); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 ScriptableHandle* connected_socket = | 81 ScriptableHandle* connected_socket = |
82 plugin()->browser_interface()->NewScriptableHandle( | 82 plugin()->browser_interface()->NewScriptableHandle( |
83 portable_connected_socket); | 83 portable_connected_socket); |
84 PLUGIN_PRINTF(("SocketAddress::Connect (connected_socket=%p)\n", | 84 PLUGIN_PRINTF(("SocketAddress::Connect (connected_socket=%p)\n", |
85 static_cast<void*>(connected_socket))); | 85 static_cast<void*>(connected_socket))); |
86 return connected_socket; | 86 return connected_socket; |
87 } | 87 } |
88 } | 88 } |
89 | 89 |
90 } // namespace plugin | 90 } // namespace plugin |
OLD | NEW |