OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 "bin/dartutils.h" | 5 #include "bin/dartutils.h" |
6 | 6 |
7 #include "include/dart_api.h" | 7 #include "include/dart_api.h" |
8 #include "include/dart_native_api.h" | 8 #include "include/dart_native_api.h" |
9 | 9 |
10 #include "platform/assert.h" | 10 #include "platform/assert.h" |
(...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
792 NewString("_printClosure"), | 792 NewString("_printClosure"), |
793 print); | 793 print); |
794 DART_CHECK_VALID(result); | 794 DART_CHECK_VALID(result); |
795 | 795 |
796 // Setup the 'timer' factory. | 796 // Setup the 'timer' factory. |
797 url = NewString(kAsyncLibURL); | 797 url = NewString(kAsyncLibURL); |
798 DART_CHECK_VALID(url); | 798 DART_CHECK_VALID(url); |
799 Dart_Handle async_lib = Dart_LookupLibrary(url); | 799 Dart_Handle async_lib = Dart_LookupLibrary(url); |
800 DART_CHECK_VALID(async_lib); | 800 DART_CHECK_VALID(async_lib); |
801 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); | 801 Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary); |
802 result = Dart_FinalizeLoading(false); | |
hausner
2014/07/22 18:23:32
Maybe a comment that we need to finalize here so t
siva
2014/07/22 19:55:11
Done.
| |
803 DART_CHECK_VALID(result); | |
802 Dart_Handle timer_closure = | 804 Dart_Handle timer_closure = |
803 Dart_Invoke(io_lib, NewString("_getTimerFactoryClosure"), 0, NULL); | 805 Dart_Invoke(io_lib, NewString("_getTimerFactoryClosure"), 0, NULL); |
804 Dart_Handle args[1]; | 806 Dart_Handle args[1]; |
805 args[0] = timer_closure; | 807 args[0] = timer_closure; |
806 DART_CHECK_VALID(Dart_Invoke( | 808 DART_CHECK_VALID(Dart_Invoke( |
807 async_lib, NewString("_setTimerFactoryClosure"), 1, args)); | 809 async_lib, NewString("_setTimerFactoryClosure"), 1, args)); |
808 | 810 |
809 // Setup the 'scheduleImmediate' closure. | 811 // Setup the 'scheduleImmediate' closure. |
810 url = NewString(kIsolateLibURL); | 812 url = NewString(kIsolateLibURL); |
811 DART_CHECK_VALID(url); | 813 DART_CHECK_VALID(url); |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1153 new CObjectString(CObject::NewString(os_error->message())); | 1155 new CObjectString(CObject::NewString(os_error->message())); |
1154 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1156 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
1155 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1157 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
1156 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1158 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
1157 result->SetAt(2, error_message); | 1159 result->SetAt(2, error_message); |
1158 return result; | 1160 return result; |
1159 } | 1161 } |
1160 | 1162 |
1161 } // namespace bin | 1163 } // namespace bin |
1162 } // namespace dart | 1164 } // namespace dart |
OLD | NEW |