Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(500)

Side by Side Diff: src/trusted/plugin/socket_address.cc

Issue 5622003: Restructure the structs/unions involved in SRPC argument passing. This will... (Closed) Base URL: svn://svn.chromium.org/native_client/trunk/src/native_client/
Patch Set: '' Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/trusted/plugin/shared_memory.cc ('k') | src/trusted/plugin/srt_socket.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « src/trusted/plugin/shared_memory.cc ('k') | src/trusted/plugin/srt_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698