Chromium Code Reviews| Index: runtime/bin/dartutils.cc |
| =================================================================== |
| --- runtime/bin/dartutils.cc (revision 37209) |
| +++ runtime/bin/dartutils.cc (working copy) |
| @@ -25,7 +25,7 @@ |
| const char* DartUtils::kDartScheme = "dart:"; |
| const char* DartUtils::kDartExtensionScheme = "dart-ext:"; |
| const char* DartUtils::kAsyncLibURL = "dart:async"; |
| -const char* DartUtils::kBuiltinLibURL = "dart:builtin"; |
| +const char* DartUtils::kBuiltinLibURL = "dart:_builtin"; |
| const char* DartUtils::kCoreLibURL = "dart:core"; |
| const char* DartUtils::kInternalLibURL = "dart:_internal"; |
| const char* DartUtils::kIsolateLibURL = "dart:isolate"; |
| @@ -679,6 +679,7 @@ |
| intptr_t num_bytes = 0; |
| Dart_Handle result = Dart_ListLength(data, &num_bytes); |
| + if (Dart_IsError(result)) Dart_PropagateError(result); |
|
Ivan Posva
2014/06/12 23:05:11
{}
hausner
2014/06/12 23:54:37
Done.
|
| DART_CHECK_VALID(result); |
| uint8_t* buffer = reinterpret_cast<uint8_t*>(malloc(num_bytes)); |
| @@ -739,6 +740,25 @@ |
| } |
| +// Callback function that gets called from dartutils when there are |
| +// no more outstanding load requests. Invoke Dart core library function |
| +// that completes futures of loadLibrary calls (deferred library loading). |
| +// Invoking this function finalizes newly loaded classes as a side |
| +// effect. |
| +void FUNCTION_NAME(Builtin_DoneLoading)(Dart_NativeArguments args) { |
| + Dart_Handle corelib_url = DartUtils::NewString(DartUtils::kCoreLibURL); |
| + DART_CHECK_VALID(corelib_url); |
| + Dart_Handle corelib = Dart_LookupLibrary(corelib_url); |
| + DART_CHECK_VALID(corelib); |
| + Dart_Handle res = |
| + Dart_Invoke(corelib, |
| + DartUtils::NewString("_completeDeferredLoads"), |
| + 0, |
| + NULL); |
| + if (Dart_IsError(res)) Dart_PropagateError(res); |
|
Ivan Posva
2014/06/12 23:05:11
{}
hausner
2014/06/12 23:54:37
Done.
|
| +} |
| + |
| + |
| Dart_Handle DartUtils::LoadSource(Dart_Handle library, |
| Dart_Handle url, |
| Dart_LibraryTag tag, |