OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 * Copyright (c) 2012 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 #include "native_client/src/trusted/plugin/srpc_client.h" | 7 #include "native_client/src/trusted/plugin/srpc_client.h" |
8 | 8 |
9 #include <string.h> | 9 #include <string.h> |
10 | 10 |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 static_cast<void*>(params))); | 175 static_cast<void*>(params))); |
176 | 176 |
177 // Ensure Invoke was called with a method name that has a binding. | 177 // Ensure Invoke was called with a method name that has a binding. |
178 if (NULL == methods_[method_name]) { | 178 if (NULL == methods_[method_name]) { |
179 PLUGIN_PRINTF(("SrpcClient::Invoke (ident not in methods_)\n")); | 179 PLUGIN_PRINTF(("SrpcClient::Invoke (ident not in methods_)\n")); |
180 return false; | 180 return false; |
181 } | 181 } |
182 | 182 |
183 PLUGIN_PRINTF(("SrpcClient::Invoke (sending the rpc)\n")); | 183 PLUGIN_PRINTF(("SrpcClient::Invoke (sending the rpc)\n")); |
184 // Call the method | 184 // Call the method |
185 NaClSrpcError err = NaClSrpcInvokeV(&srpc_channel_, | 185 last_error_ = NaClSrpcInvokeV(&srpc_channel_, |
186 methods_[method_name]->index(), | 186 methods_[method_name]->index(), |
187 params->ins(), | 187 params->ins(), |
188 params->outs()); | 188 params->outs()); |
189 PLUGIN_PRINTF(("SrpcClient::Invoke (response=%d)\n", err)); | 189 PLUGIN_PRINTF(("SrpcClient::Invoke (response=%d)\n", last_error_)); |
190 if (NACL_SRPC_RESULT_OK != err) { | 190 if (NACL_SRPC_RESULT_OK != last_error_) { |
191 PLUGIN_PRINTF(("SrpcClient::Invoke (err='%s', return 0)\n", | 191 PLUGIN_PRINTF(("SrpcClient::Invoke (err='%s', return 0)\n", |
192 NaClSrpcErrorString(err))); | 192 NaClSrpcErrorString(last_error_))); |
193 return false; | 193 return false; |
194 } | 194 } |
195 | 195 |
196 PLUGIN_PRINTF(("SrpcClient::Invoke (return 1)\n")); | 196 PLUGIN_PRINTF(("SrpcClient::Invoke (return 1)\n")); |
197 return true; | 197 return true; |
198 } | 198 } |
199 | 199 |
200 void SrpcClient::AttachService(NaClSrpcService* service, void* instance_data) { | 200 void SrpcClient::AttachService(NaClSrpcService* service, void* instance_data) { |
201 srpc_channel_.server = service; | 201 srpc_channel_.server = service; |
202 srpc_channel_.server_instance_data = instance_data; | 202 srpc_channel_.server_instance_data = instance_data; |
203 } | 203 } |
204 | 204 |
205 } // namespace plugin | 205 } // namespace plugin |
OLD | NEW |