#53677: refactor: replace five small Chromium patches with content API
Merged
Description of Change
Five Chromium patches that exist only to give Electron a hook can be replaced by content API that is already public. One commit per patch so each can be reviewed or reverted on its own; each commit message says what the patch did and what replaces it.
| Patch removed | Electron-side replacement |
|---|---|
add_contentgpuclient_precreatemessageloop_callback.patch |
ElectronGpuClient::PostSandboxInitialized(), which GpuMain already calls after Chromium's SetErrorMode, applies ELECTRON_DEFAULT_ERROR_MODE. A crash during GPU initialization itself no longer shows the system dialog; steady state is unchanged. |
add_ui_scopedcliboardwriter_writeunsaferawdata.patch |
ScopedClipboardWriter::WriteRawDataForTest(ClipboardFormatType::CustomPlatformType(format), bytes) ends in the same per-platform WriteData call as the patched WriteUnsafeRawData; it has no test-only behavior despite the name. |
feat_enable_passing_exit_code_on_service_process_crash.patch |
UtilityProcessWrapper observes BrowserChildProcessObserver::BrowserChildProcessCrashed/Killed, which carry ChildProcessTerminationInfo::exit_code and fire from OnChildDisconnected right after the service-process crash notification. Normal exits keep taking the code from the NodeService pipe. |
add_gin_converter_support_for_arraybufferview.patch |
The gin::Converter<v8::Local<v8::ArrayBufferView>> specialization moves next to Electron's existing Local<Array> / Local<String> ones in shell/common/gin_converters/std_converter.h. |
revert_partial_remove_unused_prehandlemouseevent.patch |
before-mouse-event is emitted from a weakly bound RenderWidgetHost::MouseEventCallback registered on each frame widget in HandleNewRenderFrame; those callbacks run in ForwardMouseEventWithLatencyInfo at the same point, with the same return-true-to-consume contract, as the delegate hook Chromium removed. |
Verified on Linux over a testing build: utilityProcess specs including the posix crash exit-code cases, clipboard specs, before-mouse-event / before-input-event, and the protocol/net stream and buffer specs pass. The GPU error-mode change is Windows-only and by inspection.
Checklist
- PR description included and stakeholders cc'd
-
npm testpasses - I have reviewed and verified the changes
Release Notes
Notes: none
Backports
44-x-y
PendingWaiting for a manual backport
45-x-y
PendingWaiting for a manual backport
Semver Impact
Major
Breaking changes
Minor
New features
Patch
Bug fixes
None
Docs, tests, etc.
Semantic Versioning helps users understand the impact of updates:
- Major (X.y.z): Breaking changes that may require code modifications
- Minor (x.Y.z): New features that maintain backward compatibility
- Patch (x.y.Z): Bug fixes that don't change the API
- None: Changes that don't affect using facing parts of Electron