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

Unified Diff: runtime/vm/unit_test.cc

Issue 1663963002: - reorganize DartUtils::PrepareForScriptLoading so that it does not have the wait for service load … (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: self-review-comments Created 4 years, 11 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
« runtime/vm/unit_test.h ('K') | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/unit_test.cc
diff --git a/runtime/vm/unit_test.cc b/runtime/vm/unit_test.cc
index 05d8d3f6b09a940491cf60362e62a0eff7d3fda7..c837498d9ea0587e66d050d43447328c33d6be16 100644
--- a/runtime/vm/unit_test.cc
+++ b/runtime/vm/unit_test.cc
@@ -10,6 +10,7 @@
#include "bin/dartutils.h"
#include "platform/globals.h"
+
#include "vm/assembler.h"
#include "vm/ast_printer.h"
#include "vm/compiler.h"
@@ -56,8 +57,10 @@ static bool IsPackageSchemeURL(const char* url_name) {
return (strncmp(url_name, kPackageScheme, kPackageSchemeLen) == 0);
}
-static Dart_Handle ResolvePackageUri(Dart_Handle builtin_lib,
- const char* uri_chars) {
+static Dart_Handle ResolvePackageUri(const char* uri_chars) {
+ bin::IsolateData* isolate_data =
+ reinterpret_cast<bin::IsolateData*>(Dart_CurrentIsolateData());
+ Dart_Handle builtin_lib = isolate_data->builtin_lib();
const int kNumArgs = 1;
Dart_Handle dart_args[kNumArgs];
dart_args[0] = DartUtils::NewString(uri_chars);
@@ -88,10 +91,6 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
return result;
}
- Dart_Handle builtin_lib =
- Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
- DART_CHECK_VALID(builtin_lib);
-
bool is_dart_scheme_url = DartUtils::IsDartSchemeURL(url_chars);
bool is_io_library = DartUtils::IsDartIOLibURL(library_url_string);
if (tag == Dart_kCanonicalizeUrl) {
@@ -105,7 +104,7 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
if (Dart_IsError(library_url)) {
return library_url;
}
- return DartUtils::ResolveUri(library_url, url, builtin_lib);
+ return DartUtils::ResolveUri(library_url, url);
}
if (is_dart_scheme_url) {
ASSERT(tag == Dart_kImportTag);
@@ -113,7 +112,7 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
if (DartUtils::IsDartIOLibURL(url_chars)) {
return Builtin::LoadAndCheckLibrary(Builtin::kIOLibrary);
} else if (DartUtils::IsDartBuiltinLibURL(url_chars)) {
- return builtin_lib;
+ return Builtin::LoadAndCheckLibrary(Builtin::kBuiltinLibrary);
} else {
return DartUtils::NewError("Do not know how to load '%s'", url_chars);
}
@@ -127,7 +126,7 @@ static Dart_Handle LibraryTagHandler(Dart_LibraryTag tag,
0, 0);
}
if (IsPackageSchemeURL(url_chars)) {
- Dart_Handle resolved_uri = ResolvePackageUri(builtin_lib, url_chars);
+ Dart_Handle resolved_uri = ResolvePackageUri(url_chars);
DART_CHECK_VALID(resolved_uri);
url_chars = NULL;
Dart_Handle result = Dart_StringToCString(resolved_uri, &url_chars);
« runtime/vm/unit_test.h ('K') | « runtime/vm/unit_test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698