| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "include/dart_api.h" | 5 #include "include/dart_api.h" |
| 6 #include "include/dart_mirrors_api.h" | 6 #include "include/dart_mirrors_api.h" |
| 7 #include "include/dart_native_api.h" | 7 #include "include/dart_native_api.h" |
| 8 | 8 |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "vm/bigint_operations.h" | 10 #include "vm/bigint_operations.h" |
| (...skipping 3827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3838 } | 3838 } |
| 3839 *count = instance.NumNativeFields(); | 3839 *count = instance.NumNativeFields(); |
| 3840 return Api::Success(); | 3840 return Api::Success(); |
| 3841 } | 3841 } |
| 3842 | 3842 |
| 3843 | 3843 |
| 3844 DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, | 3844 DART_EXPORT Dart_Handle Dart_GetNativeInstanceField(Dart_Handle obj, |
| 3845 int index, | 3845 int index, |
| 3846 intptr_t* value) { | 3846 intptr_t* value) { |
| 3847 Isolate* isolate = Isolate::Current(); | 3847 Isolate* isolate = Isolate::Current(); |
| 3848 DARTSCOPE(isolate); | 3848 CHECK_ISOLATE(isolate); |
| 3849 ReusableObjectHandleScope reused_obj_handle(isolate); | 3849 ReusableObjectHandleScope reused_obj_handle(isolate); |
| 3850 const Instance& instance = Api::UnwrapInstanceHandle(reused_obj_handle, obj); | 3850 const Instance& instance = Api::UnwrapInstanceHandle(reused_obj_handle, obj); |
| 3851 if (instance.IsNull()) { | 3851 if (instance.IsNull()) { |
| 3852 RETURN_TYPE_ERROR(isolate, obj, Instance); | 3852 RETURN_TYPE_ERROR(isolate, obj, Instance); |
| 3853 } | 3853 } |
| 3854 if (!instance.IsValidNativeIndex(index)) { | 3854 if (!instance.IsValidNativeIndex(index)) { |
| 3855 return Api::NewError( | 3855 return Api::NewError( |
| 3856 "%s: invalid index %d passed in to access native instance field", | 3856 "%s: invalid index %d passed in to access native instance field", |
| 3857 CURRENT_FUNC, index); | 3857 CURRENT_FUNC, index); |
| 3858 } | 3858 } |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4655 | 4655 |
| 4656 | 4656 |
| 4657 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 4657 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 4658 const char* name, | 4658 const char* name, |
| 4659 Dart_ServiceRequestCallback callback, | 4659 Dart_ServiceRequestCallback callback, |
| 4660 void* user_data) { | 4660 void* user_data) { |
| 4661 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 4661 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 4662 } | 4662 } |
| 4663 | 4663 |
| 4664 } // namespace dart | 4664 } // namespace dart |
| OLD | NEW |