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

Side by Side Diff: tests/native_worker/native_worker.c

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 | « tests/native_worker/mandel_worker.c ('k') | tests/photo/nacl_file.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 * Simple test for native web workers. 8 * Simple test for native web workers.
9 */ 9 */
10 10
(...skipping 22 matching lines...) Expand all
33 static char* message_string; 33 static char* message_string;
34 34
35 void PostMessage(NaClSrpcRpc *rpc, 35 void PostMessage(NaClSrpcRpc *rpc,
36 NaClSrpcArg **in_args, 36 NaClSrpcArg **in_args,
37 NaClSrpcArg **out_args, 37 NaClSrpcArg **out_args,
38 NaClSrpcClosure *done) { 38 NaClSrpcClosure *done) {
39 rpc->result = NACL_SRPC_RESULT_APP_ERROR; 39 rpc->result = NACL_SRPC_RESULT_APP_ERROR;
40 /* 40 /*
41 * Strdup must be used because the SRPC layer frees the string passed to it. 41 * Strdup must be used because the SRPC layer frees the string passed to it.
42 */ 42 */
43 message_string = strdup(in_args[0]->u.sval.str); 43 message_string = strdup(in_args[0]->arrays.str);
44 /* 44 /*
45 * Echo the message back to the renderer. 45 * Echo the message back to the renderer.
46 */ 46 */
47 if (-1 != worker_upcall_desc) { 47 if (-1 != worker_upcall_desc) {
48 NaClSrpcChannel upcall_channel; 48 NaClSrpcChannel upcall_channel;
49 if (!NaClSrpcClientCtor(&upcall_channel, worker_upcall_desc)) { 49 if (!NaClSrpcClientCtor(&upcall_channel, worker_upcall_desc)) {
50 done->Run(done); 50 done->Run(done);
51 return; 51 return;
52 } 52 }
53 NaClSrpcInvokeBySignature(&upcall_channel, "postMessage:s:", "from nacl"); 53 NaClSrpcInvokeBySignature(&upcall_channel, "postMessage:s:", "from nacl");
(...skipping 12 matching lines...) Expand all
66 int main() { 66 int main() {
67 if (!NaClSrpcModuleInit()) { 67 if (!NaClSrpcModuleInit()) {
68 return 1; 68 return 1;
69 } 69 }
70 if (!NaClSrpcAcceptClientConnection(srpc_methods)) { 70 if (!NaClSrpcAcceptClientConnection(srpc_methods)) {
71 return 1; 71 return 1;
72 } 72 }
73 NaClSrpcModuleFini(); 73 NaClSrpcModuleFini();
74 return 0; 74 return 0;
75 } 75 }
OLDNEW
« no previous file with comments | « tests/native_worker/mandel_worker.c ('k') | tests/photo/nacl_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698