| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 246 } |
| 247 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { | 247 static void SetIntegerReturnValue(NativeArguments* args, int64_t retval) { |
| 248 args->SetReturnUnsafe(Integer::New(retval)); | 248 args->SetReturnUnsafe(Integer::New(retval)); |
| 249 } | 249 } |
| 250 static void SetDoubleReturnValue(NativeArguments* args, double retval) { | 250 static void SetDoubleReturnValue(NativeArguments* args, double retval) { |
| 251 args->SetReturnUnsafe(Double::New(retval)); | 251 args->SetReturnUnsafe(Double::New(retval)); |
| 252 } | 252 } |
| 253 static void SetWeakHandleReturnValue(NativeArguments* args, | 253 static void SetWeakHandleReturnValue(NativeArguments* args, |
| 254 Dart_WeakPersistentHandle retval); | 254 Dart_WeakPersistentHandle retval); |
| 255 | 255 |
| 256 static RawString* CallEnvironmentCallback(Thread* thread, | 256 static RawString* GetEnvironmentValue(Thread* thread, const String& name); |
| 257 const String& name); | |
| 258 | 257 |
| 259 private: | 258 private: |
| 260 static Dart_Handle InitNewHandle(Thread* thread, RawObject* raw); | 259 static Dart_Handle InitNewHandle(Thread* thread, RawObject* raw); |
| 261 | 260 |
| 261 static RawString* CallEnvironmentCallback(Thread* thread, const String& name); |
| 262 |
| 262 // Thread local key used by the API. Currently holds the current | 263 // Thread local key used by the API. Currently holds the current |
| 263 // ApiNativeScope if any. | 264 // ApiNativeScope if any. |
| 264 static ThreadLocalKey api_native_key_; | 265 static ThreadLocalKey api_native_key_; |
| 265 static Dart_Handle true_handle_; | 266 static Dart_Handle true_handle_; |
| 266 static Dart_Handle false_handle_; | 267 static Dart_Handle false_handle_; |
| 267 static Dart_Handle null_handle_; | 268 static Dart_Handle null_handle_; |
| 268 static Dart_Handle empty_string_handle_; | 269 static Dart_Handle empty_string_handle_; |
| 269 | 270 |
| 270 friend class ApiNativeScope; | 271 friend class ApiNativeScope; |
| 271 }; | 272 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 289 return Api::NewError("%s: Cannot load after Dart_Precompile", \ | 290 return Api::NewError("%s: Cannot load after Dart_Precompile", \ |
| 290 CURRENT_FUNC); \ | 291 CURRENT_FUNC); \ |
| 291 } \ | 292 } \ |
| 292 | 293 |
| 293 #define ASSERT_CALLBACK_STATE(thread) \ | 294 #define ASSERT_CALLBACK_STATE(thread) \ |
| 294 ASSERT(thread->no_callback_scope_depth() == 0) | 295 ASSERT(thread->no_callback_scope_depth() == 0) |
| 295 | 296 |
| 296 } // namespace dart. | 297 } // namespace dart. |
| 297 | 298 |
| 298 #endif // VM_DART_API_IMPL_H_ | 299 #endif // VM_DART_API_IMPL_H_ |
| OLD | NEW |