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

Unified Diff: runtime/bin/dartutils.cc

Issue 983713002: Remove 'dart:io' import in builtin.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/bin/builtin.dart ('K') | « runtime/bin/builtin_natives.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index e953dd68bd40719bb9b5d0b119477a97907401b4..fc8b0c53d6e7478fde7a495eaf0d03d304c70bc6 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -47,10 +47,6 @@ static bool IsWindowsHost() {
}
-// Experimental flag that offloads all script loading I/O onto
-// the service isolate. Disabled for now.
-#define LOAD_VIA_SERVICE_ISOLATE
-
const char* DartUtils::MapLibraryUrl(CommandLineOptions* url_mapping,
const char* url_string) {
ASSERT(url_mapping != NULL);
@@ -483,13 +479,11 @@ Dart_Handle DartUtils::LoadScript(const char* script_uri,
Dart_Handle builtin_lib) {
Dart_Handle uri = Dart_NewStringFromCString(script_uri);
-#if defined(LOAD_VIA_SERVICE_ISOLATE)
Dart_Port load_port = Dart_ServiceWaitForLoadPort();
if (load_port == ILLEGAL_PORT) {
return NewDartUnsupportedError("Service did not return load port.");
}
Builtin::SetLoadPort(load_port);
-#endif
return LoadDataAsync_Invoke(Dart_Null(), uri, Dart_Null(), builtin_lib);
}
@@ -615,6 +609,18 @@ void FUNCTION_NAME(Builtin_NativeLibraryExtension)(Dart_NativeArguments args) {
}
+void FUNCTION_NAME(Builtin_GetCurrentDirectory)(Dart_NativeArguments args) {
+ char* current = Directory::Current();
+ if (current != NULL) {
+ Dart_SetReturnValue(args, DartUtils::NewString(current));
+ free(current);
+ } else {
+ Dart_Handle err = DartUtils::NewError("Failed to get current directory.");
+ Dart_PropagateError(err);
+ }
+}
+
+
void DartUtils::PrepareBuiltinLibrary(Dart_Handle builtin_lib,
Dart_Handle internal_lib,
bool is_service_isolate,
@@ -634,12 +640,6 @@ void DartUtils::PrepareBuiltinLibrary(Dart_Handle builtin_lib,
DART_CHECK_VALID(result);
}
-#if defined(LOAD_VIA_SERVICE_ISOLATE)
- result = Dart_SetField(builtin_lib, NewString("_load_via_service_isolate"),
- Dart_True());
- DART_CHECK_VALID(result);
-#endif
-
if (!is_service_isolate) {
// Set current working directory.
result = SetWorkingDirectory(builtin_lib);
« runtime/bin/builtin.dart ('K') | « runtime/bin/builtin_natives.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698