mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 21:00:42 +02:00
Currently, Subprocess.jsm on Unix uses js-ctypes to call `posix_spawn`. This has some issues, primarily that file descriptors are inherited by the child process unless explicitly opted-out, which unfortunately a lot of code doesn't do. This patch changes it to use IPC process launching, where fd inheritance is opt-in, by: 1. Extending `base::LaunchApp` to handle a few features that Subprocess needs (setting the process's working directory, specifying the full environment, and the macOS `disclaim` flag) 2. Adding a WebIDL method to `IOUtils` to expose that function to JS (currently Unix-only; Windows could also be supported but it would probably want to use a different IDL type for strings, given that the OS APIs use 16-bit code units). 3. Replacing the part of Subprocess that invokes `posix_spawn` (and related functions) by calling that method; the rest of Subprocess's machinery to manage pipes and I/O is unchanged. (The Windows backend is also unchanged; I'm not aware of any functional issues there.) This results in some dead code, which is removed. Differential Revision: https://phabricator.services.mozilla.com/D152336 |
||
|---|---|---|
| .. | ||
| docs | ||
| test/xpcshell | ||
| .eslintrc.js | ||
| moz.build | ||
| Subprocess.jsm | ||
| subprocess_common.jsm | ||
| subprocess_shared.js | ||
| subprocess_shared_unix.js | ||
| subprocess_shared_win.js | ||
| subprocess_unix.jsm | ||
| subprocess_win.jsm | ||
| subprocess_worker_common.js | ||
| subprocess_worker_unix.js | ||
| subprocess_worker_win.js | ||