Chromium Code Reviews| 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 "lib/stacktrace.h" | 10 #include "lib/stacktrace.h" |
| (...skipping 5847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5858 const Library& lib = Api::UnwrapLibraryHandle(Z, library); | 5858 const Library& lib = Api::UnwrapLibraryHandle(Z, library); |
| 5859 if (lib.IsNull()) { | 5859 if (lib.IsNull()) { |
| 5860 RETURN_TYPE_ERROR(Z, library, Library); | 5860 RETURN_TYPE_ERROR(Z, library, Library); |
| 5861 } | 5861 } |
| 5862 lib.set_native_entry_resolver(resolver); | 5862 lib.set_native_entry_resolver(resolver); |
| 5863 lib.set_native_entry_symbol_resolver(symbol); | 5863 lib.set_native_entry_symbol_resolver(symbol); |
| 5864 return Api::Success(); | 5864 return Api::Success(); |
| 5865 } | 5865 } |
| 5866 | 5866 |
| 5867 | 5867 |
| 5868 DART_EXPORT Dart_Handle | |
| 5869 Dart_GetNativeResolver(Dart_Handle library, | |
| 5870 Dart_NativeEntryResolver* resolver) { | |
|
siva
2016/11/22 20:48:47
if (resolver == NULL) {
RETURN_NULL_ERROR(resolv
| |
| 5871 *resolver = NULL; | |
| 5872 DARTSCOPE(Thread::Current()); | |
| 5873 const Library& lib = Api::UnwrapLibraryHandle(Z, library); | |
| 5874 if (lib.IsNull()) { | |
| 5875 RETURN_TYPE_ERROR(Z, library, Library); | |
| 5876 } | |
| 5877 *resolver = lib.native_entry_resolver(); | |
| 5878 return Api::Success(); | |
| 5879 } | |
| 5880 | |
| 5881 | |
| 5882 DART_EXPORT Dart_Handle Dart_GetNativeSymbol(Dart_Handle library, | |
| 5883 Dart_NativeEntrySymbol* resolver) { | |
|
siva
2016/11/22 20:48:47
if (resolver == NULL) {
RETURN_NULL_ERROR(resolv
| |
| 5884 *resolver = NULL; | |
| 5885 DARTSCOPE(Thread::Current()); | |
| 5886 const Library& lib = Api::UnwrapLibraryHandle(Z, library); | |
| 5887 if (lib.IsNull()) { | |
| 5888 RETURN_TYPE_ERROR(Z, library, Library); | |
| 5889 } | |
| 5890 *resolver = lib.native_entry_symbol_resolver(); | |
| 5891 return Api::Success(); | |
| 5892 } | |
| 5893 | |
| 5868 // --- Peer support --- | 5894 // --- Peer support --- |
| 5869 | 5895 |
| 5870 DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer) { | 5896 DART_EXPORT Dart_Handle Dart_GetPeer(Dart_Handle object, void** peer) { |
| 5871 if (peer == NULL) { | 5897 if (peer == NULL) { |
| 5872 RETURN_NULL_ERROR(peer); | 5898 RETURN_NULL_ERROR(peer); |
| 5873 } | 5899 } |
| 5874 Thread* thread = Thread::Current(); | 5900 Thread* thread = Thread::Current(); |
| 5875 CHECK_ISOLATE(thread->isolate()); | 5901 CHECK_ISOLATE(thread->isolate()); |
| 5876 REUSABLE_OBJECT_HANDLESCOPE(thread); | 5902 REUSABLE_OBJECT_HANDLESCOPE(thread); |
| 5877 Object& obj = thread->ObjectHandle(); | 5903 Object& obj = thread->ObjectHandle(); |
| (...skipping 720 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6598 | 6624 |
| 6599 DART_EXPORT bool Dart_IsPrecompiledRuntime() { | 6625 DART_EXPORT bool Dart_IsPrecompiledRuntime() { |
| 6600 #if defined(DART_PRECOMPILED_RUNTIME) | 6626 #if defined(DART_PRECOMPILED_RUNTIME) |
| 6601 return true; | 6627 return true; |
| 6602 #else | 6628 #else |
| 6603 return false; | 6629 return false; |
| 6604 #endif | 6630 #endif |
| 6605 } | 6631 } |
| 6606 | 6632 |
| 6607 } // namespace dart | 6633 } // namespace dart |
| OLD | NEW |