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 "bin/crypto.h" | 7 #include "bin/crypto.h" |
8 #include "bin/directory.h" | 8 #include "bin/directory.h" |
9 #include "bin/extensions.h" | 9 #include "bin/extensions.h" |
10 #include "bin/file.h" | 10 #include "bin/file.h" |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 Dart_Handle dart_args[kNumArgs]; | 372 Dart_Handle dart_args[kNumArgs]; |
373 dart_args[0] = library_url; | 373 dart_args[0] = library_url; |
374 dart_args[1] = url; | 374 dart_args[1] = url; |
375 return Dart_Invoke(DartUtils::BuiltinLib(), | 375 return Dart_Invoke(DartUtils::BuiltinLib(), |
376 NewString("_resolveUri"), | 376 NewString("_resolveUri"), |
377 kNumArgs, | 377 kNumArgs, |
378 dart_args); | 378 dart_args); |
379 } | 379 } |
380 | 380 |
381 | 381 |
| 382 Dart_Handle DartUtils::ResolveScript(Dart_Handle url) { |
| 383 const int kNumArgs = 1; |
| 384 Dart_Handle dart_args[kNumArgs]; |
| 385 dart_args[0] = url; |
| 386 return Dart_Invoke(DartUtils::BuiltinLib(), |
| 387 NewString("_resolveScriptUri"), |
| 388 kNumArgs, |
| 389 dart_args); |
| 390 } |
| 391 |
| 392 |
382 static Dart_Handle LoadDataAsync_Invoke(Dart_Handle tag, | 393 static Dart_Handle LoadDataAsync_Invoke(Dart_Handle tag, |
383 Dart_Handle url, | 394 Dart_Handle url, |
384 Dart_Handle library_url) { | 395 Dart_Handle library_url) { |
385 const int kNumArgs = 3; | 396 const int kNumArgs = 3; |
386 Dart_Handle dart_args[kNumArgs]; | 397 Dart_Handle dart_args[kNumArgs]; |
387 dart_args[0] = tag; | 398 dart_args[0] = tag; |
388 dart_args[1] = url; | 399 dart_args[1] = url; |
389 dart_args[2] = library_url; | 400 dart_args[2] = library_url; |
390 return Dart_Invoke(DartUtils::BuiltinLib(), | 401 return Dart_Invoke(DartUtils::BuiltinLib(), |
391 DartUtils::NewString("_loadDataAsync"), | 402 DartUtils::NewString("_loadDataAsync"), |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 kNumArgs, | 751 kNumArgs, |
741 dart_args); | 752 dart_args); |
742 RETURN_IF_ERROR(result); | 753 RETURN_IF_ERROR(result); |
743 } else if (packages_config != NULL) { | 754 } else if (packages_config != NULL) { |
744 Dart_Handle result = NewString(packages_config); | 755 Dart_Handle result = NewString(packages_config); |
745 RETURN_IF_ERROR(result); | 756 RETURN_IF_ERROR(result); |
746 const int kNumArgs = 1; | 757 const int kNumArgs = 1; |
747 Dart_Handle dart_args[kNumArgs]; | 758 Dart_Handle dart_args[kNumArgs]; |
748 dart_args[0] = result; | 759 dart_args[0] = result; |
749 result = Dart_Invoke(DartUtils::BuiltinLib(), | 760 result = Dart_Invoke(DartUtils::BuiltinLib(), |
750 NewString("_loadPackagesMap"), | 761 NewString("_setPackagesMap"), |
751 kNumArgs, | 762 kNumArgs, |
752 dart_args); | 763 dart_args); |
753 RETURN_IF_ERROR(result); | 764 RETURN_IF_ERROR(result); |
754 } | 765 } |
755 return Dart_True(); | 766 return Dart_True(); |
756 } | 767 } |
757 | 768 |
758 | 769 |
759 Dart_Handle DartUtils::PrepareForScriptLoading(bool is_service_isolate, | 770 Dart_Handle DartUtils::PrepareForScriptLoading(bool is_service_isolate, |
760 bool trace_loading) { | 771 bool trace_loading) { |
(...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1264 new CObjectString(CObject::NewString(os_error->message())); | 1275 new CObjectString(CObject::NewString(os_error->message())); |
1265 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); | 1276 CObjectArray* result = new CObjectArray(CObject::NewArray(3)); |
1266 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); | 1277 result->SetAt(0, new CObjectInt32(CObject::NewInt32(kOSError))); |
1267 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); | 1278 result->SetAt(1, new CObjectInt32(CObject::NewInt32(os_error->code()))); |
1268 result->SetAt(2, error_message); | 1279 result->SetAt(2, error_message); |
1269 return result; | 1280 return result; |
1270 } | 1281 } |
1271 | 1282 |
1272 } // namespace bin | 1283 } // namespace bin |
1273 } // namespace dart | 1284 } // namespace dart |
OLD | NEW |