| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "native_client/src/trusted/plugin/nacl_subprocess.h" | 5 #include "native_client/src/trusted/plugin/nacl_subprocess.h" |
| 6 | 6 |
| 7 #include <stdarg.h> | 7 #include <stdarg.h> |
| 8 | 8 |
| 9 #include "native_client/src/shared/srpc/nacl_srpc.h" | 9 #include "native_client/src/shared/srpc/nacl_srpc.h" |
| 10 #include "native_client/src/trusted/plugin/plugin_error.h" | 10 #include "native_client/src/trusted/plugin/plugin_error.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 // SrpcParam's destructor *should* free the allocated array | 96 // SrpcParam's destructor *should* free the allocated array |
| 97 const char* orig_arr = va_arg(vl, const char*); | 97 const char* orig_arr = va_arg(vl, const char*); |
| 98 size_t len = va_arg(vl, size_t); | 98 size_t len = va_arg(vl, size_t); |
| 99 char* input = (char *)malloc(len); | 99 char* input = (char *)malloc(len); |
| 100 if (!input) { | 100 if (!input) { |
| 101 PLUGIN_PRINTF(("VInvokeSrpcMethod (allocation failure)\n")); | 101 PLUGIN_PRINTF(("VInvokeSrpcMethod (allocation failure)\n")); |
| 102 return false; | 102 return false; |
| 103 } | 103 } |
| 104 memcpy(input, orig_arr, len); | 104 memcpy(input, orig_arr, len); |
| 105 params->ins()[i]->arrays.carr = input; | 105 params->ins()[i]->arrays.carr = input; |
| 106 params->ins()[i]->u.count = len; | 106 params->ins()[i]->u.count = static_cast<nacl_abi_size_t>(len); |
| 107 break; | 107 break; |
| 108 } | 108 } |
| 109 case NACL_SRPC_ARG_TYPE_HANDLE: { | 109 case NACL_SRPC_ARG_TYPE_HANDLE: { |
| 110 NaClSrpcImcDescType input = va_arg(vl, NaClSrpcImcDescType); | 110 NaClSrpcImcDescType input = va_arg(vl, NaClSrpcImcDescType); |
| 111 params->ins()[i]->u.hval = input; | 111 params->ins()[i]->u.hval = input; |
| 112 break; | 112 break; |
| 113 } | 113 } |
| 114 case NACL_SRPC_ARG_TYPE_INT: { | 114 case NACL_SRPC_ARG_TYPE_INT: { |
| 115 int32_t input = va_arg(vl, int32_t); | 115 int32_t input = va_arg(vl, int32_t); |
| 116 params->ins()[i]->u.ival = input; | 116 params->ins()[i]->u.ival = input; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 131 } | 131 } |
| 132 params->ins()[i]->arrays.str = input; | 132 params->ins()[i]->arrays.str = input; |
| 133 break; | 133 break; |
| 134 } | 134 } |
| 135 } | 135 } |
| 136 } | 136 } |
| 137 return srpc_client_->Invoke(method_name, params); | 137 return srpc_client_->Invoke(method_name, params); |
| 138 } | 138 } |
| 139 | 139 |
| 140 } // namespace plugin | 140 } // namespace plugin |
| OLD | NEW |