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

Unified Diff: sdk/lib/io/process.dart

Issue 14322011: Add access to process id for both current process and processes started (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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: sdk/lib/io/process.dart
diff --git a/sdk/lib/io/process.dart b/sdk/lib/io/process.dart
index fc2a4aa7d455d0f9ebfe170230edc244eb8fc5d4..fd61c56e5145ab8c4a279962bd10b59df84e8fd5 100644
--- a/sdk/lib/io/process.dart
+++ b/sdk/lib/io/process.dart
@@ -10,6 +10,7 @@ class _ProcessUtils {
external static _exit(int status);
external static _setExitCode(int status);
external static _sleep(int millis);
+ external static int _pid(Process process);
}
/**
@@ -54,6 +55,11 @@ void sleep(Duration duration) {
}
/**
+ * Returns the PID if the current process.
Anders Johnsen 2013/04/17 09:13:06 Move to Process.currentPid static getter?
Søren Gjesse 2013/04/17 10:15:12 I think the top level getter fits with the top lev
+ */
+int get pid => _ProcessUtils._pid(null);
+
+/**
* [Process] is used to start new processes using the static
* [start] and [run] methods.
*/
@@ -118,6 +124,11 @@ abstract class Process {
IOSink get stdin;
/**
+ * Returns the process id of the process.
+ */
+ int get pid;
+
+ /**
* Returns a [:Future:] which completes with the exit code of the process
* when the process completes.
*
@@ -162,6 +173,11 @@ abstract class ProcessResult {
* Standard error from the process as a string.
*/
String get stderr;
+
+ /**
+ * Process id from the process.
+ */
+ int get pid;
}

Powered by Google App Engine
This is Rietveld 408576698