From ae21f9674eee08e9f48d543ceb3fe019d82602f1 Mon Sep 17 00:00:00 2001 From: Jed Davis Date: Fri, 17 Jan 2025 03:16:27 +0000 Subject: [PATCH] Bug 1941910 - Use dummy ProcessWatcher on Android and iOS. r=ipc-reviewers,nika Differential Revision: https://phabricator.services.mozilla.com/D234433 --- ipc/chromium/moz.build | 10 +++++++++- .../src/chrome/common/process_watcher_dummy.cc | 9 +++++++++ .../src/chrome/common/process_watcher_posix_sigchld.cc | 6 ++++++ 3 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 ipc/chromium/src/chrome/common/process_watcher_dummy.cc diff --git a/ipc/chromium/moz.build b/ipc/chromium/moz.build index 72e2dbb6dc10..0e8504f432bf 100644 --- a/ipc/chromium/moz.build +++ b/ipc/chromium/moz.build @@ -68,9 +68,17 @@ if CONFIG["TARGET_KERNEL"] != "WINNT": "src/base/thread_local_posix.cc", "src/base/waitable_event_posix.cc", "src/chrome/common/ipc_channel_posix.cc", - "src/chrome/common/process_watcher_posix_sigchld.cc", ] + if CONFIG["TARGET_OS"] in ("Android", "iOS"): + UNIFIED_SOURCES += [ + "src/chrome/common/process_watcher_dummy.cc", + ] + else: + UNIFIED_SOURCES += [ + "src/chrome/common/process_watcher_posix_sigchld.cc", + ] + if CONFIG["TARGET_KERNEL"] == "Darwin": UNIFIED_SOURCES += [ "src/base/message_pump_mac.mm", diff --git a/ipc/chromium/src/chrome/common/process_watcher_dummy.cc b/ipc/chromium/src/chrome/common/process_watcher_dummy.cc new file mode 100644 index 000000000000..3e1c014ce5df --- /dev/null +++ b/ipc/chromium/src/chrome/common/process_watcher_dummy.cc @@ -0,0 +1,9 @@ +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ +/* vim: set ts=8 sts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#include "chrome/common/process_watcher.h" + +void ProcessWatcher::EnsureProcessTerminated(base::ProcessHandle, bool) {} diff --git a/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc b/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc index 149a2716490a..71c41e1cf41c 100644 --- a/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc +++ b/ipc/chromium/src/chrome/common/process_watcher_posix_sigchld.cc @@ -30,6 +30,12 @@ # include "mozilla/ipc/ForkServiceChild.h" #endif +// Just to make sure the moz.build is doing the right things with +// TARGET_OS and/or OS_TARGET: +#if defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_UIKIT) +# error Unsupported OS +#endif + #if !defined(XP_DARWIN) // Linux, {Free,Net,Open}BSD, and Solaris; but not macOS, yet. # define HAVE_PIPE2 1