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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 bool bytes_written = file->WriteFully(magic_number, sizeof(magic_number)); | 473 bool bytes_written = file->WriteFully(magic_number, sizeof(magic_number)); |
474 ASSERT(bytes_written); | 474 ASSERT(bytes_written); |
475 } | 475 } |
476 | 476 |
477 | 477 |
478 Dart_Handle DartUtils::LoadScript(const char* script_uri, | 478 Dart_Handle DartUtils::LoadScript(const char* script_uri, |
479 Dart_Handle builtin_lib) { | 479 Dart_Handle builtin_lib) { |
480 Dart_Handle uri = Dart_NewStringFromCString(script_uri); | 480 Dart_Handle uri = Dart_NewStringFromCString(script_uri); |
481 | 481 |
482 Dart_Port load_port = Dart_ServiceWaitForLoadPort(); | 482 Dart_Port load_port = Dart_ServiceWaitForLoadPort(); |
483 if (load_port == ILLEGAL_PORT) { | 483 if (load_port == DART_ILLEGAL_PORT) { |
484 return NewDartUnsupportedError("Service did not return load port."); | 484 return NewDartUnsupportedError("Service did not return load port."); |
485 } | 485 } |
486 Builtin::SetLoadPort(load_port); | 486 Builtin::SetLoadPort(load_port); |
487 | 487 |
488 return LoadDataAsync_Invoke(Dart_Null(), uri, Dart_Null(), builtin_lib); | 488 return LoadDataAsync_Invoke(Dart_Null(), uri, Dart_Null(), builtin_lib); |
489 } | 489 } |
490 | 490 |
491 | 491 |
492 // Callback function, gets called from asynchronous script and library | 492 // Callback function, gets called from asynchronous script and library |
493 // reading code when there is an i/o error. | 493 // reading code when there is an i/o error. |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 new CObjectString(CObject::NewString(os_error->message())); | 1203 new CObjectString(CObject::NewString(os_error->message())); |
1204 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1204 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
1205 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1205 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
1206 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1206 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
1207 result->SetAt(2, error_message); | 1207 result->SetAt(2, error_message); |
1208 return result; | 1208 return result; |
1209 } | 1209 } |
1210 | 1210 |
1211 } // namespace bin | 1211 } // namespace bin |
1212 } // namespace dart | 1212 } // namespace dart |
OLD | NEW |