| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #ifndef VM_DART_API_IMPL_H_ | 5 #ifndef VM_DART_API_IMPL_H_ |
| 6 #define VM_DART_API_IMPL_H_ | 6 #define VM_DART_API_IMPL_H_ |
| 7 | 7 |
| 8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
| 9 #include "vm/native_arguments.h" | 9 #include "vm/native_arguments.h" |
| 10 #include "vm/object.h" | 10 #include "vm/object.h" |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 } | 253 } |
| 254 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { | 254 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { |
| 255 args->SetReturnUnsafe(Integer::New(retval)); | 255 args->SetReturnUnsafe(Integer::New(retval)); |
| 256 } | 256 } |
| 257 static void SetDoubleReturnValue(NativeArguments* args, double retval) { | 257 static void SetDoubleReturnValue(NativeArguments* args, double retval) { |
| 258 args->SetReturnUnsafe(Double::New(retval)); | 258 args->SetReturnUnsafe(Double::New(retval)); |
| 259 } | 259 } |
| 260 static void SetWeakHandleReturnValue(NativeArguments* args, | 260 static void SetWeakHandleReturnValue(NativeArguments* args, |
| 261 Dart_WeakPersistentHandle retval); | 261 Dart_WeakPersistentHandle retval); |
| 262 | 262 |
| 263 static RawString* CallEnvironmentCallback(Thread* thread, | 263 static RawString* GetEnvironmentValue(Thread* thread, const String& name); |
| 264 const String& name); | |
| 265 | 264 |
| 266 private: | 265 private: |
| 267 static Dart_Handle InitNewHandle(Thread* thread, RawObject* raw); | 266 static Dart_Handle InitNewHandle(Thread* thread, RawObject* raw); |
| 268 | 267 |
| 268 static RawString* CallEnvironmentCallback(Thread* thread, const String& name); |
| 269 |
| 269 // Thread local key used by the API. Currently holds the current | 270 // Thread local key used by the API. Currently holds the current |
| 270 // ApiNativeScope if any. | 271 // ApiNativeScope if any. |
| 271 static ThreadLocalKey api_native_key_; | 272 static ThreadLocalKey api_native_key_; |
| 272 static Dart_Handle true_handle_; | 273 static Dart_Handle true_handle_; |
| 273 static Dart_Handle false_handle_; | 274 static Dart_Handle false_handle_; |
| 274 static Dart_Handle null_handle_; | 275 static Dart_Handle null_handle_; |
| 275 static Dart_Handle empty_string_handle_; | 276 static Dart_Handle empty_string_handle_; |
| 276 | 277 |
| 277 friend class ApiNativeScope; | 278 friend class ApiNativeScope; |
| 278 }; | 279 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 296 return Api::NewError("%s: Cannot load after Dart_Precompile", \ | 297 return Api::NewError("%s: Cannot load after Dart_Precompile", \ |
| 297 CURRENT_FUNC); \ | 298 CURRENT_FUNC); \ |
| 298 } \ | 299 } \ |
| 299 | 300 |
| 300 #define ASSERT_CALLBACK_STATE(thread) \ | 301 #define ASSERT_CALLBACK_STATE(thread) \ |
| 301 ASSERT(thread->no_callback_scope_depth() == 0) | 302 ASSERT(thread->no_callback_scope_depth() == 0) |
| 302 | 303 |
| 303 } // namespace dart. | 304 } // namespace dart. |
| 304 | 305 |
| 305 #endif // VM_DART_API_IMPL_H_ | 306 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |