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

Side by Side Diff: tests/fake_browser/deferred_srpc_init.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/contest_issues/issue63.c ('k') | tests/fib/fib_array.c » ('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 2010 The Native Client Authors. All rights reserved. 2 * Copyright 2010 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 #include <assert.h> 7 #include <assert.h>
8 #include <stdio.h> 8 #include <stdio.h>
9 #include <string.h> 9 #include <string.h>
10 #include <unistd.h> 10 #include <unistd.h>
11 11
12 #include <nacl/nacl_srpc.h> 12 #include <nacl/nacl_srpc.h>
13 #include <sys/nacl_syscalls.h> 13 #include <sys/nacl_syscalls.h>
14 14
15 15
16 void TestMethod(NaClSrpcRpc *rpc, 16 void TestMethod(NaClSrpcRpc *rpc,
17 NaClSrpcArg **in_args, 17 NaClSrpcArg **in_args,
18 NaClSrpcArg **out_args, 18 NaClSrpcArg **out_args,
19 NaClSrpcClosure *done) { 19 NaClSrpcClosure *done) {
20 out_args[0]->u.sval.str = strdup("Deferred SRPC connection worked."); 20 out_args[0]->arrays.str = strdup("Deferred SRPC connection worked.");
21 rpc->result = NACL_SRPC_RESULT_OK; 21 rpc->result = NACL_SRPC_RESULT_OK;
22 done->Run(done); 22 done->Run(done);
23 } 23 }
24 24
25 const struct NaClSrpcHandlerDesc srpc_methods[] = { 25 const struct NaClSrpcHandlerDesc srpc_methods[] = {
26 { "test_method::s", TestMethod }, 26 { "test_method::s", TestMethod },
27 { NULL, NULL }, 27 { NULL, NULL },
28 }; 28 };
29 29
30 int main() { 30 int main() {
(...skipping 15 matching lines...) Expand all
46 rc = close(fd); 46 rc = close(fd);
47 assert(rc == 0); 47 assert(rc == 0);
48 48
49 /* But the third connection was just right! We accept it. */ 49 /* But the third connection was just right! We accept it. */
50 fd = imc_accept(3); 50 fd = imc_accept(3);
51 assert(fd >= 0); 51 assert(fd >= 0);
52 NaClSrpcServerLoop(fd, srpc_methods, NULL); 52 NaClSrpcServerLoop(fd, srpc_methods, NULL);
53 53
54 return 0; 54 return 0;
55 } 55 }
OLDNEW
« no previous file with comments | « tests/contest_issues/issue63.c ('k') | tests/fib/fib_array.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698