Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 [DartPackage="mojo_services"] | 5 [DartPackage="mojo_services"] |
| 6 module native_support; | 6 module native_support; |
| 7 | 7 |
| 8 import "files/interfaces/file.mojom"; | 8 import "files/interfaces/file.mojom"; |
| 9 import "files/interfaces/types.mojom"; | 9 import "files/interfaces/types.mojom"; |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 // TODO(vtl): The implementation currently ignores |argv[0]| and always fills | 25 // TODO(vtl): The implementation currently ignores |argv[0]| and always fills |
| 26 // it in with |path|. | 26 // it in with |path|. |
| 27 // TODO(vtl): Inheriting |envp| from the parent is somewhat dubious, and | 27 // TODO(vtl): Inheriting |envp| from the parent is somewhat dubious, and |
| 28 // there's also no way to just specify modifications or limit inheritance. | 28 // there's also no way to just specify modifications or limit inheritance. |
| 29 Spawn(array<uint8> path, | 29 Spawn(array<uint8> path, |
| 30 array<array<uint8>>? argv, | 30 array<array<uint8>>? argv, |
| 31 array<array<uint8>>? envp, | 31 array<array<uint8>>? envp, |
| 32 mojo.files.File? stdin_file, | 32 mojo.files.File? stdin_file, |
| 33 mojo.files.File? stdout_file, | 33 mojo.files.File? stdout_file, |
| 34 mojo.files.File? stderr_file, | 34 mojo.files.File? stderr_file, |
| 35 ProcessController& process_controller) => (mojo.files.Error error); | 35 ProcessController& process_controller) |
| 36 => (mojo.files.Error error); | |
|
jamesr
2016/03/09 19:18:08
slightly odd to push the return to a new line when
| |
| 36 // Like |Spawn()|, except that the child's stdin/stdout/stderr are redirected | 37 // Like |Spawn()|, except that the child's stdin/stdout/stderr are redirected |
| 37 // from/to |terminal_file|, which should be a |mojo.files.File| for a terminal | 38 // from/to |terminal_file|, which should be a |mojo.files.File| for a terminal |
| 38 // (i.e., one that behaves like one, including responding to the required | 39 // (i.e., one that behaves like one, including responding to the required |
| 39 // ioctls). | 40 // ioctls). |
| 40 SpawnWithTerminal( | 41 SpawnWithTerminal(array<uint8> path, |
| 41 array<uint8> path, | 42 array<array<uint8>>? argv, |
| 42 array<array<uint8>>? argv, | 43 array<array<uint8>>? envp, |
| 43 array<array<uint8>>? envp, | 44 mojo.files.File terminal_file, |
| 44 mojo.files.File terminal_file, | 45 ProcessController& process_controller) |
| 45 ProcessController& process_controller) => (mojo.files.Error error); | 46 => (mojo.files.Error error); |
| 46 }; | 47 }; |
| 47 | 48 |
| 48 // Interface for controlling a process started by one of |Process|'s facilities | 49 // Interface for controlling a process started by one of |Process|'s facilities |
| 49 // (in particular, |Spawn()| or |SpawnWithTerminal()|). | 50 // (in particular, |Spawn()| or |SpawnWithTerminal()|). |
| 50 // TODO(vtl): What does it do if this is closed (without being detached)? Kill | 51 // TODO(vtl): What does it do if this is closed (without being detached)? Kill |
| 51 // with SIGHUP? | 52 // with SIGHUP? |
| 52 interface ProcessController { | 53 interface ProcessController { |
| 53 // Wait for process completion. | 54 // Wait for process completion. |
| 54 // TODO(vtl): Add options (e.g., timeout)? | 55 // TODO(vtl): Add options (e.g., timeout)? |
| 55 Wait() => (mojo.files.Error error, int32 exit_status); | 56 Wait() => (mojo.files.Error error, int32 exit_status); |
| 56 | 57 |
| 57 // Kill the process with the given signal (note: does not wait). |signal| | 58 // Kill the process with the given signal (note: does not wait). |signal| |
| 58 // should be nonnegative. This is not valid after a successful call to | 59 // should be nonnegative. This is not valid after a successful call to |
| 59 // |Wait()|. | 60 // |Wait()|. |
| 60 // TODO(vtl): Add constants for signals. (For standard POSIX signals, the | 61 // TODO(vtl): Add constants for signals. (For standard POSIX signals, the |
| 61 // values should be the same as the POSIX-specified values, so using POSIX | 62 // values should be the same as the POSIX-specified values, so using POSIX |
| 62 // macros for the values should always be OK.) | 63 // macros for the values should always be OK.) |
| 63 Kill(int32 signal) => (mojo.files.Error error); | 64 Kill(int32 signal) => (mojo.files.Error error); |
| 64 | 65 |
| 65 // TODO(vtl): Add a "Detach()"? | 66 // TODO(vtl): Add a "Detach()"? |
| 66 }; | 67 }; |
| OLD | NEW |