| 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 3648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3659 RETURN_NULL_ERROR(native_fields); | 3659 RETURN_NULL_ERROR(native_fields); |
| 3660 } | 3660 } |
| 3661 const Class& cls = Class::Handle(isolate, type_obj.type_class()); | 3661 const Class& cls = Class::Handle(isolate, type_obj.type_class()); |
| 3662 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); | 3662 const Error& error = Error::Handle(isolate, cls.EnsureIsFinalized(isolate)); |
| 3663 if (!error.IsNull()) { | 3663 if (!error.IsNull()) { |
| 3664 // An error occurred, return error object. | 3664 // An error occurred, return error object. |
| 3665 return Api::NewHandle(isolate, error.raw()); | 3665 return Api::NewHandle(isolate, error.raw()); |
| 3666 } | 3666 } |
| 3667 if (num_native_fields != cls.num_native_fields()) { | 3667 if (num_native_fields != cls.num_native_fields()) { |
| 3668 return Api::NewError( | 3668 return Api::NewError( |
| 3669 "%s: invalid number of native fields %d passed in, expected %d", | 3669 "%s: invalid number of native fields %" Pd " passed in, expected %d", |
| 3670 CURRENT_FUNC, num_native_fields, cls.num_native_fields()); | 3670 CURRENT_FUNC, num_native_fields, cls.num_native_fields()); |
| 3671 } | 3671 } |
| 3672 const Instance& instance = Instance::Handle(isolate, | 3672 const Instance& instance = Instance::Handle(isolate, |
| 3673 AllocateObject(isolate, cls)); | 3673 AllocateObject(isolate, cls)); |
| 3674 instance.SetNativeFields(num_native_fields, native_fields); | 3674 instance.SetNativeFields(num_native_fields, native_fields); |
| 3675 return Api::NewHandle(isolate, instance.raw()); | 3675 return Api::NewHandle(isolate, instance.raw()); |
| 3676 } | 3676 } |
| 3677 | 3677 |
| 3678 | 3678 |
| 3679 static Dart_Handle SetupArguments(Isolate* isolate, | 3679 static Dart_Handle SetupArguments(Isolate* isolate, |
| (...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5257 | 5257 |
| 5258 | 5258 |
| 5259 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( | 5259 DART_EXPORT void Dart_RegisterRootServiceRequestCallback( |
| 5260 const char* name, | 5260 const char* name, |
| 5261 Dart_ServiceRequestCallback callback, | 5261 Dart_ServiceRequestCallback callback, |
| 5262 void* user_data) { | 5262 void* user_data) { |
| 5263 Service::RegisterRootEmbedderCallback(name, callback, user_data); | 5263 Service::RegisterRootEmbedderCallback(name, callback, user_data); |
| 5264 } | 5264 } |
| 5265 | 5265 |
| 5266 } // namespace dart | 5266 } // namespace dart |
| OLD | NEW |