| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2008 The Native Client Authors. All rights reserved. | 2 * Copyright 2008 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 <stdlib.h> | 7 #include <stdlib.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 | 9 |
| 10 #include "native_client/src/include/checked_cast.h" | 10 #include "native_client/src/include/checked_cast.h" |
| 11 #include "native_client/src/trusted/plugin/desc_based_handle.h" |
| 11 #include "native_client/src/trusted/plugin/npapi/browser_impl_npapi.h" | 12 #include "native_client/src/trusted/plugin/npapi/browser_impl_npapi.h" |
| 12 #include "native_client/src/trusted/plugin/npapi/npapi_native.h" | 13 #include "native_client/src/trusted/plugin/npapi/npapi_native.h" |
| 13 #include "native_client/src/trusted/plugin/npapi/scriptable_impl_npapi.h" | 14 #include "native_client/src/trusted/plugin/npapi/scriptable_impl_npapi.h" |
| 14 #include "native_client/src/trusted/plugin/srpc/desc_based_handle.h" | 15 #include "native_client/src/trusted/plugin/utility.h" |
| 15 #include "native_client/src/trusted/plugin/srpc/utility.h" | |
| 16 | 16 |
| 17 using nacl::assert_cast; | 17 using nacl::assert_cast; |
| 18 | 18 |
| 19 #define STRINGZ_TO_NPVARIANT_ASSERT(_val, _v) \ | 19 #define STRINGZ_TO_NPVARIANT_ASSERT(_val, _v) \ |
| 20 NP_BEGIN_MACRO \ | 20 NP_BEGIN_MACRO \ |
| 21 (_v).type = NPVariantType_String; \ | 21 (_v).type = NPVariantType_String; \ |
| 22 NPString str = { _val, assert_cast<uint32_t>(strlen(_val)) }; \ | 22 NPString str = { _val, assert_cast<uint32_t>(strlen(_val)) }; \ |
| 23 (_v).value.stringValue = str; \ | 23 (_v).value.stringValue = str; \ |
| 24 NP_END_MACRO | 24 NP_END_MACRO |
| 25 | 25 |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 NPN_ReleaseVariantValue(&nplength); | 174 NPN_ReleaseVariantValue(&nplength); |
| 175 if (!correct_type) { | 175 if (!correct_type) { |
| 176 return false; | 176 return false; |
| 177 } | 177 } |
| 178 // Make result available to the caller. | 178 // Make result available to the caller. |
| 179 *length = tmp_length; | 179 *length = tmp_length; |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace plugin | 183 } // namespace plugin |
| OLD | NEW |