From 0832ec5d96e3f0d4e7524bb5fecfda3088ae7a3f Mon Sep 17 00:00:00 2001 From: "Ngo Iok Ui (Wu Yu Wei)" Date: Sat, 21 Jun 2025 11:32:18 +0900 Subject: [PATCH] constellation: add multiprocess support on Windows (#37580) Thanks to ipc-channel 0.20. It's now possible to enable multiprocess mode on Windows. Testing: On Windows, run `./mach build -r && ./mach run -r -- -M` We don't have any CI workflows run on multiprocess IIRC. Signed-off-by: Wu Yu Wei --- components/constellation/sandboxing.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/constellation/sandboxing.rs b/components/constellation/sandboxing.rs index b4c6e7a9a39..02a6f4ed6f6 100644 --- a/components/constellation/sandboxing.rs +++ b/components/constellation/sandboxing.rs @@ -2,10 +2,8 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ -#[cfg(not(windows))] -use std::env; use std::ffi::OsStr; -use std::process; +use std::{env, process}; #[cfg(any( target_os = "macos", @@ -142,10 +140,11 @@ pub fn content_process_sandbox_profile() { } #[cfg(any( + target_os = "windows", target_os = "android", target_env = "ohos", target_arch = "arm", - all(target_arch = "aarch64", not(target_os = "windows")) + target_arch = "aarch64" ))] pub fn spawn_multiprocess(content: UnprivilegedContent) -> Result { use ipc_channel::ipc::{IpcOneShotServer, IpcSender}; @@ -238,13 +237,12 @@ pub fn spawn_multiprocess(content: UnprivilegedContent) -> Result Result { - log::error!("Multiprocess is not supported on Windows or iOS."); + log::error!("Multiprocess is not supported on iOS."); process::exit(1); } -#[cfg(not(windows))] fn setup_common(command: &mut C, token: String) { C::arg(command, "--content-process"); C::arg(command, token);