Files
electron/shell/browser/electron_child_process_host_flags.h
trop[bot] 44ebbc11ed refactor: replace CHILD_PLUGIN with CHILD_EMBEDDER_FIRST on macOS (#50321)
refactor: replace CHILD_PLUGIN with CHILD_EMBEDDER_FIRST on macOS

Chromium removed upstream support for child plugin processes without
library validation in https://crbug.com/461717105, which we patched
back via feat_restore_macos_child_plugin_process.patch.

Chromium's CHILD_EMBEDDER_FIRST mechanism already provides the right
extensibility point for this: values > CHILD_EMBEDDER_FIRST are reserved
for embedders and resolved via ContentBrowserClient::GetChildProcessSuffix().
Chrome itself uses this pattern for its Alerts helper process.

This commit replaces the Chromium patch with an Electron-native
implementation.

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2026-03-18 10:14:05 +01:00

35 lines
1.3 KiB
C++

// Copyright (c) 2026 Microsoft GmbH. All rights reserved.
// Use of this source code is governed by the MIT license that can be
// found in the LICENSE file.
#ifndef ELECTRON_SHELL_BROWSER_ELECTRON_CHILD_PROCESS_HOST_FLAGS_H_
#define ELECTRON_SHELL_BROWSER_ELECTRON_CHILD_PROCESS_HOST_FLAGS_H_
#include "build/build_config.h"
#include "content/public/browser/child_process_host.h"
namespace electron {
// Flags for Electron-specific child processes to resolve the appropriate
// helper executable via ElectronBrowserClient::GetChildProcessSuffix().
enum class ElectronChildProcessHostFlags {
#if BUILDFLAG(IS_MAC)
// Starts a child process with macOS entitlements that disable library
// validation and allow unsigned executable memory. This allows the process
// to load third-party libraries not signed by the same Team ID as the main
// executable.
kChildProcessHelperPlugin =
content::ChildProcessHost::CHILD_EMBEDDER_FIRST + 1,
#endif // BUILDFLAG(IS_MAC)
};
#if BUILDFLAG(IS_MAC)
// Helper app name suffix for the plugin child process. This must match the
// corresponding entry in Electron's BUILD.gn electron_plugin_helper_params.
inline constexpr const char kElectronMacHelperSuffixPlugin[] = " (Plugin)";
#endif // BUILDFLAG(IS_MAC)
} // namespace electron
#endif // ELECTRON_SHELL_BROWSER_ELECTRON_CHILD_PROCESS_HOST_FLAGS_H_