mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
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>
35 lines
1.3 KiB
C++
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_
|