OLD | NEW |
1 // Copyright (c) 2011 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 // Scriptable handle implementation. | 5 // Scriptable handle implementation. |
6 | 6 |
7 #include "native_client/src/trusted/plugin/scriptable_handle.h" | 7 #include "native_client/src/trusted/plugin/scriptable_handle.h" |
8 | 8 |
9 #include <stdio.h> | 9 #include <stdio.h> |
10 #include <string.h> | 10 #include <string.h> |
11 | 11 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 SrpcParams params; | 98 SrpcParams params; |
99 NaClSrpcArg** inputs = params.ins(); | 99 NaClSrpcArg** inputs = params.ins(); |
100 NaClSrpcArg** outputs = params.outs(); | 100 NaClSrpcArg** outputs = params.outs(); |
101 if (!plugin->InitParams(id, call_type, ¶ms)) { | 101 if (!plugin->InitParams(id, call_type, ¶ms)) { |
102 return Error(call_name, caller, | 102 return Error(call_name, caller, |
103 "srpc parameter initialization failed", exception); | 103 "srpc parameter initialization failed", exception); |
104 } | 104 } |
105 uint32_t input_length = params.InputLength(); | 105 uint32_t input_length = params.InputLength(); |
106 int32_t output_length = params.OutputLength(); | 106 int32_t output_length = params.OutputLength(); |
107 PLUGIN_PRINTF(("ScriptableHandle::%s (initialized %"NACL_PRIu32" ins, %" | 107 PLUGIN_PRINTF(("ScriptableHandle::%s (initialized %"NACL_PRIu32" ins, %" |
108 NACL_PRIu32" outs)\n", caller, input_length, output_length)); | 108 NACL_PRId32" outs)\n", caller, input_length, output_length)); |
109 | 109 |
110 // Verify input/output parameter list length. | 110 // Verify input/output parameter list length. |
111 if (args.size() != params.SignatureLength()) { | 111 if (args.size() != params.SignatureLength()) { |
112 return Error(call_name, caller, | 112 return Error(call_name, caller, |
113 "incompatible srpc parameter list", exception); | 113 "incompatible srpc parameter list", exception); |
114 } | 114 } |
115 PLUGIN_PRINTF(("ScriptableHandle::%s (verified signature)\n", caller)); | 115 PLUGIN_PRINTF(("ScriptableHandle::%s (verified signature)\n", caller)); |
116 | 116 |
117 // Marshall input parameters. | 117 // Marshall input parameters. |
118 if (input_length > 0) { | 118 if (input_length > 0) { |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 // Neither the browser nor plugin ever var referenced this object, | 465 // Neither the browser nor plugin ever var referenced this object, |
466 // so it can safely discarded. | 466 // so it can safely discarded. |
467 PLUGIN_PRINTF(("ScriptableHandle::Unref (delete this)\n")); | 467 PLUGIN_PRINTF(("ScriptableHandle::Unref (delete this)\n")); |
468 CHECK(var_ == NULL); | 468 CHECK(var_ == NULL); |
469 delete this; | 469 delete this; |
470 } | 470 } |
471 } | 471 } |
472 | 472 |
473 | 473 |
474 } // namespace plugin | 474 } // namespace plugin |
OLD | NEW |