Skip to content

refactor: replace CHILD_PLUGIN with CHILD_EMBEDDER_FIRST on macOS - #50278

Merged
jkleinsc merged 1 commit into
mainfrom
rework-embedder-plugin
Mar 17, 2026
Merged

jkleinsc merged 1 commit into
mainfrom
rework-embedder-plugin

Conversation

@codebytere

Copy link
Copy Markdown
Member

Description of Change

Closes #50271

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.

Tested with:

const { app, utilityProcess } = require('electron');

app.whenReady().then(() => {
  const child = utilityProcess.fork('/dev/null', [], {
    allowLoadingUnsignedLibraries: true
  });

  child.on('spawn', () => {
    const { execSync } = require('child_process');
    // The process should be running as "Electron Helper (Plugin)"
    console.log(execSync(`ps aux | grep "Helper (Plugin)"`).toString());
    process.exit(0);
  });
})
Output

codebytere       52527   0.0  0.0 410060320     32   ??  S    12:05PM   0:00.00 /Users/codebytere/Developer/electron-gn/src/out/Testing/Electron.app/Contents/Frameworks/Electron Helper (Plugin).app/Contents/MacOS/Electron Helper (Plugin) --type=utility --utility-sub-type=node.mojom.NodeService --lang=en-US --service-sandbox-type=none --user-data-dir=/Users/codebytere/Library/Application Support/royal-quiver-resolve-52r5b --shared-files --field-trial-handle=1718379636,r,2625428615576881707,17048915519166431862,262144 --enable-features=PdfUseShowSaveFilePicker,ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma --disable-features=DropInputEventsWhilePaintHolding,LocalNetworkAccessChecks,MacWebContentsOcclusion,ScreenAIOCREnabled,SpareRendererForSitePerProcess,TimeoutHangingVideoCaptureStarts,TraceSiteInstanceGetProcessCreation --variations-seed-version --pseudonymization-salt-handle=1935764596,r,4873601938494529188,8777684506488938851,4 --trace-process-track-uuid=4343401777029354128
codebytere       12125   0.0  0.1 1890425968  62336   ??  S     9:56AM   0:00.69 /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/dist/serverWorkerMain --node-ipc --clientProcessId=7833

Checklist

Release Notes

Notes: none

@codebytere
codebytere requested a review from a team as a code owner March 16, 2026 11:12
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Mar 16, 2026
@codebytere codebytere added semver/patch backwards-compatible bug fixes and removed new-pr 🌱 PR opened recently labels Mar 16, 2026
@electron-cation electron-cation Bot added the new-pr 🌱 PR opened recently label Mar 16, 2026

@deepak1556 deepak1556 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@codebytere
codebytere force-pushed the rework-embedder-plugin branch 4 times, most recently from df79c4f to 809b8ea Compare March 17, 2026 08:48
@electron-cation electron-cation Bot removed the new-pr 🌱 PR opened recently label Mar 17, 2026
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.
@codebytere
codebytere force-pushed the rework-embedder-plugin branch from 809b8ea to 81172ce Compare March 17, 2026 16:20
@jkleinsc jkleinsc added target/42-x-y PR should also be added to the "42-x-y" branch. and removed no-backport labels Mar 17, 2026
@jkleinsc
jkleinsc merged commit 76331f0 into main Mar 17, 2026
64 checks passed
@jkleinsc
jkleinsc deleted the rework-embedder-plugin branch March 17, 2026 18:41
@release-clerk

release-clerk Bot commented Mar 17, 2026

Copy link
Copy Markdown

No Release Notes

@trop

trop Bot commented Mar 17, 2026

Copy link
Copy Markdown
Contributor

I have automatically backported this PR to "42-x-y", please check out #50321

@trop trop Bot added in-flight/42-x-y merged/42-x-y PR was merged to the "42-x-y" branch. and removed target/42-x-y PR should also be added to the "42-x-y" branch. in-flight/42-x-y labels Mar 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merged/42-x-y PR was merged to the "42-x-y" branch. semver/patch backwards-compatible bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove feat_restore_macos_child_plugin_process.patch

3 participants