OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2014 The Chromium Authors. All rights reserved. | 2 * Copyright 2014 The Chromium Authors. All rights reserved. |
3 * Use of this source code is governed by a BSD-style license that can be | 3 * Use of this source code is governed by a BSD-style license that can be |
4 * found in the LICENSE file. | 4 * found in the LICENSE file. |
5 */ | 5 */ |
6 | 6 |
7 /* | 7 /* |
8 * Post-message based test for simple rpc based access to name services. | 8 * Post-message based test for simple rpc based access to name services. |
9 * | 9 * |
10 * Converted from srpc_nameservice_test (deprecated), i.e., C -> C++, | 10 * Converted from srpc_nameservice_test (deprecated), i.e., C -> C++, |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 } | 90 } |
91 sb->Printf("NaClSrpcClientCtor succeeded\n"); | 91 sb->Printf("NaClSrpcClientCtor succeeded\n"); |
92 close(ns); | 92 close(ns); |
93 g_ns_channel_initialized = 1; | 93 g_ns_channel_initialized = 1; |
94 } | 94 } |
95 | 95 |
96 // | 96 // |
97 // Dump RNG output into a string. | 97 // Dump RNG output into a string. |
98 // | 98 // |
99 void RngDump(const pp::Var& message_data, nacl::StringBuffer* sb) { | 99 void RngDump(const pp::Var& message_data, nacl::StringBuffer* sb) { |
100 NaClSrpcError rpc_result; | 100 NaClSrpcError rpc_result __attribute__((unused)); |
101 int status; | 101 int status; |
102 int rng; | 102 int rng; |
103 | 103 |
104 Initialize(message_data, sb); | 104 Initialize(message_data, sb); |
105 | 105 |
106 rpc_result = NaClSrpcInvokeBySignature(&g_ns_channel, | 106 rpc_result = NaClSrpcInvokeBySignature(&g_ns_channel, |
107 NACL_NAME_SERVICE_LOOKUP, | 107 NACL_NAME_SERVICE_LOOKUP, |
108 "SecureRandom", O_RDONLY, | 108 "SecureRandom", O_RDONLY, |
109 &status, &rng); | 109 &status, &rng); |
110 assert(NACL_SRPC_RESULT_OK == rpc_result); | 110 assert(NACL_SRPC_RESULT_OK == rpc_result); |
Nico
2014/08/08 15:28:44
nit: if this can base, `base::ignore_result(rpc_re
| |
111 printf("rpc status %d\n", status); | 111 printf("rpc status %d\n", status); |
112 assert(NACL_NAME_SERVICE_SUCCESS == status); | 112 assert(NACL_NAME_SERVICE_SUCCESS == status); |
113 printf("rng descriptor %d\n", rng); | 113 printf("rng descriptor %d\n", rng); |
114 | 114 |
115 dump_output(sb, rng, RNG_OUTPUT_BYTES); | 115 dump_output(sb, rng, RNG_OUTPUT_BYTES); |
116 close(rng); | 116 close(rng); |
117 } | 117 } |
118 | 118 |
119 void ManifestTest(const pp::Var& message_data, nacl::StringBuffer* sb) { | 119 void ManifestTest(const pp::Var& message_data, nacl::StringBuffer* sb) { |
120 int status = -1; | 120 int status = -1; |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
223 }; | 223 }; |
224 | 224 |
225 namespace pp { | 225 namespace pp { |
226 | 226 |
227 // Factory function for your specialization of the Module object. | 227 // Factory function for your specialization of the Module object. |
228 Module* CreateModule() { | 228 Module* CreateModule() { |
229 return new MyModule(); | 229 return new MyModule(); |
230 } | 230 } |
231 | 231 |
232 } // namespace pp | 232 } // namespace pp |
OLD | NEW |