Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Side by Side Diff: runtime/vm/dart_api_impl.cc

Issue 50983002: Implement fromEnvironment on bool, int and String (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Addressed comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3892 matching lines...) Expand 10 before | Expand all | Expand 10 after
3903 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); 3903 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
3904 Isolate* isolate = arguments->isolate(); 3904 Isolate* isolate = arguments->isolate();
3905 CHECK_ISOLATE(isolate); 3905 CHECK_ISOLATE(isolate);
3906 ASSERT(isolate->api_state() != NULL && 3906 ASSERT(isolate->api_state() != NULL &&
3907 (isolate->api_state()->IsValidWeakPersistentHandle(rval) || 3907 (isolate->api_state()->IsValidWeakPersistentHandle(rval) ||
3908 isolate->api_state()->IsValidPrologueWeakPersistentHandle(rval))); 3908 isolate->api_state()->IsValidPrologueWeakPersistentHandle(rval)));
3909 Api::SetWeakHandleReturnValue(arguments, rval); 3909 Api::SetWeakHandleReturnValue(arguments, rval);
3910 } 3910 }
3911 3911
3912 3912
3913 // --- Environment ---
3914 DART_EXPORT Dart_Handle Dart_SetEnvironmentCallback(
3915 Dart_EnvironmentCallback callback) {
3916 Isolate* isolate = Isolate::Current();
3917 CHECK_ISOLATE(isolate);
3918 isolate->set_environment_callback(callback);
3919 return Api::Success();
3920 }
3921
3922
3923 // --- Scripts and Libraries ---
3913 DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args, 3924 DART_EXPORT void Dart_SetBooleanReturnValue(Dart_NativeArguments args,
3914 bool retval) { 3925 bool retval) {
3915 TRACE_API_CALL(CURRENT_FUNC); 3926 TRACE_API_CALL(CURRENT_FUNC);
3916 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args); 3927 NativeArguments* arguments = reinterpret_cast<NativeArguments*>(args);
3917 arguments->SetReturn(Bool::Get(retval)); 3928 arguments->SetReturn(Bool::Get(retval));
3918 } 3929 }
3919 3930
3920 3931
3921 DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args, 3932 DART_EXPORT void Dart_SetIntegerReturnValue(Dart_NativeArguments args,
3922 int64_t retval) { 3933 int64_t retval) {
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
4413 } 4424 }
4414 { 4425 {
4415 NoGCScope no_gc; 4426 NoGCScope no_gc;
4416 RawObject* raw_obj = obj.raw(); 4427 RawObject* raw_obj = obj.raw();
4417 isolate->heap()->SetPeer(raw_obj, peer); 4428 isolate->heap()->SetPeer(raw_obj, peer);
4418 } 4429 }
4419 return Api::Success(); 4430 return Api::Success();
4420 } 4431 }
4421 4432
4422 } // namespace dart 4433 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/bootstrap_natives.h ('k') | runtime/vm/isolate.h » ('j') | sdk/lib/core/bool.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698