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/srpc/browser_interface.h" | 10 #include "native_client/src/trusted/plugin/browser_interface.h" |
11 #include "native_client/src/trusted/plugin/srpc/connected_socket.h" | 11 #include "native_client/src/trusted/plugin/connected_socket.h" |
12 #include "native_client/src/trusted/plugin/srpc/plugin.h" | 12 #include "native_client/src/trusted/plugin/plugin.h" |
13 #include "native_client/src/trusted/plugin/srpc/socket_address.h" | 13 #include "native_client/src/trusted/plugin/scriptable_handle.h" |
14 | 14 #include "native_client/src/trusted/plugin/socket_address.h" |
15 #include "native_client/src/trusted/plugin/srpc/scriptable_handle.h" | 15 #include "native_client/src/trusted/plugin/utility.h" |
16 | |
17 #include "native_client/src/trusted/plugin/srpc/utility.h" | |
18 | 16 |
19 namespace { | 17 namespace { |
20 | 18 |
21 bool RpcConnect(void* obj, plugin::SrpcParams *params) { | 19 bool RpcConnect(void* obj, plugin::SrpcParams *params) { |
22 plugin::SocketAddress* socket_addr = | 20 plugin::SocketAddress* socket_addr = |
23 reinterpret_cast<plugin::SocketAddress*>(obj); | 21 reinterpret_cast<plugin::SocketAddress*>(obj); |
24 plugin::ScriptableHandle* connected_socket = socket_addr->Connect(); | 22 plugin::ScriptableHandle* connected_socket = socket_addr->Connect(); |
25 if (NULL == connected_socket) { | 23 if (NULL == connected_socket) { |
26 return false; | 24 return false; |
27 } | 25 } |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 ScriptableHandle* connected_socket = | 80 ScriptableHandle* connected_socket = |
83 plugin()->browser_interface()->NewScriptableHandle( | 81 plugin()->browser_interface()->NewScriptableHandle( |
84 portable_connected_socket); | 82 portable_connected_socket); |
85 PLUGIN_PRINTF(("SocketAddress::Connect: CS returned %p\n", | 83 PLUGIN_PRINTF(("SocketAddress::Connect: CS returned %p\n", |
86 static_cast<void*>(connected_socket))); | 84 static_cast<void*>(connected_socket))); |
87 return connected_socket; | 85 return connected_socket; |
88 } | 86 } |
89 } | 87 } |
90 | 88 |
91 } // namespace plugin | 89 } // namespace plugin |
OLD | NEW |