codebytere

#53905: refactor: replace two Chromium patches with Electron-side code

Merged
Created: Sep 14, 2026, 5:25:56 AM
Merged: Sep 14, 2026, 12:57:29 PM
1 comments
Target: main

Description of Change

Two more Chromium patches can be replaced with Electron-side code. One commit per patch; each commit message says what the patch did and what replaces it.

Patch removed Electron-side replacement
remove_usage_of_incognito_apis_in_the_spellchecker.patch (and the profile_selections.cc hunks of chore_patch_out_profile_methods.patch) Electron builds //chrome's SpellcheckServiceFactory, which derives from ProfileKeyedServiceFactory. Instead of compiling chrome/browser/profiles/profile_keyed_service_factory.cc and profile_selections.cc and patching the Profile calls out of them, shell/browser/profiles defines the few members the factory needs: the constructors, a GetBrowserContextToUse() that returns the context it is given, and ProfileSelections construction.
devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch The frontend's DockController reads the currentDockState setting from the embedder preference store when it loads and docks itself through InspectorFrontendHost.setIsDocked(). InspectableWebContents resolves the requested dock side before loading the frontend and hands it out from GetPreferences(), so the setDockSide() call after load and the globalThis.EUI export it needed go away. The two specs that used EUI to switch panels import ui/legacy/legacy.js from the DevTools page instead.

Verified on Linux over a testing build: openDevTools({ mode }) docks right, left, bottom and undocked as requested (checked through DockController.dockSide() and the inspected page viewport), and the webContents DevTools specs, the devtools-extension cases in extensions-spec and webview-spec, the debugger specs and the spellchecker specs pass.

Checklist

Release Notes

Notes: none

Backports

No Backports Requested

This pull request doesn't have any backports requested or created for older release branches.

What are backports?

Backports are copies of changes made to the main branch that are applied to older release branches. They ensure that bug fixes and important changes are available in maintained older versions of Electron.

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