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

Unified Diff: pkg/scheduled_test/lib/scheduled_process.dart

Issue 15883003: Remove ProcessOptions and make the options named arguments. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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
« no previous file with comments | « no previous file | runtime/bin/process_patch.dart » ('j') | sdk/lib/io/process.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/scheduled_test/lib/scheduled_process.dart
diff --git a/pkg/scheduled_test/lib/scheduled_process.dart b/pkg/scheduled_test/lib/scheduled_process.dart
index 23370f10942602b5ccc0e42e56dbce3c3d87c70e..3577a633bc1e8909c7c4a765be4a763e2a5ef626 100644
--- a/pkg/scheduled_test/lib/scheduled_process.dart
+++ b/pkg/scheduled_test/lib/scheduled_process.dart
@@ -69,18 +69,21 @@ class ScheduledProcess {
/// Whether the process is expected to terminate at this point.
var _endExpected = false;
- /// Schedules a process to start. [executable], [arguments], and [options]
- /// have the same meaning as for [Process.start]. [description] is a string
+ /// Schedules a process to start. [executable], [arguments],
+ /// [workingDirectory], and [environment] have the same meaning as for
+ /// [Process.start]. [description] is a string
nweiz 2013/05/23 18:55:11 Please re-justify the whole paragraph. The followi
Anders Johnsen 2013/05/24 11:04:15 Done.
/// description of this process; it defaults to the command-line invocation.
/// [encoding] is the [Encoding] that will be used for the process's input and
/// output.
///
- /// [executable], [arguments], and [options] may be either a [Future] or a
+ /// [executable], [arguments], [workingDirectory], and [environment] may be
+ /// either a [Future] or a
/// concrete value. If any are [Future]s, the process won't start until the
/// [Future]s have completed. In addition, [arguments] may be a [List]
/// containing a mix of strings and [Future]s.
ScheduledProcess.start(executable, arguments,
- {options, String description, Encoding encoding: Encoding.UTF_8})
+ {workingDirectory, environment, String description,
kustermann 2013/05/24 08:44:30 I wouldn't mind if we make this 'cwd'. But I guess
Anders Johnsen 2013/05/24 11:04:15 Yep. :)
+ Encoding encoding: Encoding.UTF_8})
: _encoding = encoding,
_explicitDescription = description != null,
_description = description {
@@ -88,7 +91,7 @@ class ScheduledProcess {
_updateDescription(executable, arguments);
- _scheduleStartProcess(executable, arguments, options);
+ _scheduleStartProcess(executable, arguments, workingDirectory, environment);
_scheduleExceptionCleanup();
@@ -120,7 +123,10 @@ class ScheduledProcess {
}
/// Schedules the process to start and sets [_process].
- void _scheduleStartProcess(executable, arguments, options) {
+ void _scheduleStartProcess(executable,
+ arguments,
+ workingDirectory,
+ environment) {
var exitCodeCompleter = new Completer();
_exitCode = new ValueFuture(exitCodeCompleter.future);
@@ -135,13 +141,18 @@ class ScheduledProcess {
return Future.wait([
new Future.sync(() => executable),
awaitObject(arguments),
- new Future.sync(() => options)
+ new Future.sync(() => workingDirectory),
+ new Future.sync(() => environment)
kustermann 2013/05/24 08:44:30 Why do we have 'new Future.sync(() => executable)'
Anders Johnsen 2013/05/24 11:04:15 Since the executable can be wrapped in a Future. S
]).then((results) {
executable = results[0];
arguments = results[1];
- options = results[2];
+ workingDirectory = results[2];
+ environment = results[3];
_updateDescription(executable, arguments);
- return Process.start(executable, arguments, options).then((process) {
+ return Process.start(executable,
+ arguments,
+ workingDirectory: workingDirectory,
+ environment: environment).then((process) {
// TODO(nweiz): enable this when issue 9020 is fixed.
Yonggang Luo 2013/05/24 18:55:59 https://code.google.com/p/dart/issues/detail?id=90
nweiz 2013/05/24 20:15:50 Nice catch, I'll enable this in a separate CL.
// process.stdin.encoding = Encoding.UTF_8;
return process;
« no previous file with comments | « no previous file | runtime/bin/process_patch.dart » ('j') | sdk/lib/io/process.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698