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

Unified Diff: runtime/bin/process_patch.dart

Issue 11337019: Use patching for dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 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/process_patch.dart
diff --git a/runtime/bin/process_impl.dart b/runtime/bin/process_patch.dart
similarity index 92%
rename from runtime/bin/process_impl.dart
rename to runtime/bin/process_patch.dart
index ab8dfd080f98c11c7a261e9f6b8eaf6020d48d30..94b36118008a5b1fbfb314328e48796c143d3256 100644
--- a/runtime/bin/process_impl.dart
+++ b/runtime/bin/process_patch.dart
@@ -2,7 +2,26 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-_exit(int status) native "Exit";
+patch class Process {
+ /* patch */ static Future<Process> start(String executable,
+ List<String> arguments,
+ [ProcessOptions options]) {
+ _ProcessImpl process = new _ProcessImpl(executable, arguments, options);
+ return process._start();
+ }
+
+ /* patch */ static Future<ProcessResult> run(String executable,
+ List<String> arguments,
+ [ProcessOptions options]) {
+ return new _NonInteractiveProcess(executable, arguments, options)._result;
+ }
+}
+
+
+patch class _ProcessUtils {
+ /* patch */ static _exit(int status) native "Exit";
+}
+
class _ProcessStartStatus {
int _errorCode; // Set to OS error code if process start failed.
@@ -10,21 +29,8 @@ class _ProcessStartStatus {
}
-class _Process extends NativeFieldWrapperClass1 implements Process {
- static Future<ProcessResult> run(String path,
- List<String> arguments,
- [ProcessOptions options]) {
- return new _NonInteractiveProcess(path, arguments, options)._result;
- }
-
- static Future<Process> start(String path,
- List<String> arguments,
- ProcessOptions options) {
- _Process process = new _Process(path, arguments, options);
- return process._start();
- }
-
- _Process(String path, List<String> arguments, ProcessOptions options) {
+class _ProcessImpl extends NativeFieldWrapperClass1 implements Process {
+ _ProcessImpl(String path, List<String> arguments, ProcessOptions options) {
if (path is !String) {
throw new ArgumentError("Path is not a String: $path");
}
@@ -286,7 +292,7 @@ class _NonInteractiveProcess {
}
// Start the underlying process.
- var processFuture = new _Process(path, arguments, options)._start();
+ var processFuture = new _ProcessImpl(path, arguments, options)._start();
processFuture.then((Process p) {
// Make sure the process stdin is closed.

Powered by Google App Engine
This is Rietveld 408576698