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

Unified Diff: runtime/bin/dartutils.cc

Issue 1381033002: Add data-URI support class to dart:core (next to Uri). (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Added library now working (thanks fschneider). Back to the main content. Created 5 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index 62285162604ff2075613f668c6e4d3f2f8907801..cf8631f8b255db1f0c1f8cdc6b6fc52c199baab8 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -728,15 +728,15 @@ Dart_Handle DartUtils::PrepareBuiltinLibrary(Dart_Handle builtin_lib,
}
-Dart_Handle DartUtils::PrepareCoreLibrary(Dart_Handle core_lib,
- Dart_Handle builtin_lib,
- bool is_service_isolate) {
+Dart_Handle DartUtils::PrepareUriLibrary(Dart_Handle uri_lib,
+ Dart_Handle builtin_lib,
+ bool is_service_isolate) {
if (!is_service_isolate) {
- // Setup the 'Uri.base' getter in dart:core.
+ // Setup the 'Uri.base' getter in dart:uri.
Dart_Handle uri_base = Dart_Invoke(
builtin_lib, NewString("_getUriBaseClosure"), 0, NULL);
RETURN_IF_ERROR(uri_base);
- Dart_Handle result = Dart_SetField(core_lib,
+ Dart_Handle result = Dart_SetField(uri_lib,
NewString("_uriBaseClosure"),
uri_base);
RETURN_IF_ERROR(result);
@@ -793,6 +793,10 @@ Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
RETURN_IF_ERROR(internal_lib);
Dart_Handle io_lib = Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
RETURN_IF_ERROR(io_lib);
+ url = NewString(kUriLibURL);
+ RETURN_IF_ERROR(url);
+ Dart_Handle uri_lib = Dart_LookupLibrary(url);
+ RETURN_IF_ERROR(uri_lib);
// We need to ensure that all the scripts loaded so far are finalized
// as we are about to invoke some Dart code below to setup closures.
@@ -809,8 +813,8 @@ Dart_Handle DartUtils::PrepareForScriptLoading(const char* package_root,
RETURN_IF_ERROR(result);
RETURN_IF_ERROR(PrepareAsyncLibrary(async_lib, isolate_lib));
- RETURN_IF_ERROR(PrepareCoreLibrary(
- core_lib, builtin_lib, is_service_isolate));
+ RETURN_IF_ERROR(PrepareUriLibrary(
+ uri_lib, builtin_lib, is_service_isolate));
RETURN_IF_ERROR(PrepareIsolateLibrary(isolate_lib));
RETURN_IF_ERROR(PrepareIOLibrary(io_lib));
return result;
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/lib/core_sources.gypi » ('j') | sdk/lib/uri/uri.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698