Browse Source

Merge remote-tracking branch 'origin/main' into replace-browserview

Jeremy Rose 2 years ago
parent
commit
d3c53124f6
100 changed files with 1107 additions and 818 deletions
  1. 15 20
      .circleci/config/base.yml
  2. 6 0
      .github/workflows/update_appveyor_image.yml
  3. 3 3
      BUILD.gn
  4. 2 3
      DEPS
  5. 3 2
      appveyor-bake.yml
  6. 1 1
      appveyor-woa.yml
  7. 1 1
      appveyor.yml
  8. 8 2
      build/zip.py
  9. 0 1
      docs/README.md
  10. 6 9
      docs/api/app.md
  11. 1 1
      docs/api/auto-updater.md
  12. 5 5
      docs/api/browser-window.md
  13. 2 0
      docs/api/client-request.md
  14. 5 3
      docs/api/native-image.md
  15. 20 2
      docs/api/net.md
  16. 18 13
      docs/api/notification.md
  17. 88 24
      docs/api/protocol.md
  18. 1 1
      docs/api/push-notifications.md
  19. 34 0
      docs/api/session.md
  20. 4 4
      docs/api/structures/upload-file.md
  21. 0 93
      docs/api/synopsis.md
  22. 3 3
      docs/api/system-preferences.md
  23. 31 41
      docs/api/web-contents.md
  24. 84 0
      docs/breaking-changes.md
  25. 1 1
      docs/development/creating-api.md
  26. 1 1
      docs/development/debugging-on-windows.md
  27. 2 2
      docs/faq.md
  28. 1 0
      docs/fiddles/features/web-bluetooth/index.html
  29. 18 3
      docs/fiddles/features/web-bluetooth/main.js
  30. 1 0
      docs/fiddles/features/web-bluetooth/preload.js
  31. 6 0
      docs/fiddles/features/web-bluetooth/renderer.js
  32. 0 2
      docs/fiddles/features/web-usb/main.js
  33. 1 1
      docs/fiddles/features/web-usb/renderer.js
  34. 1 1
      docs/fiddles/menus/customize-menus/index.html
  35. BIN
      docs/images/notification-main.png
  36. BIN
      docs/images/notification-renderer.png
  37. 1 1
      docs/tutorial/code-signing.md
  38. 86 76
      docs/tutorial/notifications.md
  39. 1 1
      docs/tutorial/recent-documents.md
  40. 1 1
      docs/tutorial/tutorial-6-publishing-updating.md
  41. 1 1
      docs/tutorial/using-native-node-modules.md
  42. 0 1
      filenames.auto.gni
  43. 0 2
      filenames.gni
  44. 31 3
      filenames.libcxx.gni
  45. 22 7
      lib/browser/api/net-client-request.ts
  46. 7 3
      lib/browser/api/net-fetch.ts
  47. 126 29
      lib/browser/api/protocol.ts
  48. 2 1
      lib/browser/api/session.ts
  49. 1 1
      package.json
  50. 0 1
      patches/angle/.patches
  51. 0 66
      patches/angle/fix_rename_webswapcgllayer_to_webswapcgllayerchromium.patch
  52. 2 2
      patches/boringssl/expose_aes-cfb.patch
  53. 1 1
      patches/boringssl/expose_ripemd160.patch
  54. 5 5
      patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch
  55. 3 2
      patches/chromium/.patches
  56. 3 3
      patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
  57. 16 16
      patches/chromium/add_didinstallconditionalfeatures.patch
  58. 2 2
      patches/chromium/add_electron_deps_to_license_credits_file.patch
  59. 60 0
      patches/chromium/add_gin_converter_support_for_arraybufferview.patch
  60. 50 29
      patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch
  61. 4 4
      patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch
  62. 11 11
      patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch
  63. 10 10
      patches/chromium/allow_in-process_windows_to_have_different_web_prefs.patch
  64. 1 1
      patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch
  65. 6 6
      patches/chromium/blink_local_frame.patch
  66. 1 1
      patches/chromium/boringssl_build_gn.patch
  67. 3 3
      patches/chromium/build_add_electron_tracing_category.patch
  68. 8 8
      patches/chromium/build_disable_partition_alloc_on_mac.patch
  69. 19 20
      patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch
  70. 1 1
      patches/chromium/build_gn.patch
  71. 1 1
      patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch
  72. 58 50
      patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch
  73. 23 23
      patches/chromium/can_create_window.patch
  74. 6 6
      patches/chromium/chore_add_electron_deps_to_gitignores.patch
  75. 12 12
      patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
  76. 23 0
      patches/chromium/chore_defer_usb_service_getdevices_request_until_usb_service_is.patch
  77. 5 5
      patches/chromium/chore_introduce_blocking_api_for_electron.patch
  78. 2 2
      patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch
  79. 3 3
      patches/chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch
  80. 24 24
      patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch
  81. 0 37
      patches/chromium/chrome_key_systems.patch
  82. 7 7
      patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch
  83. 4 4
      patches/chromium/custom_protocols_plzserviceworker.patch
  84. 2 2
      patches/chromium/dcheck.patch
  85. 4 4
      patches/chromium/desktop_media_list.patch
  86. 15 15
      patches/chromium/disable_color_correct_rendering.patch
  87. 2 2
      patches/chromium/disable_compositor_recycling.patch
  88. 4 4
      patches/chromium/disable_freezing_flags_after_init_in_node.patch
  89. 3 3
      patches/chromium/disable_hidden.patch
  90. 3 3
      patches/chromium/disable_unload_metrics.patch
  91. 3 3
      patches/chromium/enable_reset_aspect_ratio.patch
  92. 4 4
      patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch
  93. 10 10
      patches/chromium/expose_setuseragent_on_networkcontext.patch
  94. 2 2
      patches/chromium/expose_v8initializer_codegenerationcheckcallbackinmainthread.patch
  95. 4 4
      patches/chromium/extend_apply_webpreferences.patch
  96. 6 6
      patches/chromium/feat_add_data_parameter_to_processsingleton.patch
  97. 2 2
      patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch
  98. 1 1
      patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch
  99. 3 3
      patches/chromium/feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
  100. 13 14
      patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch

+ 15 - 20
.circleci/config/base.yml

@@ -54,7 +54,7 @@ executors:
         type: enum
         enum: ["macos.x86.medium.gen2", "large"]
     macos:
-      xcode: 13.3.0
+      xcode: 14.0.0
     resource_class: << parameters.size >>
 
   # Electron Runners
@@ -413,6 +413,15 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
         tmpify ~/.rubies
         tmpify ~/Library/Caches/Homebrew
         tmpify /usr/local/Homebrew
+
+        # the contents of build/linux/strip_binary.gni aren't used, but
+        # https://chromium-review.googlesource.com/c/chromium/src/+/4278307
+        # needs the file to exist.
+        mv ~/project/src/build/linux/strip_binary.gni "${TMPDIR}"/
+        tmpify ~/project/src/build/linux/
+        mkdir -p ~/project/src/build/linux
+        mv "${TMPDIR}/strip_binary.gni" ~/project/src/build/linux/
+
         sudo rm -rf $TMPDIR/del-target
 
         # sudo rm -rf "/System/Library/Desktop Pictures"
@@ -434,7 +443,6 @@ step-get-more-space-on-mac: &step-get-more-space-on-mac
         # sudo rm -rf /System/Library/PreferencePanes
         # sudo rm -rf /System/Library/AssetsV2/*
         sudo rm -rf /Applications/Safari.app
-        sudo rm -rf ~/project/src/build/linux
         sudo rm -rf ~/project/src/third_party/catapult/tracing/test_data
         sudo rm -rf ~/project/src/third_party/angle/third_party/VK-GL-CTS
 
@@ -962,26 +970,13 @@ step-ts-compile: &step-ts-compile
 # List of all steps.
 steps-electron-gn-check: &steps-electron-gn-check
   steps:
-    - *step-checkout-electron
-    - *step-depot-tools-get
-    - *step-depot-tools-add-to-path
     - install-python2-mac
-    - *step-setup-env-for-build
     - *step-setup-goma-for-build
-    - *step-generate-deps-hash
-    - *step-touch-sync-done
-    - maybe-restore-portaled-src-cache
-    - run:
-        name: Ensure src checkout worked
-        command: |
-          if [ ! -d "src/third_party/blink" ]; then
-            echo src cache was not restored for an unknown reason
-            exit 1
-          fi
-    - run:
-        name: Wipe Electron
-        command: rm -rf src/electron
-    - *step-checkout-electron
+    - checkout-from-cache
+    - *step-setup-env-for-build
+    - *step-wait-for-goma
+    - *step-gn-gen-default
+    - *step-gn-check
 
 steps-electron-ts-compile-for-doc-change: &steps-electron-ts-compile-for-doc-change
   steps:

+ 6 - 0
.github/workflows/update_appveyor_image.yml

@@ -47,6 +47,12 @@ jobs:
         diff -w -B appveyor.yml appveyor2.yml > appveyor.diff || true
         patch -f appveyor.yml < appveyor.diff
         rm appveyor2.yml appveyor.diff
+    - name: (Optionally) Generate Commit Diff for WOA
+      if: ${{ env.APPVEYOR_IMAGE_VERSION }}
+      run: |
+        diff -w -B appveyor-woa.yml appveyor-woa2.yml > appveyor-woa.diff || true
+        patch -f appveyor-woa.yml < appveyor-woa.diff
+        rm appveyor-woa2.yml appveyor-woa.diff
     - name: (Optionally) Commit and Pull Request
       if: ${{ env.APPVEYOR_IMAGE_VERSION }}
       uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04 # v4.2.3

+ 3 - 3
BUILD.gn

@@ -1,7 +1,7 @@
 import("//build/config/locales.gni")
 import("//build/config/ui.gni")
 import("//build/config/win/manifest.gni")
-import("//components/os_crypt/features.gni")
+import("//components/os_crypt/sync/features.gni")
 import("//components/spellcheck/spellcheck_build_features.gni")
 import("//content/public/app/mac_helpers.gni")
 import("//extensions/buildflags/buildflags.gni")
@@ -433,7 +433,7 @@ source_set("electron_lib") {
     "//components/network_hints/renderer",
     "//components/network_session_configurator/common",
     "//components/omnibox/browser:buildflags",
-    "//components/os_crypt",
+    "//components/os_crypt/sync",
     "//components/pref_registry",
     "//components/prefs",
     "//components/security_state/content",
@@ -1277,7 +1277,7 @@ if (is_mac) {
       ]
 
       deps += [
-        "//components/browser_watcher:browser_watcher_client",
+        "//chrome/app:exit_code_watcher",
         "//components/crash/core/app:run_as_crashpad_handler",
       ]
 

+ 2 - 3
DEPS

@@ -2,9 +2,9 @@ gclient_gn_args_from = 'src'
 
 vars = {
   'chromium_version':
-    '111.0.5560.0',
+    '113.0.5670.0',
   'node_version':
-    'v18.14.2',
+    'v18.15.0',
   'nan_version':
     '16fa32231e2ccd89d2804b3f765319128b20c4ac',
   'squirrel.mac_version':
@@ -149,5 +149,4 @@ hooks = [
 
 recursedeps = [
   'src',
-  'src/third_party/squirrel.mac',
 ]

+ 3 - 2
appveyor-bake.yml

@@ -6,7 +6,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-111.0.5560.0-node18
+image: e-112.0.5607.0-vs2022
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default
@@ -82,7 +82,8 @@ build_script:
   - ps: Copy-Item -path .\.depshash -destination ..\.depshash
   - ps: cd ..\..
   - gclient sync --with_branch_heads --with_tags --nohooks
-  - ps: regsvr32 /s "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\DIA SDK\bin\amd64\msdia140.dll"
+  - ps: regsvr32 /s "C:\Program Files\Microsoft Visual Studio\2022\Community\DIA SDK\bin\amd64\msdia140.dll"
+  - ps: set vs2022_install="C:\Program Files\Microsoft Visual Studio\2022\Community"
 
 # The following lines are needed when baking from a completely new image (eg MicrosoftWindowsServer:WindowsServer:2019-Datacenter:latest via image: base-windows-server2019)
   # # Restart VM

+ 1 - 1
appveyor-woa.yml

@@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-111.0.5560.0-2
+image: e-113.0.5636.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default

+ 1 - 1
appveyor.yml

@@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electronhq-16-core
-image: e-111.0.5560.0-node18
+image: e-113.0.5636.0
 environment:
   GIT_CACHE_PATH: C:\Users\appveyor\libcc_cache
   ELECTRON_OUT_DIR: Default

+ 8 - 2
build/zip.py

@@ -10,7 +10,13 @@ EXTENSIONS_TO_SKIP = [
   '.mojom.js',
   '.mojom-lite.js',
   '.info',
-  '.m.js'
+  '.m.js',
+
+  # These are only needed for Chromium tests we don't run. Listed in
+  # 'extensions' because the mksnapshot zip has these under a subdirectory, and
+  # the PATHS_TO_SKIP is checked with |startswith|.
+  'dbgcore.dll',
+  'dbghelp.dll',
 ]
 
 PATHS_TO_SKIP = [
@@ -34,7 +40,7 @@ PATHS_TO_SKIP = [
   # Skip because these are outputs that we don't need.
   'resources/inspector',
   'gen/third_party/devtools-frontend/src',
-  'gen/ui/webui'
+  'gen/ui/webui',
 ]
 
 def skip_path(dep, dist_zip, target_cpu):

+ 0 - 1
docs/README.md

@@ -90,7 +90,6 @@ These individual tutorials expand on topics discussed in the guide above.
 
 ## API References
 
-* [Synopsis](api/synopsis.md)
 * [Process Object](api/process.md)
 * [Supported Command Line Switches](api/command-line-switches.md)
 * [Environment Variables](api/environment-variables.md)

+ 6 - 9
docs/api/app.md

@@ -23,8 +23,7 @@ The `app` object emits the following events:
 Emitted when the application has finished basic startup. On Windows and Linux,
 the `will-finish-launching` event is the same as the `ready` event; on macOS,
 this event represents the `applicationWillFinishLaunching` notification of
-`NSApplication`. You would usually set up listeners for the `open-file` and
-`open-url` events here, and start the crash reporter and auto updater.
+`NSApplication`.
 
 In most cases, you should do everything in the `ready` event handler.
 
@@ -128,8 +127,6 @@ Emitted when the user wants to open a URL with the application. Your application
 `Info.plist` file must define the URL scheme within the `CFBundleURLTypes` key, and
 set `NSPrincipalClass` to `AtomApplication`.
 
-You should call `event.preventDefault()` if you want to handle this event.
-
 As with the `open-file` event, be sure to register a listener for the `open-url`
 event early in your application startup to detect if the the application being
 is being opened to handle a URL. If you register the listener in response to a
@@ -1357,7 +1354,7 @@ This API must be called after the `ready` event is emitted.
 
 ### `app.showAboutPanel()`
 
-Show the app's about panel options. These options can be overridden with `app.setAboutPanelOptions(options)`.
+Show the app's about panel options. These options can be overridden with `app.setAboutPanelOptions(options)`. This function runs asynchronously.
 
 ### `app.setAboutPanelOptions(options)`
 
@@ -1513,18 +1510,18 @@ dock on macOS.
 
 A `boolean` property that returns  `true` if the app is packaged, `false` otherwise. For many apps, this property can be used to distinguish development and production environments.
 
-[tasks]:https://msdn.microsoft.com/en-us/library/windows/desktop/dd378460(v=vs.85).aspx#tasks
-[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
+[tasks]:https://learn.microsoft.com/en-us/windows/win32/shell/taskbar-extensions#tasks
+[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
 [electron-forge]: https://www.electronforge.io/
 [electron-packager]: https://github.com/electron/electron-packager
 [CFBundleURLTypes]: https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html#//apple_ref/doc/uid/TP40009249-102207-TPXREF115
-[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/library/mac/documentation/Carbon/Reference/LaunchServicesReference/#//apple_ref/c/func/LSCopyDefaultHandlerForURLScheme
+[LSCopyDefaultHandlerForURLScheme]: https://developer.apple.com/documentation/coreservices/1441725-lscopydefaulthandlerforurlscheme?language=objc
 [handoff]: https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/Handoff/HandoffFundamentals/HandoffFundamentals.html
 [activity-type]: https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSUserActivity_Class/index.html#//apple_ref/occ/instp/NSUserActivity/activityType
 [unity-requirement]: https://help.ubuntu.com/community/UnityLaunchersAndDesktopFiles#Adding_shortcuts_to_a_launcher
 [mas-builds]: ../tutorial/mac-app-store-submission-guide.md
 [Squirrel-Windows]: https://github.com/Squirrel/Squirrel.Windows
-[JumpListBeginListMSDN]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378398(v=vs.85).aspx
+[JumpListBeginListMSDN]: https://learn.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-icustomdestinationlist-beginlist
 [about-panel-options]: https://developer.apple.com/reference/appkit/nsapplication/1428479-orderfrontstandardaboutpanelwith?language=objc
 
 ### `app.name`

+ 1 - 1
docs/api/auto-updater.md

@@ -140,5 +140,5 @@ application starts.
 [installer]: https://github.com/electron/grunt-electron-installer
 [installer-lib]: https://github.com/electron/windows-installer
 [electron-forge-lib]: https://github.com/electron/forge
-[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
+[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
 [event-emitter]: https://nodejs.org/api/events.html#events_class_eventemitter

+ 5 - 5
docs/api/browser-window.md

@@ -629,7 +629,7 @@ Returns:
 * `event` Event
 * `command` string
 
-Emitted when an [App Command](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646275(v=vs.85).aspx)
+Emitted when an [App Command](https://learn.microsoft.com/en-us/windows/win32/inputdev/wm-appcommand)
 is invoked. These are typically related to keyboard media keys or browser
 commands, as well as the "Back" button built into some mice on Windows.
 
@@ -1668,13 +1668,13 @@ in the taskbar.
 #### `win.setAppDetails(options)` _Windows_
 
 * `options` Object
-  * `appId` string (optional) - Window's [App User Model ID](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391569(v=vs.85).aspx).
+  * `appId` string (optional) - Window's [App User Model ID](https://learn.microsoft.com/en-us/windows/win32/shell/appids).
     It has to be set, otherwise the other options will have no effect.
-  * `appIconPath` string (optional) - Window's [Relaunch Icon](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391573(v=vs.85).aspx).
+  * `appIconPath` string (optional) - Window's [Relaunch Icon](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchiconresource).
   * `appIconIndex` Integer (optional) - Index of the icon in `appIconPath`.
     Ignored when `appIconPath` is not set. Default is `0`.
-  * `relaunchCommand` string (optional) - Window's [Relaunch Command](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391571(v=vs.85).aspx).
-  * `relaunchDisplayName` string (optional) - Window's [Relaunch Display Name](https://msdn.microsoft.com/en-us/library/windows/desktop/dd391572(v=vs.85).aspx).
+  * `relaunchCommand` string (optional) - Window's [Relaunch Command](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchcommand).
+  * `relaunchDisplayName` string (optional) - Window's [Relaunch Display Name](https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-relaunchdisplaynameresource).
 
 Sets the properties for the window's taskbar button.
 

+ 2 - 0
docs/api/client-request.md

@@ -243,6 +243,8 @@ it is not allowed to add or remove a custom header.
 * `encoding` string (optional)
 * `callback` Function (optional)
 
+Returns `this`.
+
 Sends the last chunk of the request data. Subsequent write or end operations
 will not be allowed. The `finish` event is emitted just after the end operation.
 

+ 5 - 3
docs/api/native-image.md

@@ -49,7 +49,7 @@ quality, it is recommended to include at least the following sizes in the:
 
 Check the *Size requirements* section in [this article][icons].
 
-[icons]:https://msdn.microsoft.com/en-us/library/windows/desktop/dn742485(v=vs.85).aspx
+[icons]: https://learn.microsoft.com/en-us/windows/win32/uxguide/vis-icons
 
 ## High Resolution Image
 
@@ -119,13 +119,15 @@ Returns `NativeImage`
 
 Creates an empty `NativeImage` instance.
 
-### `nativeImage.createThumbnailFromPath(path, maxSize)` _macOS_ _Windows_
+### `nativeImage.createThumbnailFromPath(path, size)` _macOS_ _Windows_
 
 * `path` string - path to a file that we intend to construct a thumbnail out of.
-* `maxSize` [Size](structures/size.md) - the maximum width and height (positive numbers) the thumbnail returned can be. The Windows implementation will ignore `maxSize.height` and scale the height according to `maxSize.width`.
+* `size` [Size](structures/size.md) - the desired width and height (positive numbers) of the thumbnail.
 
 Returns `Promise<NativeImage>` - fulfilled with the file's thumbnail preview image, which is a [NativeImage](native-image.md).
 
+Note: The Windows implementation will ignore `size.height` and scale the height according to `size.width`.
+
 ### `nativeImage.createFromPath(path)`
 
 * `path` string

+ 20 - 2
docs/api/net.md

@@ -65,8 +65,8 @@ requests according to the specified protocol scheme in the `options` object.
 
 ### `net.fetch(input[, init])`
 
-* `input` string | [Request](https://nodejs.org/api/globals.html#request)
-* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) (optional)
+* `input` string | [GlobalRequest](https://nodejs.org/api/globals.html#request)
+* `init` [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options) & { bypassCustomProtocolHandlers?: boolean } (optional)
 
 Returns `Promise<GlobalResponse>` - see [Response](https://developer.mozilla.org/en-US/docs/Web/API/Response).
 
@@ -101,6 +101,24 @@ Limitations:
 * The `.type` and `.url` values of the returned `Response` object are
   incorrect.
 
+By default, requests made with `net.fetch` can be made to [custom
+protocols](protocol.md) as well as `file:`, and will trigger
+[webRequest](web-request.md) handlers if present. When the non-standard
+`bypassCustomProtocolHandlers` option is set in RequestInit, custom protocol
+handlers will not be called for this request. This allows forwarding an
+intercepted request to the built-in handler. [webRequest](web-request.md)
+handlers will still be triggered when bypassing custom protocols.
+
+```js
+protocol.handle('https', (req) => {
+  if (req.url === 'https://my-app.com') {
+    return new Response('<body>my app</body>')
+  } else {
+    return net.fetch(req, { bypassCustomProtocolHandlers: true })
+  }
+})
+```
+
 ### `net.isOnline()`
 
 Returns `boolean` - Whether there is currently internet connection.

+ 18 - 13
docs/api/notification.md

@@ -4,9 +4,12 @@
 
 Process: [Main](../glossary.md#main-process)
 
-## Using in the renderer process
+:::info Renderer process notifications
 
-If you want to show Notifications from a renderer process you should use the [HTML5 Notification API](../tutorial/notifications.md)
+If you want to show notifications from a renderer process you should use the
+[web Notifications API](../tutorial/notifications.md)
+
+:::
 
 ## Class: Notification
 
@@ -29,10 +32,10 @@ Returns `boolean` - Whether or not desktop notifications are supported on the cu
 ### `new Notification([options])`
 
 * `options` Object (optional)
-  * `title` string (optional) - A title for the notification, which will be shown at the top of the notification window when it is shown.
+  * `title` string (optional) - A title for the notification, which will be displayed at the top of the notification window when it is shown.
   * `subtitle` string (optional) _macOS_ - A subtitle for the notification, which will be displayed below the title.
   * `body` string (optional) - The body text of the notification, which will be displayed below the title or subtitle.
-  * `silent` boolean (optional) - Whether or not to emit an OS notification noise when showing the notification.
+  * `silent` boolean (optional) - Whether or not to suppress the OS notification noise when showing the notification.
   * `icon` (string | [NativeImage](native-image.md)) (optional) - An icon to use in the notification.
   * `hasReply` boolean (optional) _macOS_ - Whether or not to add an inline reply option to the notification.
   * `timeoutType` string (optional) _Linux_ _Windows_ - The timeout duration of the notification. Can be 'default' or 'never'.
@@ -47,8 +50,11 @@ Returns `boolean` - Whether or not desktop notifications are supported on the cu
 
 Objects created with `new Notification` emit the following events:
 
-**Note:** Some events are only available on specific operating systems and are
-labeled as such.
+:::info
+
+Some events are only available on specific operating systems and are labeled as such.
+
+:::
 
 #### Event: 'show'
 
@@ -56,7 +62,7 @@ Returns:
 
 * `event` Event
 
-Emitted when the notification is shown to the user, note this could be fired
+Emitted when the notification is shown to the user. Note that this event can be fired
 multiple times as a notification can be shown multiple times through the
 `show()` method.
 
@@ -106,14 +112,13 @@ Emitted when an error is encountered while creating and showing the native notif
 
 ### Instance Methods
 
-Objects created with `new Notification` have the following instance methods:
+Objects created with the `new Notification()` constructor have the following instance methods:
 
 #### `notification.show()`
 
-Immediately shows the notification to the user, please note this means unlike the
-HTML5 Notification implementation, instantiating a `new Notification` does
-not immediately show it to the user, you need to call this method before the OS
-will display it.
+Immediately shows the notification to the user. Unlike the web notification API,
+instantiating a `new Notification()` does not immediately show it to the user. Instead, you need to
+call this method before the OS will display it.
 
 If the notification has been shown before, this method will dismiss the previously
 shown notification and create a new one with identical properties.
@@ -160,7 +165,7 @@ A `boolean` property representing whether the notification has a reply action.
 
 A `string` property representing the urgency level of the notification. Can be 'normal', 'critical', or 'low'.
 
-Default is 'low' - see [NotifyUrgency](https://developer.gnome.org/notification-spec/#urgency-levels) for more information.
+Default is 'low' - see [NotifyUrgency](https://developer-old.gnome.org/notification-spec/#urgency-levels) for more information.
 
 #### `notification.timeoutType` _Linux_ _Windows_
 

+ 88 - 24
docs/api/protocol.md

@@ -8,15 +8,11 @@ An example of implementing a protocol that has the same effect as the
 `file://` protocol:
 
 ```javascript
-const { app, protocol } = require('electron')
-const path = require('path')
-const url = require('url')
+const { app, protocol, net } = require('electron')
 
 app.whenReady().then(() => {
-  protocol.registerFileProtocol('atom', (request, callback) => {
-    const filePath = url.fileURLToPath('file://' + request.url.slice('atom://'.length))
-    callback(filePath)
-  })
+  protocol.handle('atom', (request) =>
+    net.fetch('file://' + request.url.slice('atom://'.length)))
 })
 ```
 
@@ -38,14 +34,15 @@ to register it to that session explicitly.
 ```javascript
 const { session, app, protocol } = require('electron')
 const path = require('path')
+const url = require('url')
 
 app.whenReady().then(() => {
   const partition = 'persist:example'
   const ses = session.fromPartition(partition)
 
-  ses.protocol.registerFileProtocol('atom', (request, callback) => {
-    const url = request.url.substr(7)
-    callback({ path: path.normalize(`${__dirname}/${url}`) })
+  ses.protocol.handle('atom', (request) => {
+    const path = request.url.slice('atom://'.length)
+    return net.fetch(url.pathToFileURL(path.join(__dirname, path)))
   })
 
   mainWindow = new BrowserWindow({ webPreferences: { partition } })
@@ -109,7 +106,74 @@ The `<video>` and `<audio>` HTML elements expect protocols to buffer their
 responses by default. The `stream` flag configures those elements to correctly
 expect streaming responses.
 
-### `protocol.registerFileProtocol(scheme, handler)`
+### `protocol.handle(scheme, handler)`
+
+* `scheme` string - scheme to handle, for example `https` or `my-app`. This is
+  the bit before the `:` in a URL.
+* `handler` Function<[GlobalResponse](https://nodejs.org/api/globals.html#response) | Promise<GlobalResponse>>
+  * `request` [GlobalRequest](https://nodejs.org/api/globals.html#request)
+
+Register a protocol handler for `scheme`. Requests made to URLs with this
+scheme will delegate to this handler to determine what response should be sent.
+
+Either a `Response` or a `Promise<Response>` can be returned.
+
+Example:
+
+```js
+import { app, protocol } from 'electron'
+import { join } from 'path'
+import { pathToFileURL } from 'url'
+
+protocol.registerSchemesAsPrivileged([
+  {
+    scheme: 'app',
+    privileges: {
+      standard: true,
+      secure: true,
+      supportsFetchAPI: true
+    }
+  }
+])
+
+app.whenReady().then(() => {
+  protocol.handle('app', (req) => {
+    const { host, pathname } = new URL(req.url)
+    if (host === 'bundle') {
+      if (pathname === '/') {
+        return new Response('<h1>hello, world</h1>', {
+          headers: { 'content-type': 'text/html' }
+        })
+      }
+      // NB, this does not check for paths that escape the bundle, e.g.
+      // app://bundle/../../secret_file.txt
+      return net.fetch(pathToFileURL(join(__dirname, pathname)))
+    } else if (host === 'api') {
+      return net.fetch('https://api.my-server.com/' + pathname, {
+        method: req.method,
+        headers: req.headers,
+        body: req.body
+      })
+    }
+  })
+})
+```
+
+See the MDN docs for [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) and [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) for more details.
+
+### `protocol.unhandle(scheme)`
+
+* `scheme` string - scheme for which to remove the handler.
+
+Removes a protocol handler registered with `protocol.handle`.
+
+### `protocol.isProtocolHandled(scheme)`
+
+* `scheme` string
+
+Returns `boolean` - Whether `scheme` is already handled.
+
+### `protocol.registerFileProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -130,7 +194,7 @@ path or an object that has a `path` property, e.g. `callback(filePath)` or
 By default the `scheme` is treated like `http:`, which is parsed differently
 from protocols that follow the "generic URI syntax" like `file:`.
 
-### `protocol.registerBufferProtocol(scheme, handler)`
+### `protocol.registerBufferProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -154,7 +218,7 @@ protocol.registerBufferProtocol('atom', (request, callback) => {
 })
 ```
 
-### `protocol.registerStringProtocol(scheme, handler)`
+### `protocol.registerStringProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -170,7 +234,7 @@ The usage is the same with `registerFileProtocol`, except that the `callback`
 should be called with either a `string` or an object that has the `data`
 property.
 
-### `protocol.registerHttpProtocol(scheme, handler)`
+### `protocol.registerHttpProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -185,7 +249,7 @@ Registers a protocol of `scheme` that will send an HTTP request as a response.
 The usage is the same with `registerFileProtocol`, except that the `callback`
 should be called with an object that has the `url` property.
 
-### `protocol.registerStreamProtocol(scheme, handler)`
+### `protocol.registerStreamProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -234,7 +298,7 @@ protocol.registerStreamProtocol('atom', (request, callback) => {
 })
 ```
 
-### `protocol.unregisterProtocol(scheme)`
+### `protocol.unregisterProtocol(scheme)` _Deprecated_
 
 * `scheme` string
 
@@ -242,13 +306,13 @@ Returns `boolean` - Whether the protocol was successfully unregistered
 
 Unregisters the custom protocol of `scheme`.
 
-### `protocol.isProtocolRegistered(scheme)`
+### `protocol.isProtocolRegistered(scheme)` _Deprecated_
 
 * `scheme` string
 
 Returns `boolean` - Whether `scheme` is already registered.
 
-### `protocol.interceptFileProtocol(scheme, handler)`
+### `protocol.interceptFileProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -261,7 +325,7 @@ Returns `boolean` - Whether the protocol was successfully intercepted
 Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
 which sends a file as a response.
 
-### `protocol.interceptStringProtocol(scheme, handler)`
+### `protocol.interceptStringProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -274,7 +338,7 @@ Returns `boolean` - Whether the protocol was successfully intercepted
 Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
 which sends a `string` as a response.
 
-### `protocol.interceptBufferProtocol(scheme, handler)`
+### `protocol.interceptBufferProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -287,7 +351,7 @@ Returns `boolean` - Whether the protocol was successfully intercepted
 Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
 which sends a `Buffer` as a response.
 
-### `protocol.interceptHttpProtocol(scheme, handler)`
+### `protocol.interceptHttpProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -300,7 +364,7 @@ Returns `boolean` - Whether the protocol was successfully intercepted
 Intercepts `scheme` protocol and uses `handler` as the protocol's new handler
 which sends a new HTTP request as a response.
 
-### `protocol.interceptStreamProtocol(scheme, handler)`
+### `protocol.interceptStreamProtocol(scheme, handler)` _Deprecated_
 
 * `scheme` string
 * `handler` Function
@@ -313,7 +377,7 @@ Returns `boolean` - Whether the protocol was successfully intercepted
 Same as `protocol.registerStreamProtocol`, except that it replaces an existing
 protocol handler.
 
-### `protocol.uninterceptProtocol(scheme)`
+### `protocol.uninterceptProtocol(scheme)` _Deprecated_
 
 * `scheme` string
 
@@ -321,7 +385,7 @@ Returns `boolean` - Whether the protocol was successfully unintercepted
 
 Remove the interceptor installed for `scheme` and restore its original handler.
 
-### `protocol.isProtocolIntercepted(scheme)`
+### `protocol.isProtocolIntercepted(scheme)` _Deprecated_
 
 * `scheme` string
 

+ 1 - 1
docs/api/push-notifications.md

@@ -40,7 +40,7 @@ The `pushNotification` module has the following methods:
 
 Returns `Promise<string>`
 
-Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/sremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message.
+Registers the app with Apple Push Notification service (APNS) to receive [Badge, Sound, and Alert](https://developer.apple.com/documentation/appkit/nsremotenotificationtype?language=objc) notifications. If registration is successful, the promise will be resolved with the APNS device token. Otherwise, the promise will be rejected with an error message.
 See: https://developer.apple.com/documentation/appkit/nsapplication/1428476-registerforremotenotificationtyp?language=objc
 
 ### `pushNotifications.unregisterForAPNSNotifications()` _macOS_

+ 34 - 0
docs/api/session.md

@@ -42,6 +42,22 @@ To create a `Session` with `options`, you have to ensure the `Session` with the
 `partition` has never been used before. There is no way to change the `options`
 of an existing `Session` object.
 
+### `session.fromPath(path[, options])`
+
+* `path` string
+* `options` Object (optional)
+  * `cache` boolean - Whether to enable cache.
+
+Returns `Session` - A session instance from the absolute path as specified by the `path`
+string. When there is an existing `Session` with the same absolute path, it
+will be returned; otherwise a new `Session` instance will be created with `options`. The
+call will throw an error if the path is not an absolute path. Additionally, an error will
+be thrown if an empty string is provided.
+
+To create a `Session` with `options`, you have to ensure the `Session` with the
+`path` has never been used before. There is no way to change the `options`
+of an existing `Session` object.
+
 ## Properties
 
 The `session` module has the following properties:
@@ -768,6 +784,24 @@ Limitations:
 * The `.type` and `.url` values of the returned `Response` object are
   incorrect.
 
+By default, requests made with `net.fetch` can be made to [custom
+protocols](protocol.md) as well as `file:`, and will trigger
+[webRequest](web-request.md) handlers if present. When the non-standard
+`bypassCustomProtocolHandlers` option is set in RequestInit, custom protocol
+handlers will not be called for this request. This allows forwarding an
+intercepted request to the built-in handler. [webRequest](web-request.md)
+handlers will still be triggered when bypassing custom protocols.
+
+```js
+protocol.handle('https', (req) => {
+  if (req.url === 'https://my-app.com') {
+    return new Response('<body>my app</body>')
+  } else {
+    return net.fetch(req, { bypassCustomProtocolHandlers: true })
+  }
+})
+```
+
 #### `ses.disableNetworkEmulation()`
 
 Disables any network emulation already active for the `session`. Resets to

+ 4 - 4
docs/api/structures/upload-file.md

@@ -2,8 +2,8 @@
 
 * `type` 'file' - `file`.
 * `filePath` string - Path of file to be uploaded.
-* `offset` Integer - Defaults to `0`.
-* `length` Integer - Number of bytes to read from `offset`.
+* `offset` Integer (optional) - Defaults to `0`.
+* `length` Integer (optional) - Number of bytes to read from `offset`.
   Defaults to `0`.
-* `modificationTime` Double - Last Modification time in
-  number of seconds since the UNIX epoch.
+* `modificationTime` Double (optional) - Last Modification time in
+  number of seconds since the UNIX epoch. Defaults to `0`.

+ 0 - 93
docs/api/synopsis.md

@@ -1,93 +0,0 @@
-# Synopsis
-
-> How to use Node.js and Electron APIs.
-
-All of [Node.js's built-in modules](https://nodejs.org/api/) are available in
-Electron and third-party node modules also fully supported as well (including
-the [native modules](../tutorial/using-native-node-modules.md)).
-
-Electron also provides some extra built-in modules for developing native
-desktop applications. Some modules are only available in the main process, some
-are only available in the renderer process (web page), and some can be used in
-either process type.
-
-The basic rule is: if a module is [GUI][gui] or low-level system related, then
-it should be only available in the main process. You need to be familiar with
-the concept of main process vs. renderer process
-scripts to be able to use those modules.
-
-The main process script is like a normal Node.js script:
-
-```javascript
-const { app, BrowserWindow } = require('electron')
-let win = null
-
-app.whenReady().then(() => {
-  win = new BrowserWindow({ width: 800, height: 600 })
-  win.loadURL('https://github.com')
-})
-```
-
-The renderer process is no different than a normal web page, except for the
-extra ability to use node modules if `nodeIntegration` is enabled:
-
-```html
-<!DOCTYPE html>
-<html>
-<body>
-<script>
-  const fs = require('fs')
-  console.log(fs.readFileSync(__filename, 'utf8'))
-</script>
-</body>
-</html>
-```
-
-## Destructuring assignment
-
-As of 0.37, you can use
-[destructuring assignment][destructuring-assignment] to make it easier to use
-built-in modules.
-
-```javascript
-const { app, BrowserWindow } = require('electron')
-
-let win
-
-app.whenReady().then(() => {
-  win = new BrowserWindow()
-  win.loadURL('https://github.com')
-})
-```
-
-If you need the entire `electron` module, you can require it and then using
-destructuring to access the individual modules from `electron`.
-
-```javascript
-const electron = require('electron')
-const { app, BrowserWindow } = electron
-
-let win
-
-app.whenReady().then(() => {
-  win = new BrowserWindow()
-  win.loadURL('https://github.com')
-})
-```
-
-This is equivalent to the following code:
-
-```javascript
-const electron = require('electron')
-const app = electron.app
-const BrowserWindow = electron.BrowserWindow
-let win
-
-app.whenReady().then(() => {
-  win = new BrowserWindow()
-  win.loadURL('https://github.com')
-})
-```
-
-[gui]: https://en.wikipedia.org/wiki/Graphical_user_interface
-[destructuring-assignment]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment

+ 3 - 3
docs/api/system-preferences.md

@@ -235,7 +235,7 @@ if (browserOptions.transparent) {
 }
 ```
 
-[dwm-composition]:https://msdn.microsoft.com/en-us/library/windows/desktop/aa969540.aspx
+[dwm-composition]: https://learn.microsoft.com/en-us/windows/win32/dwm/composition-ovw
 
 ### `systemPreferences.getAccentColor()` _Windows_ _macOS_
 
@@ -336,8 +336,8 @@ See the [Windows docs][windows-colors] and the [macOS docs][macos-colors] for mo
 
 The following colors are only available on macOS 10.14: `find-highlight`, `selected-content-background`, `separator`, `unemphasized-selected-content-background`, `unemphasized-selected-text-background`, and `unemphasized-selected-text`.
 
-[windows-colors]:https://msdn.microsoft.com/en-us/library/windows/desktop/ms724371(v=vs.85).aspx
-[macos-colors]:https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#dynamic-system-colors
+[windows-colors]: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getsyscolor
+[macos-colors]: https://developer.apple.com/design/human-interface-guidelines/macos/visual-design/color#dynamic-system-colors
 
 ### `systemPreferences.getSystemColor(color)` _macOS_
 

+ 31 - 41
docs/api/web-contents.md

@@ -635,6 +635,15 @@ Emitted when media starts playing.
 
 Emitted when media is paused or done playing.
 
+#### Event: 'audio-state-changed'
+
+Returns:
+
+* `event` Event<>
+  * `audible` boolean - True if one or more frames or child `webContents` are emitting audio.
+
+Emitted when media becomes audible or inaudible.
+
 #### Event: 'did-change-theme-color'
 
 Returns:
@@ -768,20 +777,24 @@ Returns:
 * `callback` Function
   * `deviceId` string
 
-Emitted when bluetooth device needs to be selected on call to
-`navigator.bluetooth.requestDevice`. To use `navigator.bluetooth` api
-`webBluetooth` should be enabled. If `event.preventDefault` is not called,
-first available device will be selected. `callback` should be called with
-`deviceId` to be selected, passing empty string to `callback` will
-cancel the request.
+Emitted when a bluetooth device needs to be selected when a call to
+`navigator.bluetooth.requestDevice` is made. `callback` should be called with
+the `deviceId` of the device to be selected.  Passing an empty string to
+`callback` will cancel the request.
 
-If no event listener is added for this event, all bluetooth requests will be cancelled.
+If an event listener is not added for this event, or if `event.preventDefault`
+is not called when handling this event, the first available device will be
+automatically selected.
 
-```javascript
+Due to the nature of bluetooth, scanning for devices when
+`navigator.bluetooth.requestDevice` is called may take time and will cause
+`select-bluetooth-device` to fire multiple times until `callback` is called
+with either a device id or an empty string to cancel the request.
+
+```javascript title='main.js'
 const { app, BrowserWindow } = require('electron')
 
 let win = null
-app.commandLine.appendSwitch('enable-experimental-web-platform-features')
 
 app.whenReady().then(() => {
   win = new BrowserWindow({ width: 800, height: 600 })
@@ -791,6 +804,9 @@ app.whenReady().then(() => {
       return device.deviceName === 'test'
     })
     if (!result) {
+      // The device wasn't found so we need to either wait longer (eg until the
+      // device is turned on) or cancel the request by calling the callback 
+      // with an empty string.
       callback('')
     } else {
       callback(result.deviceId)
@@ -1622,7 +1638,7 @@ ipcMain.on('open-devtools', (event, targetContentsId, devtoolsContentsId) => {
 
 An example of showing devtools in a `BrowserWindow`:
 
-```js
+```js title='main.js'
 const { app, BrowserWindow } = require('electron')
 
 let win = null
@@ -1705,40 +1721,14 @@ Algorithm][SCA], just like [`postMessage`][], so prototype chains will not be
 included. Sending Functions, Promises, Symbols, WeakMaps, or WeakSets will
 throw an exception.
 
-> **NOTE**: Sending non-standard JavaScript types such as DOM objects or
-> special Electron objects will throw an exception.
-
-The renderer process can handle the message by listening to `channel` with the
-[`ipcRenderer`](ipc-renderer.md) module.
+:::warning
 
-An example of sending messages from the main process to the renderer process:
-
-```javascript
-// In the main process.
-const { app, BrowserWindow } = require('electron')
-let win = null
+Sending non-standard JavaScript types such as DOM objects or
+special Electron objects will throw an exception.
 
-app.whenReady().then(() => {
-  win = new BrowserWindow({ width: 800, height: 600 })
-  win.loadURL(`file://${__dirname}/index.html`)
-  win.webContents.on('did-finish-load', () => {
-    win.webContents.send('ping', 'whoooooooh!')
-  })
-})
-```
+:::
 
-```html
-<!-- index.html -->
-<html>
-<body>
-  <script>
-    require('electron').ipcRenderer.on('ping', (event, message) => {
-      console.log(message) // Prints 'whoooooooh!'
-    })
-  </script>
-</body>
-</html>
-```
+For additional reading, refer to [Electron's IPC guide](../tutorial/ipc.md).
 
 #### `contents.sendToFrame(frameId, channel, ...args)`
 

+ 84 - 0
docs/breaking-changes.md

@@ -12,8 +12,92 @@ This document uses the following convention to categorize breaking changes:
 * **Deprecated:** An API was marked as deprecated. The API will continue to function, but will emit a deprecation warning, and will be removed in a future release.
 * **Removed:** An API or feature was removed, and is no longer supported by Electron.
 
+## Planned Breaking API Changes (25.0)
+
+### Deprecated: `protocol.{register,intercept}{Buffer,String,Stream,File,Http}Protocol`
+
+The `protocol.register*Protocol` and `protocol.intercept*Protocol` methods have
+been replaced with [`protocol.handle`](api/protocol.md#protocolhandlescheme-handler).
+
+The new method can either register a new protocol or intercept an existing
+protocol, and responses can be of any type.
+
+```js
+// Deprecated in Electron 25
+protocol.registerBufferProtocol('some-protocol', () => {
+  callback({ mimeType: 'text/html', data: Buffer.from('<h5>Response</h5>') })
+})
+
+// Replace with
+protocol.handle('some-protocol', () => {
+  return new Response(
+    Buffer.from('<h5>Response</h5>'), // Could also be a string or ReadableStream.
+    { headers: { 'content-type': 'text/html' } }
+  )
+})
+```
+
+```js
+// Deprecated in Electron 25
+protocol.registerHttpProtocol('some-protocol', () => {
+  callback({ url: 'https://electronjs.org' })
+})
+
+// Replace with
+protocol.handle('some-protocol', () => {
+  return net.fetch('https://electronjs.org')
+})
+```
+
+```js
+// Deprecated in Electron 25
+protocol.registerFileProtocol('some-protocol', () => {
+  callback({ filePath: '/path/to/my/file' })
+})
+
+// Replace with
+protocol.handle('some-protocol', () => {
+  return net.fetch('file:///path/to/my/file')
+})
+```
+
 ## Planned Breaking API Changes (24.0)
 
+### API Changed: `nativeImage.createThumbnailFromPath(path, size)`
+
+The `maxSize` parameter has been changed to `size` to reflect that the size passed in will be the size the thumbnail created. Previously, Windows would not scale the image up if it were smaller than `maxSize`, and
+macOS would always set the size to `maxSize`. Behavior is now the same across platforms.
+
+Updated Behavior:
+
+```js
+// a 128x128 image.
+const imagePath = path.join('path', 'to', 'capybara.png')
+
+// Scaling up a smaller image.
+const upSize = { width: 256, height: 256 }
+nativeImage.createThumbnailFromPath(imagePath, upSize).then(result => {
+  console.log(result.getSize()) // { width: 256, height: 256 }
+})
+
+// Scaling down a larger image.
+const downSize = { width: 64, height: 64 }
+nativeImage.createThumbnailFromPath(imagePath, downSize).then(result => {
+  console.log(result.getSize()) // { width: 64, height: 64 }
+})
+```
+
+Previous Behavior (on Windows):
+
+```js
+// a 128x128 image
+const imagePath = path.join('path', 'to', 'capybara.png')
+const size = { width: 256, height: 256 }
+nativeImage.createThumbnailFromPath(imagePath, size).then(result => {
+  console.log(result.getSize()) // { width: 128, height: 128 }
+})
+```
+
 ### Deprecated: `BrowserWindow.setTrafficLightPosition(position)`
 
 `BrowserWindow.setTrafficLightPosition(position)` has been deprecated, the

+ 1 - 1
docs/development/creating-api.md

@@ -158,7 +158,7 @@ We will need to create a new TypeScript file in the path that follows:
 
 `"lib/browser/api/{electron_browser_{api_name}}.ts"`
 
-An example of the contents of this file can be found [here](https://github.com/electron/electron/blob/main/lib/browser/api/native-image.ts).
+An example of the contents of this file can be found [here](https://github.com/electron/electron/blob/main/lib/browser/api/native-theme.ts).
 
 ### Expose your module to TypeScript
 

+ 1 - 1
docs/development/debugging-on-windows.md

@@ -89,7 +89,7 @@ For an introduction to ProcMon's basic and advanced debugging features, go check
 out [this video tutorial][procmon-instructions] provided by Microsoft.
 
 [sys-internals]: https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx
-[procmon-instructions]: https://channel9.msdn.com/shows/defrag-tools/defrag-tools-4-process-monitor
+[procmon-instructions]: https://learn.microsoft.com/en-us/shows/defrag-tools/4-process-monitor
 
 ## Using WinDbg
 <!-- TODO(@codebytere): add images and more information here? -->

+ 2 - 2
docs/faq.md

@@ -60,7 +60,7 @@ garbage collected.
 If you encounter this problem, the following articles may prove helpful:
 
 * [Memory Management][memory-management]
-* [Variable Scope][variable-scope]
+* [Closures][closures]
 
 If you want a quick fix, you can make the variables global by changing your
 code from this:
@@ -153,7 +153,7 @@ The effect is visible only on (some?) LCD screens. Even if you don't see a diffe
 Notice that just setting the background in the CSS does not have the desired effect.
 
 [memory-management]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Memory_Management
-[variable-scope]: https://msdn.microsoft.com/library/bzt2dkta(v=vs.94).aspx
+[closures]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Closures
 [storage]: https://developer.mozilla.org/en-US/docs/Web/API/Storage
 [local-storage]: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage
 [session-storage]: https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage

+ 1 - 0
docs/fiddles/features/web-bluetooth/index.html

@@ -9,6 +9,7 @@
     <h1>Web Bluetooth API</h1>
 
     <button id="clickme">Test Bluetooth</button>
+    <button id="cancel">Cancel Bluetooth Request</button>
 
     <p>Currently selected bluetooth device: <strong id="device-name""></strong></p>
 

+ 18 - 3
docs/fiddles/features/web-bluetooth/main.js

@@ -1,6 +1,9 @@
 const {app, BrowserWindow, ipcMain} = require('electron')
 const path = require('path')
 
+let bluetoothPinCallback 
+let selectBluetoothCallback
+
 function createWindow () {
   const mainWindow = new BrowserWindow({
     width: 800,
@@ -12,10 +15,22 @@ function createWindow () {
 
   mainWindow.webContents.on('select-bluetooth-device', (event, deviceList, callback) => {
     event.preventDefault()
-    if (deviceList && deviceList.length > 0) {
-      callback(deviceList[0].deviceId)
-    }
+    selectBluetoothCallback = callback
+    const result = deviceList.find((device) => {
+      return device.deviceName === 'test'
+    })
+    if (result) {
+      callback(result.deviceId)
+    } else {
+      // The device wasn't found so we need to either wait longer (eg until the
+      // device is turned on) or until the user cancels the request
+    }     
+  })
+
+  ipcMain.on('cancel-bluetooth-request', (event) => {
+    selectBluetoothCallback('')
   })
+  
 
   // Listen for a message from the renderer to get the response for the Bluetooth pairing.
   ipcMain.on('bluetooth-pairing-response', (event, response) => {

+ 1 - 0
docs/fiddles/features/web-bluetooth/preload.js

@@ -1,6 +1,7 @@
 const { contextBridge, ipcRenderer } = require('electron')
 
 contextBridge.exposeInMainWorld('electronAPI', {
+  cancelBluetoothRequest: (callback) => ipcRenderer.send('cancel-bluetooth-request', callback),
   bluetoothPairingRequest: (callback) => ipcRenderer.on('bluetooth-pairing-request', callback),
   bluetoothPairingResponse: (response) => ipcRenderer.send('bluetooth-pairing-response', response)
 })

+ 6 - 0
docs/fiddles/features/web-bluetooth/renderer.js

@@ -7,6 +7,12 @@ async function testIt() {
 
 document.getElementById('clickme').addEventListener('click',testIt)
 
+function cancelRequest() {
+  window.electronAPI.cancelBluetoothRequest()
+}
+
+document.getElementById('cancel').addEventListener('click', cancelRequest)
+
 window.electronAPI.bluetoothPairingRequest((event, details) => {
   const response = {}
 

+ 0 - 2
docs/fiddles/features/web-usb/main.js

@@ -1,5 +1,4 @@
 const {app, BrowserWindow} = require('electron')
-const e = require('express')
 const path = require('path')
 
 function createWindow () {
@@ -44,7 +43,6 @@ function createWindow () {
     }
   })
 
-
   mainWindow.webContents.session.setDevicePermissionHandler((details) => {
     if (details.deviceType === 'usb' && details.origin === 'file://') {
       if (!grantedDeviceThroughPermHandler) {

+ 1 - 1
docs/fiddles/features/web-usb/renderer.js

@@ -1,5 +1,5 @@
 function getDeviceDetails(device) {
-  return grantedDevice.productName || `Unknown device ${grantedDevice.deviceId}`
+  return device.productName || `Unknown device ${device.deviceId}`
 }
 
 async function testIt() {

+ 1 - 1
docs/fiddles/menus/customize-menus/index.html

@@ -70,7 +70,7 @@
               </li>
               <li>
                 <a
-                  href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb226797(v=vs.85).aspx"
+                  href="https://learn.microsoft.com/en-us/previous-versions/windows/desktop/bb226797"
                   >Windows<span
                     >(opens in new window)</span
                   ></a

BIN
docs/images/notification-main.png


BIN
docs/images/notification-renderer.png


+ 1 - 1
docs/tutorial/code-signing.md

@@ -95,7 +95,7 @@ Before signing Windows builds, you must do the following:
 You can get a code signing certificate from a lot of resellers. Prices vary, so
 it may be worth your time to shop around. Popular resellers include:
 
-- [digicert](https://www.digicert.com/code-signing/microsoft-authenticode.htm)
+- [digicert](https://www.digicert.com/dc/code-signing/microsoft-authenticode.htm)
 - [Sectigo](https://sectigo.com/ssl-certificates-tls/code-signing)
 - Amongst others, please shop around to find one that suits your needs! 😄
 

+ 86 - 76
docs/tutorial/notifications.md

@@ -1,98 +1,108 @@
 # Notifications
 
-## Overview
+Each operating system has its own mechanism to display notifications to users. Electron's notification
+APIs are cross-platform, but are different for each process type.
 
-All three operating systems provide means for applications to send
-notifications to the user. The technique of showing notifications is different
-for the Main and Renderer processes.
+If you want to use a renderer process API in the main process or vice-versa, consider using
+[inter-process communication](./ipc.md).
 
-For the Renderer process, Electron conveniently allows developers to send
-notifications with the [HTML5 Notification API](https://notifications.spec.whatwg.org/),
-using the currently running operating system's native notification APIs
-to display it.
+## Usage
 
-To show notifications in the Main process, you need to use the
-[Notification](../api/notification.md) module.
+Below are two examples showing how to display notifications for each process type.
 
-## Example
+### Show notifications in the main process
 
-### Show notifications in the Renderer process
+Main process notifications are displayed using Electron's [Notification module](../api/notification.md).
+Notification objects created using this module do not appear unless their `show()` instance
+method is called.
 
-Starting with a working application from the
-[Quick Start Guide](quick-start.md), add the following line to the
-`index.html` file before the closing `</body>` tag:
+```js title='Main Process'
+const { Notification } = require("electron");
 
-```html
-<script src="renderer.js"></script>
-```
-
-...and add the `renderer.js` file:
-
-```javascript fiddle='docs/fiddles/features/notifications/renderer'
-const NOTIFICATION_TITLE = 'Title'
-const NOTIFICATION_BODY = 'Notification from the Renderer process. Click to log to console.'
-const CLICK_MESSAGE = 'Notification clicked'
+const NOTIFICATION_TITLE = "Basic Notification";
+const NOTIFICATION_BODY = "Notification from the Main process";
 
-new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY })
-  .onclick = () => console.log(CLICK_MESSAGE)
+new Notification({
+  title: NOTIFICATION_TITLE,
+  body: NOTIFICATION_BODY,
+}).show();
 ```
 
-After launching the Electron application, you should see the notification:
-
-![Notification in the Renderer process](../images/notification-renderer.png)
+Here's a full example that you can open with Electron Fiddle:
 
-Additionally, if you click on the notification, the DOM will update to show "Notification clicked!".
+```javascript fiddle='docs/fiddles/features/notifications/main'
+const { Notification } = require("electron");
 
-### Show notifications in the Main process
+const NOTIFICATION_TITLE = "Basic Notification";
+const NOTIFICATION_BODY = "Notification from the Main process";
 
-Starting with a working application from the
-[Quick Start Guide](quick-start.md), update the `main.js` file with the following lines:
+new Notification({
+  title: NOTIFICATION_TITLE,
+  body: NOTIFICATION_BODY,
+}).show();
+```
 
-```javascript fiddle='docs/fiddles/features/notifications/main'
-const { Notification } = require('electron')
+### Show notifications in the renderer process
 
-const NOTIFICATION_TITLE = 'Basic Notification'
-const NOTIFICATION_BODY = 'Notification from the Main process'
+Notifications can be displayed directly from the renderer process with the
+[web Notifications API](https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API/Using_the_Notifications_API).
 
-const showNotification = () => {
-  new Notification({ title: NOTIFICATION_TITLE, body: NOTIFICATION_BODY }).show()
-}
+```js title='Renderer Process'
+const NOTIFICATION_TITLE = "Title";
+const NOTIFICATION_BODY =
+  "Notification from the Renderer process. Click to log to console.";
+const CLICK_MESSAGE = "Notification clicked";
 
-app.whenReady().then(createWindow).then(showNotification)
+new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
+  () => console.log(CLICK_MESSAGE);
 ```
 
-After launching the Electron application, you should see the system notification:
+Here's a full example that you can open with Electron Fiddle:
+
+```javascript fiddle='docs/fiddles/features/notifications/renderer'
+const NOTIFICATION_TITLE = "Title";
+const NOTIFICATION_BODY =
+  "Notification from the Renderer process. Click to log to console.";
+const CLICK_MESSAGE = "Notification clicked";
 
-![Notification in the Main process](../images/notification-main.png)
+new Notification(NOTIFICATION_TITLE, { body: NOTIFICATION_BODY }).onclick =
+  () => console.log(CLICK_MESSAGE);
+```
 
-## Additional information
+## Platform considerations
 
 While code and user experience across operating systems are similar, there
 are subtle differences.
 
 ### Windows
 
-* On Windows 10, a shortcut to your app with an
-[Application User Model ID][app-user-model-id] must be installed to the
-Start Menu. This can be overkill during development, so adding
-`node_modules\electron\dist\electron.exe` to your Start Menu also does the
-trick. Navigate to the file in Explorer, right-click and 'Pin to Start Menu'.
-You will then need to add the line `app.setAppUserModelId(process.execPath)` to
-your main process to see notifications.
+For notifications on Windows, your Electron app needs to have a Start Menu shortcut with an
+[AppUserModelID][app-user-model-id] and a corresponding [ToastActivatorCLSID][toast-activator-clsid].
+
+Electron attempts to automate the work around the AppUserModelID and ToastActivatorCLSID. When
+Electron is used together with Squirrel.Windows (e.g. if you're using electron-winstaller),
+[shortcuts will automatically be set correctly][squirrel-events].
 
-Electron attempts to automate the work around the Application User Model ID. When
-Electron is used together with the installation and update framework Squirrel,
-[shortcuts will automatically be set correctly][squirrel-events]. Furthermore,
-Electron will detect that Squirrel was used and will automatically call
+In production, Electron will also detect that Squirrel was used and will automatically call
 `app.setAppUserModelId()` with the correct value. During development, you may have
 to call [`app.setAppUserModelId()`][set-app-user-model-id] yourself.
 
-#### Advanced Notifications
+:::info Notifications in development
+
+To quickly bootstrap notifications during development, adding
+`node_modules\electron\dist\electron.exe` to your Start Menu also does the
+trick. Navigate to the file in Explorer, right-click and 'Pin to Start Menu'.
+Then, call `app.setAppUserModelId(process.execPath)` in the main process to see notifications.
+
+:::
 
-Later versions of Windows allow for advanced notifications, with custom templates,
-images, and other flexible elements. To send those notifications (from either the
-main process or the renderer process), use the userland module
-[electron-windows-notifications](https://github.com/felixrieseberg/electron-windows-notifications),
+#### Use advanced notifications
+
+Windows also allow for advanced notifications with custom templates, images, and other flexible
+elements.
+
+To send those notifications from the main process, you can use the userland module
+[`electron-windows-notifications`](https://github.com/felixrieseberg/electron-windows-notifications),
 which uses native Node addons to send `ToastNotification` and `TileNotification` objects.
 
 While notifications including buttons work with `electron-windows-notifications`,
@@ -101,41 +111,41 @@ handling replies requires the use of
 which helps with registering the required COM components and calling your
 Electron app with the entered user data.
 
-#### Quiet Hours / Presentation Mode
+#### Query notification state
 
 To detect whether or not you're allowed to send a notification, use the
-userland module [electron-notification-state](https://github.com/felixrieseberg/electron-notification-state).
+userland module [`windows-notification-state`][windows-notification-state].
 
-This allows you to determine ahead of time whether or not Windows will
-silently throw the notification away.
+This module allows you to determine ahead of time whether or not Windows will silently throw the
+notification away.
 
 ### macOS
 
-Notifications are straight-forward on macOS, but you should be aware of
+Notifications are straightforward on macOS, but you should be aware of
 [Apple's Human Interface guidelines regarding notifications][apple-notification-guidelines].
 
 Note that notifications are limited to 256 bytes in size and will be truncated
 if you exceed that limit.
 
-[apple-notification-guidelines]: https://developer.apple.com/macos/human-interface-guidelines/system-capabilities/notifications/
-
-#### Do not disturb / Session State
+#### Query notification state
 
 To detect whether or not you're allowed to send a notification, use the userland module
-[electron-notification-state][electron-notification-state].
-
-This will allow you to detect ahead of time whether or not the notification will be displayed.
+[`macos-notification-state`][macos-notification-state].
 
-[electron-notification-state]: https://github.com/felixrieseberg/electron-notification-state
+This module allows you to detect ahead of time whether or not the notification will be displayed.
 
 ### Linux
 
-Notifications are sent using `libnotify` which can show notifications on any
+Notifications are sent using `libnotify`, which can show notifications on any
 desktop environment that follows [Desktop Notifications
 Specification][notification-spec], including Cinnamon, Enlightenment, Unity,
-GNOME, KDE.
+GNOME, and KDE.
 
 [notification-spec]: https://developer-old.gnome.org/notification-spec/
-[app-user-model-id]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378459(v=vs.85).aspx
+[app-user-model-id]: https://learn.microsoft.com/en-us/windows/win32/shell/appids
 [set-app-user-model-id]: ../api/app.md#appsetappusermodelidid-windows
 [squirrel-events]: https://github.com/electron/windows-installer/blob/main/README.md#handling-squirrel-events
+[toast-activator-clsid]: https://learn.microsoft.com/en-us/windows/win32/properties/props-system-appusermodel-toastactivatorclsid
+[apple-notification-guidelines]: https://developer.apple.com/macos/human-interface-guidelines/system-capabilities/notifications/
+[windows-notification-state]: https://github.com/felixrieseberg/windows-notification-state
+[macos-notification-state]: https://github.com/felixrieseberg/macos-notification-state

+ 1 - 1
docs/tutorial/recent-documents.md

@@ -138,5 +138,5 @@ of `app` module will be emitted for it.
 [dock-menu-image]: https://cloud.githubusercontent.com/assets/639601/5069610/2aa80758-6e97-11e4-8cfb-c1a414a10774.png
 [addrecentdocument]: ../api/app.md#appaddrecentdocumentpath-macos-windows
 [clearrecentdocuments]: ../api/app.md#appclearrecentdocuments-macos-windows
-[app-registration]: https://msdn.microsoft.com/en-us/library/cc144104(VS.85).aspx
+[app-registration]: https://learn.microsoft.com/en-us/windows/win32/shell/app-registration
 [menu-item-image]: https://user-images.githubusercontent.com/3168941/33003655-ea601c3a-cd70-11e7-97fa-7c062149cfb1.png

+ 1 - 1
docs/tutorial/tutorial-6-publishing-updating.md

@@ -231,7 +231,7 @@ rest of our docs and happy developing! If you have questions, please stop by our
 [new-pat]: https://github.com/settings/tokens/new
 [publish command]: https://www.electronforge.io/cli#publish
 [publisher]: https://www.electronforge.io/config/publishers
-[`publishergithubconfig`]: https://js.electronforge.io/publisher/github/interfaces/publishergithubconfig
+[`publishergithubconfig`]: https://js.electronforge.io/interfaces/_electron_forge_publisher_github.PublisherGitHubConfig.html
 [`update-electron-app`]: https://github.com/electron/update-electron-app
 [update-server]: ./updates.md
 

+ 1 - 1
docs/tutorial/using-native-node-modules.md

@@ -110,7 +110,7 @@ On Windows, by default, `node-gyp` links native modules against `node.dll`.
 However, in Electron 4.x and higher, the symbols needed by native modules are
 exported by `electron.exe`, and there is no `node.dll`. In order to load native
 modules on Windows, `node-gyp` installs a [delay-load
-hook](https://msdn.microsoft.com/en-us/library/z9h1h6ty.aspx) that triggers
+hook](https://learn.microsoft.com/en-us/cpp/build/reference/error-handling-and-notification?view=msvc-170#notification-hooks) that triggers
 when the native module is loaded, and redirects the `node.dll` reference to use
 the loading executable instead of looking for `node.dll` in the library search
 path (which would turn up nothing). As such, on Electron 4.x and higher,

+ 0 - 1
filenames.auto.gni

@@ -50,7 +50,6 @@ auto_filenames = {
     "docs/api/share-menu.md",
     "docs/api/shell.md",
     "docs/api/structures",
-    "docs/api/synopsis.md",
     "docs/api/system-preferences.md",
     "docs/api/touch-bar-button.md",
     "docs/api/touch-bar-color-picker.md",

+ 0 - 2
filenames.gni

@@ -175,8 +175,6 @@ filenames = {
     "shell/browser/ui/cocoa/electron_touch_bar.mm",
     "shell/browser/ui/cocoa/event_dispatching_window.h",
     "shell/browser/ui/cocoa/event_dispatching_window.mm",
-    "shell/browser/ui/cocoa/NSColor+Hex.h",
-    "shell/browser/ui/cocoa/NSColor+Hex.mm",
     "shell/browser/ui/cocoa/NSString+ANSI.h",
     "shell/browser/ui/cocoa/NSString+ANSI.mm",
     "shell/browser/ui/cocoa/root_view_mac.h",

+ 31 - 3
filenames.libcxx.gni

@@ -45,6 +45,7 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__algorithm/iter_swap.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/iterator_operations.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/lexicographical_compare.h",
+  "//buildtools/third_party/libc++/trunk/include/__algorithm/lexicographical_compare_three_way.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/lower_bound.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/make_heap.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/make_projected.h",
@@ -184,6 +185,7 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__algorithm/stable_partition.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/stable_sort.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/swap_ranges.h",
+  "//buildtools/third_party/libc++/trunk/include/__algorithm/three_way_comp_ref_type.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/transform.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/uniform_random_bit_generator_adaptor.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/unique.h",
@@ -192,6 +194,20 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__algorithm/unwrap_range.h",
   "//buildtools/third_party/libc++/trunk/include/__algorithm/upper_bound.h",
   "//buildtools/third_party/libc++/trunk/include/__assert",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/aliases.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/atomic.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_base.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_flag.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_init.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_lock_free.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/atomic_sync.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/check_memory_order.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/contention_t.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/cxx_atomic_impl.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/fence.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/is_always_lock_free.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/kill_dependency.h",
+  "//buildtools/third_party/libc++/trunk/include/__atomic/memory_order.h",
   "//buildtools/third_party/libc++/trunk/include/__availability",
   "//buildtools/third_party/libc++/trunk/include/__bit/bit_cast.h",
   "//buildtools/third_party/libc++/trunk/include/__bit/bit_ceil.h",
@@ -210,11 +226,17 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__bsd_locale_defaults.h",
   "//buildtools/third_party/libc++/trunk/include/__bsd_locale_fallbacks.h",
   "//buildtools/third_party/libc++/trunk/include/__charconv/chars_format.h",
+  "//buildtools/third_party/libc++/trunk/include/__charconv/from_chars_integral.h",
   "//buildtools/third_party/libc++/trunk/include/__charconv/from_chars_result.h",
   "//buildtools/third_party/libc++/trunk/include/__charconv/tables.h",
+  "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars.h",
   "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_base_10.h",
+  "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_floating_point.h",
+  "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_integral.h",
   "//buildtools/third_party/libc++/trunk/include/__charconv/to_chars_result.h",
+  "//buildtools/third_party/libc++/trunk/include/__charconv/traits.h",
   "//buildtools/third_party/libc++/trunk/include/__chrono/calendar.h",
+  "//buildtools/third_party/libc++/trunk/include/__chrono/concepts.h",
   "//buildtools/third_party/libc++/trunk/include/__chrono/convert_to_timespec.h",
   "//buildtools/third_party/libc++/trunk/include/__chrono/convert_to_tm.h",
   "//buildtools/third_party/libc++/trunk/include/__chrono/day.h",
@@ -282,6 +304,11 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__debug",
   "//buildtools/third_party/libc++/trunk/include/__debug_utils/randomize_range.h",
   "//buildtools/third_party/libc++/trunk/include/__errc",
+  "//buildtools/third_party/libc++/trunk/include/__exception/exception.h",
+  "//buildtools/third_party/libc++/trunk/include/__exception/exception_ptr.h",
+  "//buildtools/third_party/libc++/trunk/include/__exception/nested_exception.h",
+  "//buildtools/third_party/libc++/trunk/include/__exception/operations.h",
+  "//buildtools/third_party/libc++/trunk/include/__exception/terminate.h",
   "//buildtools/third_party/libc++/trunk/include/__expected/bad_expected_access.h",
   "//buildtools/third_party/libc++/trunk/include/__expected/expected.h",
   "//buildtools/third_party/libc++/trunk/include/__expected/unexpect.h",
@@ -416,6 +443,7 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__mbstate_t.h",
   "//buildtools/third_party/libc++/trunk/include/__memory/addressof.h",
   "//buildtools/third_party/libc++/trunk/include/__memory/align.h",
+  "//buildtools/third_party/libc++/trunk/include/__memory/aligned_alloc.h",
   "//buildtools/third_party/libc++/trunk/include/__memory/allocate_at_least.h",
   "//buildtools/third_party/libc++/trunk/include/__memory/allocation_guard.h",
   "//buildtools/third_party/libc++/trunk/include/__memory/allocator.h",
@@ -541,6 +569,7 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__split_buffer",
   "//buildtools/third_party/libc++/trunk/include/__std_stream",
   "//buildtools/third_party/libc++/trunk/include/__string/char_traits.h",
+  "//buildtools/third_party/libc++/trunk/include/__string/constexpr_c_functions.h",
   "//buildtools/third_party/libc++/trunk/include/__string/extern_template_lists.h",
   "//buildtools/third_party/libc++/trunk/include/__support/android/locale_bionic.h",
   "//buildtools/third_party/libc++/trunk/include/__support/fuchsia/xlocale.h",
@@ -621,6 +650,7 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__type_traits/is_destructible.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/is_empty.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/is_enum.h",
+  "//buildtools/third_party/libc++/trunk/include/__type_traits/is_equality_comparable.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/is_final.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/is_floating_point.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/is_function.h",
@@ -685,6 +715,7 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/__type_traits/nat.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/negation.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/noexcept_move_assign_container.h",
+  "//buildtools/third_party/libc++/trunk/include/__type_traits/predicate_traits.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/promote.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/rank.h",
   "//buildtools/third_party/libc++/trunk/include/__type_traits/remove_all_extents.h",
@@ -773,11 +804,8 @@ libcxx_headers = [
   "//buildtools/third_party/libc++/trunk/include/expected",
   "//buildtools/third_party/libc++/trunk/include/experimental/__config",
   "//buildtools/third_party/libc++/trunk/include/experimental/__memory",
-  "//buildtools/third_party/libc++/trunk/include/experimental/algorithm",
-  "//buildtools/third_party/libc++/trunk/include/experimental/coroutine",
   "//buildtools/third_party/libc++/trunk/include/experimental/deque",
   "//buildtools/third_party/libc++/trunk/include/experimental/forward_list",
-  "//buildtools/third_party/libc++/trunk/include/experimental/functional",
   "//buildtools/third_party/libc++/trunk/include/experimental/iterator",
   "//buildtools/third_party/libc++/trunk/include/experimental/list",
   "//buildtools/third_party/libc++/trunk/include/experimental/map",

+ 22 - 7
lib/browser/api/net-client-request.ts

@@ -10,7 +10,7 @@ const {
 } = process._linkedBinding('electron_browser_net');
 const { Session } = process._linkedBinding('electron_browser_session');
 
-const kSupportedProtocols = new Set(['http:', 'https:']);
+const kHttpProtocols = new Set(['http:', 'https:']);
 
 // set of headers that Node.js discards duplicates for
 // see https://nodejs.org/api/http.html#http_message_headers
@@ -195,7 +195,20 @@ class ChunkedBodyStream extends Writable {
 
 type RedirectPolicy = 'manual' | 'follow' | 'error';
 
-function parseOptions (optionsIn: ClientRequestConstructorOptions | string): NodeJS.CreateURLLoaderOptions & { redirectPolicy: RedirectPolicy, headers: Record<string, { name: string, value: string | string[] }> } {
+const kAllowNonHttpProtocols = Symbol('kAllowNonHttpProtocols');
+export function allowAnyProtocol (opts: ClientRequestConstructorOptions): ClientRequestConstructorOptions {
+  return {
+    ...opts,
+    [kAllowNonHttpProtocols]: true
+  } as any;
+}
+
+type ExtraURLLoaderOptions = {
+   redirectPolicy: RedirectPolicy;
+   headers: Record<string, { name: string, value: string | string[] }>;
+   allowNonHttpProtocols: boolean;
+}
+function parseOptions (optionsIn: ClientRequestConstructorOptions | string): NodeJS.CreateURLLoaderOptions & ExtraURLLoaderOptions {
   const options: any = typeof optionsIn === 'string' ? url.parse(optionsIn) : { ...optionsIn };
 
   let urlStr: string = options.url;
@@ -203,9 +216,6 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
   if (!urlStr) {
     const urlObj: url.UrlObject = {};
     const protocol = options.protocol || 'http:';
-    if (!kSupportedProtocols.has(protocol)) {
-      throw new Error('Protocol "' + protocol + '" not supported');
-    }
     urlObj.protocol = protocol;
 
     if (options.host) {
@@ -247,7 +257,7 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
     throw new TypeError('headers must be an object');
   }
 
-  const urlLoaderOptions: NodeJS.CreateURLLoaderOptions & { redirectPolicy: RedirectPolicy, headers: Record<string, { name: string, value: string | string[] }> } = {
+  const urlLoaderOptions: NodeJS.CreateURLLoaderOptions & { redirectPolicy: RedirectPolicy, headers: Record<string, { name: string, value: string | string[] }>, allowNonHttpProtocols: boolean } = {
     method: (options.method || 'GET').toUpperCase(),
     url: urlStr,
     redirectPolicy,
@@ -257,7 +267,8 @@ function parseOptions (optionsIn: ClientRequestConstructorOptions | string): Nod
     credentials: options.credentials,
     origin: options.origin,
     referrerPolicy: options.referrerPolicy,
-    cache: options.cache
+    cache: options.cache,
+    allowNonHttpProtocols: Object.prototype.hasOwnProperty.call(options, kAllowNonHttpProtocols)
   };
   const headers: Record<string, string | string[]> = options.headers || {};
   for (const [name, value] of Object.entries(headers)) {
@@ -308,6 +319,10 @@ export class ClientRequest extends Writable implements Electron.ClientRequest {
     }
 
     const { redirectPolicy, ...urlLoaderOptions } = parseOptions(options);
+    const urlObj = new URL(urlLoaderOptions.url);
+    if (!urlLoaderOptions.allowNonHttpProtocols && !kHttpProtocols.has(urlObj.protocol)) {
+      throw new Error('ClientRequest only supports http: and https: protocols');
+    }
     if (urlLoaderOptions.credentials === 'same-origin' && !urlLoaderOptions.origin) { throw new Error('credentials: same-origin requires origin to be set'); }
     this._urlLoaderOptions = urlLoaderOptions;
     this._redirectPolicy = redirectPolicy;

+ 7 - 3
lib/browser/api/net-fetch.ts

@@ -1,5 +1,6 @@
 import { net, IncomingMessage, Session as SessionT } from 'electron/main';
 import { Readable, Writable, isReadable } from 'stream';
+import { allowAnyProtocol } from '@electron/internal/browser/api/net-client-request';
 
 function createDeferredPromise<T, E extends Error = Error> (): { promise: Promise<T>; resolve: (x: T) => void; reject: (e: E) => void; } {
   let res: (x: T) => void;
@@ -12,7 +13,7 @@ function createDeferredPromise<T, E extends Error = Error> (): { promise: Promis
   return { promise, resolve: res!, reject: rej! };
 }
 
-export function fetchWithSession (input: RequestInfo, init: RequestInit | undefined, session: SessionT): Promise<Response> {
+export function fetchWithSession (input: RequestInfo, init: (RequestInit & {bypassCustomProtocolHandlers?: boolean}) | undefined, session: SessionT): Promise<Response> {
   const p = createDeferredPromise<Response>();
   let req: Request;
   try {
@@ -72,7 +73,7 @@ export function fetchWithSession (input: RequestInfo, init: RequestInit | undefi
   // We can't set credentials to same-origin unless there's an origin set.
   const credentials = req.credentials === 'same-origin' && !origin ? 'include' : req.credentials;
 
-  const r = net.request({
+  const r = net.request(allowAnyProtocol({
     session,
     method: req.method,
     url: req.url,
@@ -81,7 +82,9 @@ export function fetchWithSession (input: RequestInfo, init: RequestInit | undefi
     cache: req.cache,
     referrerPolicy: req.referrerPolicy,
     redirect: req.redirect
-  });
+  }));
+
+  (r as any)._urlLoaderOptions.bypassCustomProtocolHandlers = !!init?.bypassCustomProtocolHandlers;
 
   // cors is the default mode, but we can't set mode=cors without an origin.
   if (req.mode && (req.mode !== 'cors' || origin)) {
@@ -103,6 +106,7 @@ export function fetchWithSession (input: RequestInfo, init: RequestInit | undefi
       status: resp.statusCode,
       statusText: resp.statusMessage
     });
+    (rResp as any).__original_resp = resp;
     p.resolve(rResp);
   });
 

+ 126 - 29
lib/browser/api/protocol.ts

@@ -1,33 +1,130 @@
-import { app, session } from 'electron/main';
+import { ProtocolRequest, session } from 'electron/main';
+import { createReadStream } from 'fs';
+import { Readable } from 'stream';
+import { ReadableStream } from 'stream/web';
 
 // Global protocol APIs.
-const protocol = process._linkedBinding('electron_browser_protocol');
-
-// Fallback protocol APIs of default session.
-Object.setPrototypeOf(protocol, new Proxy({}, {
-  get (_target, property) {
-    if (!app.isReady()) return;
-
-    const protocol = session.defaultSession!.protocol;
-    if (!Object.prototype.hasOwnProperty.call(protocol, property)) return;
-
-    // Returning a native function directly would throw error.
-    return (...args: any[]) => (protocol[property as keyof Electron.Protocol] as Function)(...args);
-  },
-
-  ownKeys () {
-    if (!app.isReady()) return [];
-    return Reflect.ownKeys(session.defaultSession!.protocol);
-  },
-
-  has: (target, property: string) => {
-    if (!app.isReady()) return false;
-    return Reflect.has(session.defaultSession!.protocol, property);
-  },
-
-  getOwnPropertyDescriptor () {
-    return { configurable: true, enumerable: true };
-  }
-}));
+const { registerSchemesAsPrivileged, getStandardSchemes, Protocol } = process._linkedBinding('electron_browser_protocol');
+
+const ERR_FAILED = -2;
+const ERR_UNEXPECTED = -9;
+
+const isBuiltInScheme = (scheme: string) => scheme === 'http' || scheme === 'https';
+
+function makeStreamFromPipe (pipe: any): ReadableStream {
+  const buf = new Uint8Array(1024 * 1024 /* 1 MB */);
+  return new ReadableStream({
+    async pull (controller) {
+      try {
+        const rv = await pipe.read(buf);
+        if (rv > 0) {
+          controller.enqueue(buf.subarray(0, rv));
+        } else {
+          controller.close();
+        }
+      } catch (e) {
+        controller.error(e);
+      }
+    }
+  });
+}
+
+function convertToRequestBody (uploadData: ProtocolRequest['uploadData']): RequestInit['body'] {
+  if (!uploadData) return null;
+  // Optimization: skip creating a stream if the request is just a single buffer.
+  if (uploadData.length === 1 && (uploadData[0] as any).type === 'rawData') return uploadData[0].bytes;
+
+  const chunks = [...uploadData] as any[]; // TODO: types are wrong
+  let current: ReadableStreamDefaultReader | null = null;
+  return new ReadableStream({
+    pull (controller) {
+      if (current) {
+        current.read().then(({ done, value }) => {
+          controller.enqueue(value);
+          if (done) current = null;
+        }, (err) => {
+          controller.error(err);
+        });
+      } else {
+        if (!chunks.length) { return controller.close(); }
+        const chunk = chunks.shift()!;
+        if (chunk.type === 'rawData') { controller.enqueue(chunk.bytes); } else if (chunk.type === 'file') {
+          current = Readable.toWeb(createReadStream(chunk.filePath, { start: chunk.offset ?? 0, end: chunk.length >= 0 ? chunk.offset + chunk.length : undefined })).getReader();
+          this.pull!(controller);
+        } else if (chunk.type === 'stream') {
+          current = makeStreamFromPipe(chunk.body).getReader();
+          this.pull!(controller);
+        }
+      }
+    }
+  }) as RequestInit['body'];
+}
+
+Protocol.prototype.handle = function (this: Electron.Protocol, scheme: string, handler: (req: Request) => Response | Promise<Response>) {
+  const register = isBuiltInScheme(scheme) ? this.interceptProtocol : this.registerProtocol;
+  const success = register.call(this, scheme, async (preq: ProtocolRequest, cb: any) => {
+    try {
+      const body = convertToRequestBody(preq.uploadData);
+      const req = new Request(preq.url, {
+        headers: preq.headers,
+        method: preq.method,
+        referrer: preq.referrer,
+        body,
+        duplex: body instanceof ReadableStream ? 'half' : undefined
+      } as any);
+      const res = await handler(req);
+      if (!res || typeof res !== 'object') {
+        return cb({ error: ERR_UNEXPECTED });
+      }
+      if (res.type === 'error') { cb({ error: ERR_FAILED }); } else {
+        cb({
+          data: res.body ? Readable.fromWeb(res.body as ReadableStream<ArrayBufferView>) : null,
+          headers: Object.fromEntries(res.headers),
+          statusCode: res.status,
+          statusText: res.statusText,
+          mimeType: (res as any).__original_resp?._responseHead?.mimeType
+        });
+      }
+    } catch (e) {
+      console.error(e);
+      cb({ error: ERR_UNEXPECTED });
+    }
+  });
+  if (!success) throw new Error(`Failed to register protocol: ${scheme}`);
+};
+
+Protocol.prototype.unhandle = function (this: Electron.Protocol, scheme: string) {
+  const unregister = isBuiltInScheme(scheme) ? this.uninterceptProtocol : this.unregisterProtocol;
+  if (!unregister.call(this, scheme)) { throw new Error(`Failed to unhandle protocol: ${scheme}`); }
+};
+
+Protocol.prototype.isProtocolHandled = function (this: Electron.Protocol, scheme: string) {
+  const isRegistered = isBuiltInScheme(scheme) ? this.isProtocolIntercepted : this.isProtocolRegistered;
+  return isRegistered.call(this, scheme);
+};
+
+const protocol = {
+  registerSchemesAsPrivileged,
+  getStandardSchemes,
+  registerStringProtocol: (...args) => session.defaultSession.protocol.registerStringProtocol(...args),
+  registerBufferProtocol: (...args) => session.defaultSession.protocol.registerBufferProtocol(...args),
+  registerStreamProtocol: (...args) => session.defaultSession.protocol.registerStreamProtocol(...args),
+  registerFileProtocol: (...args) => session.defaultSession.protocol.registerFileProtocol(...args),
+  registerHttpProtocol: (...args) => session.defaultSession.protocol.registerHttpProtocol(...args),
+  registerProtocol: (...args) => session.defaultSession.protocol.registerProtocol(...args),
+  unregisterProtocol: (...args) => session.defaultSession.protocol.unregisterProtocol(...args),
+  isProtocolRegistered: (...args) => session.defaultSession.protocol.isProtocolRegistered(...args),
+  interceptStringProtocol: (...args) => session.defaultSession.protocol.interceptStringProtocol(...args),
+  interceptBufferProtocol: (...args) => session.defaultSession.protocol.interceptBufferProtocol(...args),
+  interceptStreamProtocol: (...args) => session.defaultSession.protocol.interceptStreamProtocol(...args),
+  interceptFileProtocol: (...args) => session.defaultSession.protocol.interceptFileProtocol(...args),
+  interceptHttpProtocol: (...args) => session.defaultSession.protocol.interceptHttpProtocol(...args),
+  interceptProtocol: (...args) => session.defaultSession.protocol.interceptProtocol(...args),
+  uninterceptProtocol: (...args) => session.defaultSession.protocol.uninterceptProtocol(...args),
+  isProtocolIntercepted: (...args) => session.defaultSession.protocol.isProtocolIntercepted(...args),
+  handle: (...args) => session.defaultSession.protocol.handle(...args),
+  unhandle: (...args) => session.defaultSession.protocol.unhandle(...args),
+  isProtocolHandled: (...args) => session.defaultSession.protocol.isProtocolHandled(...args)
+} as typeof Electron.protocol;
 
 export default protocol;

+ 2 - 1
lib/browser/api/session.ts

@@ -1,5 +1,5 @@
 import { fetchWithSession } from '@electron/internal/browser/api/net-fetch';
-const { fromPartition, Session } = process._linkedBinding('electron_browser_session');
+const { fromPartition, fromPath, Session } = process._linkedBinding('electron_browser_session');
 
 Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
   return fetchWithSession(input, init, this);
@@ -7,6 +7,7 @@ Session.prototype.fetch = function (input: RequestInfo, init?: RequestInit) {
 
 export default {
   fromPartition,
+  fromPath,
   get defaultSession () {
     return fromPartition('');
   }

+ 1 - 1
package.json

@@ -78,7 +78,7 @@
     "vscode-languageserver": "^8.0.2",
     "vscode-languageserver-textdocument": "^1.0.7",
     "vscode-uri": "^3.0.6",
-    "webpack": "^5.73.0",
+    "webpack": "^5.76.0",
     "webpack-cli": "^4.10.0",
     "wrapper-webpack-plugin": "^2.2.0"
   },

+ 0 - 1
patches/angle/.patches

@@ -1 +0,0 @@
-fix_rename_webswapcgllayer_to_webswapcgllayerchromium.patch

+ 0 - 66
patches/angle/fix_rename_webswapcgllayer_to_webswapcgllayerchromium.patch

@@ -1,66 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Milan Burda <[email protected]>
-Date: Mon, 10 Oct 2022 15:11:08 +0400
-Subject: fix: rename WebSwapCGLLayer to WebSwapCGLLayerChromium
-
-Class WebSwapCGLLayer is implemented in both /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libANGLE-shared.dylib (0x23c589b50)
-and src/out/testing/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Libraries/libGLESv2.dylib (0x1123f8488).
-One of the two will be used. Which one is undefined.
-
-diff --git a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
-index 7101cd271c07e604c6f5241d1a22f59f446c0033..98a89976f87e32a66bd504951698204fad938d57 100644
---- a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
-+++ b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.h
-@@ -18,7 +18,7 @@ struct __IOSurface;
- typedef __IOSurface *IOSurfaceRef;
- 
- // WebKit's build process requires that every Objective-C class name has the prefix "Web".
--@class WebSwapCGLLayer;
-+@class WebSwapCGLLayerChromium;
- 
- namespace rx
- {
-@@ -89,7 +89,7 @@ class WindowSurfaceCGL : public SurfaceGL
-                                      gl::Framebuffer *framebuffer) override;
- 
-   private:
--    WebSwapCGLLayer *mSwapLayer;
-+    WebSwapCGLLayerChromium *mSwapLayer;
-     SharedSwapState mSwapState;
-     uint64_t mCurrentSwapId;
- 
-diff --git a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
-index 27990e9c2facbbe0e30f4b275e0778a6474fb9ce..84f9fa9b6d31fb0e85a4c4270dff4d935f855c26 100644
---- a/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
-+++ b/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
-@@ -24,7 +24,7 @@
- #    include "libANGLE/renderer/gl/StateManagerGL.h"
- #    include "libANGLE/renderer/gl/cgl/DisplayCGL.h"
- 
--@interface WebSwapCGLLayer : CAOpenGLLayer {
-+@interface WebSwapCGLLayerChromium : CAOpenGLLayer {
-     CGLContextObj mDisplayContext;
- 
-     bool initialized;
-@@ -38,7 +38,7 @@ - (id)initWithSharedState:(rx::SharedSwapState *)swapState
-             withFunctions:(const rx::FunctionsGL *)functions;
- @end
- 
--@implementation WebSwapCGLLayer
-+@implementation WebSwapCGLLayerChromium
- - (id)initWithSharedState:(rx::SharedSwapState *)swapState
-               withContext:(CGLContextObj)displayContext
-             withFunctions:(const rx::FunctionsGL *)functions
-@@ -220,9 +220,9 @@ - (void)drawInCGLContext:(CGLContextObj)glContext
-     mSwapState.lastRendered   = &mSwapState.textures[1];
-     mSwapState.beingPresented = &mSwapState.textures[2];
- 
--    mSwapLayer = [[WebSwapCGLLayer alloc] initWithSharedState:&mSwapState
--                                                  withContext:mContext
--                                                withFunctions:mFunctions];
-+    mSwapLayer = [[WebSwapCGLLayerChromium alloc] initWithSharedState:&mSwapState
-+                                                          withContext:mContext
-+                                                        withFunctions:mFunctions];
-     [mLayer addSublayer:mSwapLayer];
-     [mSwapLayer setContentsScale:[mLayer contentsScale]];
- 

+ 2 - 2
patches/boringssl/expose_aes-cfb.patch

@@ -58,10 +58,10 @@ index 852b76bea69988e0b3ac76a17b603128f239dde0..d443f4dc2daea0b7aa86ae75d31d995f
    callback(EVP_aes_192_ctr(), "aes-192-ctr", NULL, arg);
    callback(EVP_aes_256_ctr(), "aes-256-ctr", NULL, arg);
 diff --git a/include/openssl/cipher.h b/include/openssl/cipher.h
-index 0e52ac8dc948764d52f196734cfc974e6d740b8e..caaeade2d78f361fd67186e444e3cb6997355d14 100644
+index 310d7c237fd884ba715e3fa97ccf1393b6d04fbb..66e69d487fbb767438b7d0dfdf3770f54e3cf7b2 100644
 --- a/include/openssl/cipher.h
 +++ b/include/openssl/cipher.h
-@@ -470,6 +470,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
+@@ -476,6 +476,7 @@ OPENSSL_EXPORT const EVP_CIPHER *EVP_des_ede3_ecb(void);
  
  // EVP_aes_128_cfb128 is only available in decrepit.
  OPENSSL_EXPORT const EVP_CIPHER *EVP_aes_128_cfb128(void);

+ 1 - 1
patches/boringssl/expose_ripemd160.patch

@@ -10,7 +10,7 @@ this patch is required to provide ripemd160 support in the nodejs crypto
 module.
 
 diff --git a/crypto/digest_extra/digest_extra.c b/crypto/digest_extra/digest_extra.c
-index 8cbb28e3afde3dbae3887b22e8b607fa7303e89f..32caba196eb9f0823f774dac9e91314035b3ff7f 100644
+index 08ed671a8095566e6c87ea846a95c59efdd7f42b..29797fb8f69c23ac427c041d779a013b4a78c02a 100644
 --- a/crypto/digest_extra/digest_extra.c
 +++ b/crypto/digest_extra/digest_extra.c
 @@ -85,6 +85,7 @@ static const struct nid_to_digest nid_to_digest_mapping[] = {

+ 5 - 5
patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch

@@ -20,7 +20,7 @@ index 2ca14efae5ea478f43794a81883b00dfdb1a37b0..d73055fbf39334925ef4b4804bbaca57
  
      case ssl_open_record_error:
 diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
-index 0f0f5b1c32f88ec019fc3eab0977c9bb64c095ed..e25b72ec1e43c52d329d4f396776698526685439 100644
+index 86e8eb33e2f99b9a6173550027cfd0812a39614e..f2aac85c096bef42a015135b02936e3d4e9a4c56 100644
 --- a/ssl/ssl_lib.cc
 +++ b/ssl/ssl_lib.cc
 @@ -1320,7 +1320,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {
@@ -32,7 +32,7 @@ index 0f0f5b1c32f88ec019fc3eab0977c9bb64c095ed..e25b72ec1e43c52d329d4f3967766985
        return SSL_ERROR_ZERO_RETURN;
      }
      // An EOF was observed which violates the protocol, and the underlying
-@@ -2598,13 +2598,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
+@@ -2597,13 +2597,7 @@ void *SSL_CTX_get_ex_data(const SSL_CTX *ctx, int idx) {
    return CRYPTO_get_ex_data(&ctx->ex_data, idx);
  }
  
@@ -48,10 +48,10 @@ index 0f0f5b1c32f88ec019fc3eab0977c9bb64c095ed..e25b72ec1e43c52d329d4f3967766985
  void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
                                    RSA *(*cb)(SSL *ssl, int is_export,
 diff --git a/ssl/ssl_test.cc b/ssl/ssl_test.cc
-index 17209298f84bcd248c0367a4cc8fb88074705b5e..fa6d7d22a26c520896ea8b8b1f0e5cf816a52812 100644
+index f51c11efc12209377773204808b85c9cbf5d3bff..d19fd1f9643f99fdd56753a942fccefff08728ac 100644
 --- a/ssl/ssl_test.cc
 +++ b/ssl/ssl_test.cc
-@@ -8437,11 +8437,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
+@@ -8460,11 +8460,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
    EXPECT_EQ(ret, 0);
    EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_ZERO_RETURN);
  
@@ -63,7 +63,7 @@ index 17209298f84bcd248c0367a4cc8fb88074705b5e..fa6d7d22a26c520896ea8b8b1f0e5cf8
    // Although the client has seen close_notify, it should continue to report
    // |SSL_ERROR_SYSCALL| when its writes fail.
    ret = SSL_write(client.get(), data, sizeof(data));
-@@ -8449,22 +8444,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
+@@ -8472,22 +8467,6 @@ TEST(SSLTest, ErrorSyscallAfterCloseNotify) {
    EXPECT_EQ(SSL_get_error(client.get(), ret), SSL_ERROR_SYSCALL);
    EXPECT_TRUE(write_failed);
    write_failed = false;

+ 3 - 2
patches/chromium/.patches

@@ -25,7 +25,6 @@ mas_disable_remote_accessibility.patch
 mas_disable_custom_window_frame.patch
 mas_avoid_usage_of_private_macos_apis.patch
 mas_use_public_apis_to_determine_if_a_font_is_a_system_font.patch
-chrome_key_systems.patch
 add_didinstallconditionalfeatures.patch
 desktop_media_list.patch
 proxy_config_monitor.patch
@@ -125,4 +124,6 @@ chore_introduce_blocking_api_for_electron.patch
 chore_patch_out_partition_attribute_dcheck_for_webviews.patch
 expose_v8initializer_codegenerationcheckcallbackinmainthread.patch
 chore_patch_out_profile_methods_in_profile_selections_cc.patch
-fix_x11_window_restore_minimized_maximized_window.patch
+add_gin_converter_support_for_arraybufferview.patch
+chore_defer_usb_service_getdevices_request_until_usb_service_is.patch
+revert_roll_clang_rust_llvmorg-16-init-17653-g39da55e8-3.patch

+ 3 - 3
patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch

@@ -10,10 +10,10 @@ Allows Electron to restore WER when ELECTRON_DEFAULT_ERROR_MODE is set.
 This should be upstreamed.
 
 diff --git a/content/gpu/gpu_main.cc b/content/gpu/gpu_main.cc
-index 31f48f482532651052ba63a95884162a2e652509..0076d9f34970488a236ace0274aef31dd20b2dfa 100644
+index 7bf09dd8870040e74cd1a7653665d0806910378c..ec6d1554075ee5454f79e98d0e2e539395499dbe 100644
 --- a/content/gpu/gpu_main.cc
 +++ b/content/gpu/gpu_main.cc
-@@ -242,6 +242,10 @@ int GpuMain(MainFunctionParams parameters) {
+@@ -243,6 +243,10 @@ int GpuMain(MainFunctionParams parameters) {
    // to the GpuProcessHost once the GpuServiceImpl has started.
    viz::GpuServiceImpl::InstallPreInitializeLogHandler();
  
@@ -24,7 +24,7 @@ index 31f48f482532651052ba63a95884162a2e652509..0076d9f34970488a236ace0274aef31d
    // We are experiencing what appear to be memory-stomp issues in the GPU
    // process. These issues seem to be impacting the task executor and listeners
    // registered to it. Create the task executor on the heap to guard against
-@@ -326,7 +330,6 @@ int GpuMain(MainFunctionParams parameters) {
+@@ -327,7 +331,6 @@ int GpuMain(MainFunctionParams parameters) {
        const_cast<base::CommandLine*>(&command_line), gpu_preferences);
    const bool dead_on_arrival = !init_success;
  

+ 16 - 16
patches/chromium/add_didinstallconditionalfeatures.patch

@@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the
 context, which can cause some preload scripts to trip.
 
 diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
-index 7eaed5e4ce1f8a46d1e25f8838cf52b3676a7fb5..8f2bd75d29acfc212f2e680caf63c428aedb16b9 100644
+index 6c92a2856e447bdda11c7ed2c64b79b93a0eca26..03dedde2d83e6b09fb7e90be7dfdce246f301d8f 100644
 --- a/content/public/renderer/render_frame_observer.h
 +++ b/content/public/renderer/render_frame_observer.h
 @@ -136,6 +136,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -23,10 +23,10 @@ index 7eaed5e4ce1f8a46d1e25f8838cf52b3676a7fb5..8f2bd75d29acfc212f2e680caf63c428
                                          int32_t world_id) {}
    virtual void DidClearWindowObject() {}
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index a0123eac7193282dbfba9712f0d88b2b87fccd9f..137c78c4441d58d9e8822aa87a2389126a80e1aa 100644
+index ec5f9cd23baefd6a1fd6d0185566ebbad908c3aa..04beeccf48d530ddfa2aa997e254f9d1abee4c56 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -4407,6 +4407,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
+@@ -4379,6 +4379,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
      observer.DidCreateScriptContext(context, world_id);
  }
  
@@ -40,10 +40,10 @@ index a0123eac7193282dbfba9712f0d88b2b87fccd9f..137c78c4441d58d9e8822aa87a238912
                                                 int world_id) {
    for (auto& observer : observers_)
 diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
-index c0d24c1715b4714c5f179dbba4f0d91cddef1946..c819e1429630342cb34476847b3c25b140dfc593 100644
+index 89f908fd388388a90bc1dfc9eb74fde68a388826..0737f3f7d10c054828da8b7e7cab0c4b30369c7a 100644
 --- a/content/renderer/render_frame_impl.h
 +++ b/content/renderer/render_frame_impl.h
-@@ -603,6 +603,8 @@ class CONTENT_EXPORT RenderFrameImpl
+@@ -606,6 +606,8 @@ class CONTENT_EXPORT RenderFrameImpl
    void DidObserveLayoutShift(double score, bool after_input_or_scroll) override;
    void DidCreateScriptContext(v8::Local<v8::Context> context,
                                int world_id) override;
@@ -53,10 +53,10 @@ index c0d24c1715b4714c5f179dbba4f0d91cddef1946..c819e1429630342cb34476847b3c25b1
                                  int world_id) override;
    void DidChangeScrollOffset() override;
 diff --git a/third_party/blink/public/web/web_local_frame_client.h b/third_party/blink/public/web/web_local_frame_client.h
-index 9fa27d4f1c63599d5cfeb095e74a72a88db1d8a2..0d37864c44495615103f5c1dca623c1e181a6460 100644
+index 082e8ec96fb8f2fea660ea12fd349a248b7422a2..77a7aee67a69fb7728525af3baa45410d866b266 100644
 --- a/third_party/blink/public/web/web_local_frame_client.h
 +++ b/third_party/blink/public/web/web_local_frame_client.h
-@@ -592,6 +592,9 @@ class BLINK_EXPORT WebLocalFrameClient {
+@@ -603,6 +603,9 @@ class BLINK_EXPORT WebLocalFrameClient {
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) {}
  
@@ -67,22 +67,22 @@ index 9fa27d4f1c63599d5cfeb095e74a72a88db1d8a2..0d37864c44495615103f5c1dca623c1e
    virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
                                          int32_t world_id) {}
 diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
-index 9736b31c03a32635fb8fde581321cc10ec11b11a..c9fd2170a25a7970648b8210ebe94e225f4ee3aa 100644
+index e7d4256fa96f5bc8ad71bd13b6b33feef32b443f..0dfeda68a4dbfd6b442f8d8f928c8cb871dd6aa4 100644
 --- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
 +++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
-@@ -197,6 +197,7 @@ void LocalWindowProxy::Initialize() {
+@@ -198,6 +198,7 @@ void LocalWindowProxy::Initialize() {
    }
  
    InstallConditionalFeatures();
 +  GetFrame()->Client()->DidInstallConditionalFeatures(context, world_->GetWorldId());
  
    if (World().IsMainWorld()) {
-     GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
+     probe::DidCreateMainWorldContext(GetFrame());
 diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
-index bbcc1a23378d86d716171cf695f641212e64a30a..06b10cdfa96473731958c4a7e6d0839e79714ad3 100644
+index 57c53a50ac740638f20bf251bdfe11712dd695a8..54e89e0007f2ef77ff9a8894cf4aeb9489d1af10 100644
 --- a/third_party/blink/renderer/core/frame/local_frame_client.h
 +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
-@@ -308,6 +308,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
+@@ -317,6 +317,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
  
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) = 0;
@@ -92,7 +92,7 @@ index bbcc1a23378d86d716171cf695f641212e64a30a..06b10cdfa96473731958c4a7e6d0839e
                                          int32_t world_id) = 0;
    virtual bool AllowScriptExtensions() = 0;
 diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
-index 77850c10195719e320b1fdfc4f13c805a802d4ef..98955dd3da64a2f4b7036466d9e1eefd1704727d 100644
+index a673808284a34b40a453f3d6142167f2441ac15b..baf96017feaac4fb031eb1fd0c3484e07ee30073 100644
 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.cc
 @@ -283,6 +283,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -110,7 +110,7 @@ index 77850c10195719e320b1fdfc4f13c805a802d4ef..98955dd3da64a2f4b7036466d9e1eefd
      v8::Local<v8::Context> context,
      int32_t world_id) {
 diff --git a/third_party/blink/renderer/core/frame/local_frame_client_impl.h b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
-index d3f976c53e4ad894bfb808c1184f949871c3df2f..00d95e053dcc274036fc7300ad0b946df969d5fa 100644
+index 18bd2834036d3fda2049a3895423ee408e5af94a..de9700ca74616d48b6665c93edc01bef92cad5ce 100644
 --- a/third_party/blink/renderer/core/frame/local_frame_client_impl.h
 +++ b/third_party/blink/renderer/core/frame/local_frame_client_impl.h
 @@ -82,6 +82,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
@@ -123,10 +123,10 @@ index d3f976c53e4ad894bfb808c1184f949871c3df2f..00d95e053dcc274036fc7300ad0b946d
                                  int32_t world_id) override;
  
 diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
-index 163e228075b5c6a1dcdb33896570258e14f5b5b3..e0ca34b36b2d6b98f9394f4022645f084cae3a58 100644
+index be4ec85e2abb8bce8951d8f1060ad502a286a407..6689ecc61aaeaf3c2d8bf22bf01ad48597f251ca 100644
 --- a/third_party/blink/renderer/core/loader/empty_clients.h
 +++ b/third_party/blink/renderer/core/loader/empty_clients.h
-@@ -373,6 +373,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
+@@ -402,6 +402,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
  
    void DidCreateScriptContext(v8::Local<v8::Context>,
                                int32_t world_id) override {}

+ 2 - 2
patches/chromium/add_electron_deps_to_license_credits_file.patch

@@ -7,10 +7,10 @@ Ensure that licenses for the dependencies introduced by Electron
 are included in `LICENSES.chromium.html`
 
 diff --git a/tools/licenses/licenses.py b/tools/licenses/licenses.py
-index 6f2e1a707767462e7b0e6909149cc16e6b22e62c..20a41de1b22a7403d3d1ddfcbd3454c690d2a50c 100755
+index e56688f7ab2a8b0ee59d0b7389e4c87370c8fad2..0e09b173574d48a3c7388315fef83f3ec74fe71a 100755
 --- a/tools/licenses/licenses.py
 +++ b/tools/licenses/licenses.py
-@@ -384,6 +384,31 @@ SPECIAL_CASES = {
+@@ -383,6 +383,31 @@ SPECIAL_CASES = {
          "License": "Apache 2.0",
          "License File": "/third_party/selenium-atoms/LICENSE.closure",
      },

+ 60 - 0
patches/chromium/add_gin_converter_support_for_arraybufferview.patch

@@ -0,0 +1,60 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jeremy Rose <[email protected]>
+Date: Wed, 8 Mar 2023 14:53:17 -0800
+Subject: add gin::Converter support for ArrayBufferView
+
+This should be upstreamed.
+
+diff --git a/gin/converter.cc b/gin/converter.cc
+index 4eb8c3d8c8392512eeb235bc18012589549b872b..d0432f6fff09cdcebed55ccf03a6524a445ef346 100644
+--- a/gin/converter.cc
++++ b/gin/converter.cc
+@@ -18,6 +18,7 @@
+ #include "v8/include/v8-value.h"
+ 
+ using v8::ArrayBuffer;
++using v8::ArrayBufferView;
+ using v8::External;
+ using v8::Function;
+ using v8::Int32;
+@@ -244,6 +245,20 @@ bool Converter<Local<ArrayBuffer>>::FromV8(Isolate* isolate,
+   return true;
+ }
+ 
++Local<Value> Converter<Local<ArrayBufferView>>::ToV8(Isolate* isolate,
++                                                 Local<ArrayBufferView> val) {
++  return val.As<Value>();
++}
++
++bool Converter<Local<ArrayBufferView>>::FromV8(Isolate* isolate,
++                                           Local<Value> val,
++                                           Local<ArrayBufferView>* out) {
++  if (!val->IsArrayBufferView())
++    return false;
++  *out = Local<ArrayBufferView>::Cast(val);
++  return true;
++}
++
+ Local<Value> Converter<Local<External>>::ToV8(Isolate* isolate,
+                                               Local<External> val) {
+   return val.As<Value>();
+diff --git a/gin/converter.h b/gin/converter.h
+index eb704fcd56dee861e18e9cd64a857d68dea6f415..d32a8c26403cf32f3333ed85c23292915e6f0681 100644
+--- a/gin/converter.h
++++ b/gin/converter.h
+@@ -180,6 +180,15 @@ struct GIN_EXPORT Converter<v8::Local<v8::ArrayBuffer> > {
+                      v8::Local<v8::ArrayBuffer>* out);
+ };
+ 
++template<>
++struct GIN_EXPORT Converter<v8::Local<v8::ArrayBufferView> > {
++  static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,
++                                    v8::Local<v8::ArrayBufferView> val);
++  static bool FromV8(v8::Isolate* isolate,
++                     v8::Local<v8::Value> val,
++                     v8::Local<v8::ArrayBufferView>* out);
++};
++
+ template<>
+ struct GIN_EXPORT Converter<v8::Local<v8::External> > {
+   static v8::Local<v8::Value> ToV8(v8::Isolate* isolate,

+ 50 - 29
patches/chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch

@@ -8,34 +8,34 @@ decorations in maximized mode where needed, preventing empty space caused
 by decoration shadows and rounded titlebars around the window while maximized.
 
 diff --git a/ui/gtk/gtk_ui.cc b/ui/gtk/gtk_ui.cc
-index c61bac00076822ae729882c64f3ad89e0d849e91..28cd9fb14783651ee651917f135c68faa0f2059a 100644
+index 99d3dc38ca60dbdc68bcb679067e8fd64e43b06a..7f5c3b103da21d213aa19fe8a4320bec0b7ebeb5 100644
 --- a/ui/gtk/gtk_ui.cc
 +++ b/ui/gtk/gtk_ui.cc
-@@ -507,13 +507,15 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
-   return nullptr;
+@@ -480,12 +480,13 @@ std::unique_ptr<ui::NavButtonProvider> GtkUi::CreateNavButtonProvider() {
+   return std::make_unique<gtk::NavButtonProviderGtk>();
  }
  
 -ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame) {
 +ui::WindowFrameProvider* GtkUi::GetWindowFrameProvider(bool solid_frame, bool maximized) {
-   if (!GtkCheckVersion(3, 14))
-     return nullptr;
    auto& provider =
 -      solid_frame ? solid_frame_provider_ : transparent_frame_provider_;
+-  if (!provider) {
+-    provider = std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame);
+-  }
 +      maximized
 +        ? (solid_frame ? solid_maximized_frame_provider_ : transparent_maximized_frame_provider_)
 +        : (solid_frame ? solid_frame_provider_ : transparent_frame_provider_);
-   if (!provider)
--    provider = std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame);
++  if (!provider)
 +    provider = std::make_unique<gtk::WindowFrameProviderGtk>(solid_frame, maximized);
    return provider.get();
  }
  
 diff --git a/ui/gtk/gtk_ui.h b/ui/gtk/gtk_ui.h
-index ebc31db3dad9ba7904fbd345c6a1ba31ed6fd813..1d2ffc82bb67ed80f508631c8c7d045be76f6761 100644
+index adf91ed69c33c5da4ba8cf55d7cbfc482d0762ba..404fccbbe6957ba9309955ef5e7498cdcd0411f0 100644
 --- a/ui/gtk/gtk_ui.h
 +++ b/ui/gtk/gtk_ui.h
 @@ -106,7 +106,7 @@ class GtkUi : public ui::LinuxUiAndTheme {
-   SkColor GetInactiveSelectionFgColor() const override;
+   void GetInactiveSelectionFgColor(SkColor* color) const override;
    bool PreferDarkTheme() const override;
    std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
 -  ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
@@ -43,7 +43,7 @@ index ebc31db3dad9ba7904fbd345c6a1ba31ed6fd813..1d2ffc82bb67ed80f508631c8c7d045b
  
   private:
    using TintMap = std::map<int, color_utils::HSL>;
-@@ -195,10 +195,13 @@ class GtkUi : public ui::LinuxUiAndTheme {
+@@ -195,6 +195,8 @@ class GtkUi : public ui::LinuxUiAndTheme {
    // while Chrome is running.
    std::unique_ptr<ui::WindowFrameProvider> solid_frame_provider_;
    std::unique_ptr<ui::WindowFrameProvider> transparent_frame_provider_;
@@ -52,13 +52,8 @@ index ebc31db3dad9ba7904fbd345c6a1ba31ed6fd813..1d2ffc82bb67ed80f508631c8c7d045b
  
    // Objects to notify when the window frame button order changes.
    base::ObserverList<ui::WindowButtonOrderObserver>::Unchecked
-       window_button_order_observer_list_;
-+
- };
- 
- }  // namespace gtk
 diff --git a/ui/gtk/window_frame_provider_gtk.cc b/ui/gtk/window_frame_provider_gtk.cc
-index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c9f1b94fa 100644
+index 1925c1a2763b8dd720f5d0a630bc98ec5d16b9a0..a4986477b46aef555d526851cf191650d2972238 100644
 --- a/ui/gtk/window_frame_provider_gtk.cc
 +++ b/ui/gtk/window_frame_provider_gtk.cc
 @@ -39,16 +39,18 @@ std::string GetThemeName() {
@@ -67,7 +62,7 @@ index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c
  
 -GtkCssContext WindowContext(bool solid_frame, bool focused) {
 +GtkCssContext WindowContext(bool solid_frame, bool maximized, bool focused) {
-   std::string selector = "#window.background.";
+   std::string selector = "window.background.";
    selector += solid_frame ? "solid-csd" : "csd";
 +  if (maximized)
 +    selector += ".maximized";
@@ -82,7 +77,7 @@ index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c
 +  auto context = WindowContext(solid_frame, maximized, focused);
    // GTK4 renders the decoration directly on the window.
    if (!GtkCheckVersion(4))
-     context = AppendCssNodeToStyleContext(context, "#decoration");
+     context = AppendCssNodeToStyleContext(context, "decoration");
 @@ -65,8 +67,8 @@ GtkCssContext DecorationContext(bool solid_frame, bool focused) {
    return context;
  }
@@ -92,9 +87,9 @@ index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c
 +GtkCssContext HeaderContext(bool solid_frame, bool maximized, bool focused) {
 +  auto context = WindowContext(solid_frame, maximized, focused);
    context =
-       AppendCssNodeToStyleContext(context, "#headerbar.header-bar.titlebar");
+       AppendCssNodeToStyleContext(context, "headerbar.header-bar.titlebar");
    if (!focused)
-@@ -111,8 +113,8 @@ int ComputeTopCornerRadius() {
+@@ -121,8 +123,8 @@ int ComputeTopCornerRadius() {
    // need to experimentally determine the corner radius by rendering a sample.
    // Additionally, in GTK4, the headerbar corners get clipped by the window
    // rather than the headerbar having its own rounded corners.
@@ -105,16 +100,16 @@ index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c
    ApplyCssToContext(context, R"(window, headerbar {
      background-image: none;
      background-color: black;
-@@ -145,7 +147,7 @@ int ComputeTopCornerRadius() {
+@@ -155,7 +157,7 @@ int ComputeTopCornerRadius() {
  bool HeaderIsTranslucent() {
    // The arbitrary square size to render a sample header.
    constexpr int kHeaderSize = 32;
 -  auto context = HeaderContext(false, false);
 +  auto context = HeaderContext(false, false, false);
-   ApplyCssToContext(context, R"(window, headerbar {
-     box-shadow: none;
-     border: none;
-@@ -197,8 +199,8 @@ void WindowFrameProviderGtk::Asset::CloneFrom(
+   double opacity = 1.0f;
+   GtkStyleContextGet(context, "opacity", &opacity, nullptr);
+   if (opacity < 1.0f)
+@@ -211,8 +213,8 @@ void WindowFrameProviderGtk::Asset::CloneFrom(
    unfocused_bitmap = src.unfocused_bitmap;
  }
  
@@ -125,7 +120,7 @@ index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c
  
  WindowFrameProviderGtk::~WindowFrameProviderGtk() = default;
  
-@@ -305,7 +307,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(
+@@ -319,7 +321,7 @@ void WindowFrameProviderGtk::PaintWindowFrame(
        top_area_height_dip * scale - effective_frame_thickness_px.top();
  
    auto header = PaintHeaderbar({client_bounds_px.width(), top_area_height_px},
@@ -134,7 +129,7 @@ index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c
    image = gfx::ImageSkia::CreateFrom1xBitmap(header);
    // In GTK4, the headerbar gets clipped by the window.
    if (GtkCheckVersion(4)) {
-@@ -337,7 +339,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
+@@ -351,7 +353,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
  
    gfx::Rect frame_bounds_dip(kMaxFrameSizeDip, kMaxFrameSizeDip,
                               2 * kMaxFrameSizeDip, 2 * kMaxFrameSizeDip);
@@ -143,7 +138,7 @@ index e866f32a06abd8b9ee70f2972822b37756878259..d55229238fed1fedba65a969495c9b5c
    frame_bounds_dip.Inset(-GtkStyleContextGetPadding(focused_context));
    frame_bounds_dip.Inset(-GtkStyleContextGetBorder(focused_context));
    gfx::Size bitmap_size(BitmapSizePx(asset), BitmapSizePx(asset));
-@@ -345,7 +347,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
+@@ -359,7 +361,7 @@ void WindowFrameProviderGtk::MaybeUpdateBitmaps(float scale) {
        PaintBitmap(bitmap_size, frame_bounds_dip, focused_context, scale);
    asset.unfocused_bitmap =
        PaintBitmap(bitmap_size, frame_bounds_dip,
@@ -175,8 +170,34 @@ index 32c3d63ae4598339965c58443a8c2d12b99fb89a..91496d957b8291cd37948e237a1cc4bf
  };
  
  }  // namespace gtk
+diff --git a/ui/linux/fallback_linux_ui.cc b/ui/linux/fallback_linux_ui.cc
+index 5f5abeeb78372785d57315056fa61fc65a3848a9..f52f436d674ad54c9973488eec59e26d02866847 100644
+--- a/ui/linux/fallback_linux_ui.cc
++++ b/ui/linux/fallback_linux_ui.cc
+@@ -136,7 +136,7 @@ FallbackLinuxUi::CreateNavButtonProvider() {
+ }
+ 
+ ui::WindowFrameProvider* FallbackLinuxUi::GetWindowFrameProvider(
+-    bool solid_frame) {
++    bool solid_frame, bool maximized) {
+   return nullptr;
+ }
+ 
+diff --git a/ui/linux/fallback_linux_ui.h b/ui/linux/fallback_linux_ui.h
+index d5b12df3f4e32aef6d974986ceeb666edecc4e11..e836f661a17f2e9916685d497ee5f487c4000661 100644
+--- a/ui/linux/fallback_linux_ui.h
++++ b/ui/linux/fallback_linux_ui.h
+@@ -67,7 +67,7 @@ class FallbackLinuxUi : public LinuxUiAndTheme {
+   void GetInactiveSelectionFgColor(SkColor* color) const override;
+   bool PreferDarkTheme() const override;
+   std::unique_ptr<ui::NavButtonProvider> CreateNavButtonProvider() override;
+-  ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame) override;
++  ui::WindowFrameProvider* GetWindowFrameProvider(bool solid_frame, bool maximized) override;
+ 
+  private:
+   std::string default_font_family_;
 diff --git a/ui/linux/linux_ui.h b/ui/linux/linux_ui.h
-index b5fd57741d2f47bda9499cf10e73cc9b3dd1b4dc..35e5bedb719af699485b575ece4bdb4f90df07df 100644
+index 82d40cb5fa1b9ad54e43502793a7d1d3e94e2ebb..6f6296c4f8334e59e1522abe291d65bb508f9541 100644
 --- a/ui/linux/linux_ui.h
 +++ b/ui/linux/linux_ui.h
 @@ -273,7 +273,7 @@ class COMPONENT_EXPORT(LINUX_UI) LinuxUiTheme {

+ 4 - 4
patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch

@@ -8,10 +8,10 @@ was removed as part of the Raw Clipboard API scrubbing.
 https://bugs.chromium.org/p/chromium/issues/detail?id=1217643
 
 diff --git a/ui/base/clipboard/scoped_clipboard_writer.cc b/ui/base/clipboard/scoped_clipboard_writer.cc
-index e1f7acfa42b8dd377f67a1fdda0c375f239f1189..50a84d348217a136cac4f63639d45e564baa3afe 100644
+index 069a4481ca6318215dd8a86b71aa7cacfb635173..605c5b8f8a7e50a22c94c6818cbdd95ced14fc15 100644
 --- a/ui/base/clipboard/scoped_clipboard_writer.cc
 +++ b/ui/base/clipboard/scoped_clipboard_writer.cc
-@@ -227,6 +227,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(
+@@ -232,6 +232,16 @@ void ScopedClipboardWriter::WriteEncodedDataTransferEndpointForTesting(
  }
  #endif  // BUILDFLAG(IS_CHROMEOS_ASH)
  
@@ -29,10 +29,10 @@ index e1f7acfa42b8dd377f67a1fdda0c375f239f1189..50a84d348217a136cac4f63639d45e56
    objects_.clear();
    platform_representations_.clear();
 diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
-index 5ac38344f1221ce402ad2c0e2954c442f3955318..49e22a89d823649f4c62bbae7323a055dcc47934 100644
+index 2a9964f12a3a17103cd473de74a039d01e117041..873cd66831b7cb4d762d3b7abf5fd08623d3d73b 100644
 --- a/ui/base/clipboard/scoped_clipboard_writer.h
 +++ b/ui/base/clipboard/scoped_clipboard_writer.h
-@@ -84,6 +84,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
+@@ -87,6 +87,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {
    // This is only used to write custom format data.
    void WriteData(const std::u16string& format, mojo_base::BigBuffer data);
  

+ 11 - 11
patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch

@@ -6,7 +6,7 @@ Subject: allow disabling blink scheduler throttling per RenderView
 This allows us to disable throttling for hidden windows.
 
 diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
-index 39bd6ef7be6ecb0f22692ace3c77845d76a59391..d51a7418fe874102f0458d1aedbca26e85669da6 100644
+index 172f0b47e2c77cc15ddf0451e86d907d73b5bb95..141220d97a195e2589e1bc0ad303c085d347274e 100644
 --- a/content/browser/renderer_host/render_view_host_impl.cc
 +++ b/content/browser/renderer_host/render_view_host_impl.cc
 @@ -689,6 +689,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -22,7 +22,7 @@ index 39bd6ef7be6ecb0f22692ace3c77845d76a59391..d51a7418fe874102f0458d1aedbca26e
    return is_active();
  }
 diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
-index 574e1f33f7eb9302fc6b64efca23426676821afc..c8509989003da8ca3bbfd13c802f5bd8b81460e5 100644
+index 180abdc9f983887c83fd9d4a596472222e9ab472..00842717a7570561ee9e3eca11190ab5e1c76fb8 100644
 --- a/content/browser/renderer_host/render_view_host_impl.h
 +++ b/content/browser/renderer_host/render_view_host_impl.h
 @@ -136,6 +136,7 @@ class CONTENT_EXPORT RenderViewHostImpl
@@ -48,10 +48,10 @@ index 9979c25ecd57e68331b628a518368635db5c2027..32733bf951af3eff7da5fd5758bbcbaa
    // This interface should only be implemented inside content.
    friend class RenderViewHostImpl;
 diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
-index 5f6a6f538fb8e21279d99b3dbe74a583f1592967..18837dceef7a197d0984b5363595ee1131553c5f 100644
+index d18c66114870de83c7eef21578e9e2b8d5606a8b..e1defb3992289427df85963f44a705e3d9257342 100644
 --- a/third_party/blink/public/mojom/page/page.mojom
 +++ b/third_party/blink/public/mojom/page/page.mojom
-@@ -133,4 +133,7 @@ interface PageBroadcast {
+@@ -149,4 +149,7 @@ interface PageBroadcast {
      mojo_base.mojom.UnguessableToken devtools_frame_token,
      RemoteFrameInterfacesFromBrowser remote_frame_interfaces,
      RemoteMainFrameInterfaces remote_main_frame_interfaces);
@@ -60,10 +60,10 @@ index 5f6a6f538fb8e21279d99b3dbe74a583f1592967..18837dceef7a197d0984b5363595ee11
 +  SetSchedulerThrottling(bool allowed);
  };
 diff --git a/third_party/blink/public/web/web_view.h b/third_party/blink/public/web/web_view.h
-index c8655d9270b812df04f27025ff29a2fb6d2a4066..2f83e5ce40f8217ff5d53f7205299ad7ac4d2013 100644
+index 2c3930e849719dce3871c12b073966ca370e5e43..990f88a20320a2f6f58cf2e0b4d37e398d5f7fda 100644
 --- a/third_party/blink/public/web/web_view.h
 +++ b/third_party/blink/public/web/web_view.h
-@@ -367,6 +367,7 @@ class BLINK_EXPORT WebView {
+@@ -369,6 +369,7 @@ class BLINK_EXPORT WebView {
    // Scheduling -----------------------------------------------------------
  
    virtual PageScheduler* Scheduler() const = 0;
@@ -72,10 +72,10 @@ index c8655d9270b812df04f27025ff29a2fb6d2a4066..2f83e5ce40f8217ff5d53f7205299ad7
    // Visibility -----------------------------------------------------------
  
 diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
-index 2e8500ac411bec392ec85c798b8379140917792b..490a381e1afd0a175cd1ca12926a21278c051712 100644
+index bb5b2ecb9088938e1c792cfb6c08e1f30fed2a7c..10692a1eb265f18756a1d9c4f39fa504f83b8144 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
-@@ -3827,13 +3827,21 @@ PageScheduler* WebViewImpl::Scheduler() const {
+@@ -3896,13 +3896,21 @@ PageScheduler* WebViewImpl::Scheduler() const {
    return GetPage()->GetPageScheduler();
  }
  
@@ -99,10 +99,10 @@ index 2e8500ac411bec392ec85c798b8379140917792b..490a381e1afd0a175cd1ca12926a2127
    if (!is_initial_state) {
      for (auto& observer : observers_)
 diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
-index ac623b8bd6c06a2a1def5d9761f8d0d3f845fc95..c420285f1fafff4af090a9dbe38debddaea57dfd 100644
+index 421ca0b15eea5958d18e52118613c388aeef7dce..c3751889cc1289f237f9f8e0e22f321e8e793778 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.h
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.h
-@@ -440,6 +440,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
+@@ -441,6 +441,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
    LocalDOMWindow* PagePopupWindow() const;
  
    PageScheduler* Scheduler() const override;
@@ -110,7 +110,7 @@ index ac623b8bd6c06a2a1def5d9761f8d0d3f845fc95..c420285f1fafff4af090a9dbe38debdd
    void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
                            bool is_initial_state) override;
    mojom::blink::PageVisibilityState GetVisibilityState() override;
-@@ -896,6 +897,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
+@@ -904,6 +905,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
    // If true, we send IPC messages when |preferred_size_| changes.
    bool send_preferred_size_changes_ = false;
  

+ 10 - 10
patches/chromium/allow_in-process_windows_to_have_different_web_prefs.patch

@@ -8,10 +8,10 @@ WebPreferences of in-process child windows, rather than relying on
 process-level command line switches, as before.
 
 diff --git a/third_party/blink/common/web_preferences/web_preferences.cc b/third_party/blink/common/web_preferences/web_preferences.cc
-index 86791679979e715308090c5868cac9d54169d812..92d1c191249a2922a9a1196fabfc61461aeda944 100644
+index 0997787979ba293e78211783d8d9993af50ac1c8..2e25e32d0e46470bc4d1a2254fc6737d848791ef 100644
 --- a/third_party/blink/common/web_preferences/web_preferences.cc
 +++ b/third_party/blink/common/web_preferences/web_preferences.cc
-@@ -142,6 +142,19 @@ WebPreferences::WebPreferences()
+@@ -144,6 +144,19 @@ WebPreferences::WebPreferences()
        v8_cache_options(blink::mojom::V8CacheOptions::kDefault),
        record_whole_document(false),
        stylus_handwriting_enabled(false),
@@ -32,10 +32,10 @@ index 86791679979e715308090c5868cac9d54169d812..92d1c191249a2922a9a1196fabfc6146
        accelerated_video_decode_enabled(false),
        animation_policy(
 diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
-index 22220de13b6d7b88cfe0b02367836f7bd5e139b5..4aad04688926066c75d07aea9a6d2a5932e37979 100644
+index d557c270b484c3152830b0678c90691c983538ad..de0a4e4ab43072d0a815724a772aa42006f63fd5 100644
 --- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
 +++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
-@@ -148,6 +148,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
+@@ -152,6 +152,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
    out->v8_cache_options = data.v8_cache_options();
    out->record_whole_document = data.record_whole_document();
    out->stylus_handwriting_enabled = data.stylus_handwriting_enabled();
@@ -56,7 +56,7 @@ index 22220de13b6d7b88cfe0b02367836f7bd5e139b5..4aad04688926066c75d07aea9a6d2a59
    out->accelerated_video_decode_enabled =
        data.accelerated_video_decode_enabled();
 diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h
-index 418233a0c46fa0837c9bd11e360d5279c1b1ff6d..b47ba60ec901460db3b1a8a2f81f5b7a9006c647 100644
+index 2ab2f3af95aaa1b1ed8f0530c6e13b8d62ed9ded..72c03d606d5c5ef0e5a699bc9380d573631f5518 100644
 --- a/third_party/blink/public/common/web_preferences/web_preferences.h
 +++ b/third_party/blink/public/common/web_preferences/web_preferences.h
 @@ -10,6 +10,7 @@
@@ -67,7 +67,7 @@ index 418233a0c46fa0837c9bd11e360d5279c1b1ff6d..b47ba60ec901460db3b1a8a2f81f5b7a
  #include "net/nqe/effective_connection_type.h"
  #include "third_party/blink/public/common/common_export.h"
  #include "third_party/blink/public/mojom/css/preferred_color_scheme.mojom-shared.h"
-@@ -158,6 +159,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
+@@ -159,6 +160,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
    // If true, stylus handwriting recognition to text input will be available in
    // editable input fields which are non-password type.
    bool stylus_handwriting_enabled;
@@ -88,7 +88,7 @@ index 418233a0c46fa0837c9bd11e360d5279c1b1ff6d..b47ba60ec901460db3b1a8a2f81f5b7a
    // This flags corresponds to a Page's Settings' setCookieEnabled state. It
    // only controls whether or not the "document.cookie" field is properly
 diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
-index 625db31846992c54083b30b2990fb359e6a3b3cd..1ccf341ecce1cf2ca17e3d4f7d5c42b8309caf96 100644
+index 0222f3671842c3a707e2dd9aeaec72a6f94afe7c..882556b4bdea1dc9cb418e0e9f3cc32966111a67 100644
 --- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
 +++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
 @@ -6,6 +6,7 @@
@@ -99,7 +99,7 @@ index 625db31846992c54083b30b2990fb359e6a3b3cd..1ccf341ecce1cf2ca17e3d4f7d5c42b8
  #include "mojo/public/cpp/bindings/struct_traits.h"
  #include "net/nqe/effective_connection_type.h"
  #include "third_party/blink/public/common/common_export.h"
-@@ -434,6 +435,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
+@@ -439,6 +440,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
      return r.stylus_handwriting_enabled;
    }
  
@@ -153,7 +153,7 @@ index 625db31846992c54083b30b2990fb359e6a3b3cd..1ccf341ecce1cf2ca17e3d4f7d5c42b8
      return r.cookie_enabled;
    }
 diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
-index 5d764552d3f8bc30b6d6efa83ca3ff120dba4b54..cbd2f58730c107eafba6358b12517e7d55bbdf0c 100644
+index 1e04b372e8a7839a05b2304ead80a04689cd850c..ead0401600b38d362aec21ee77b3c71f1d13649f 100644
 --- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
 +++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
 @@ -9,6 +9,7 @@ import "third_party/blink/public/mojom/css/preferred_contrast.mojom";
@@ -164,7 +164,7 @@ index 5d764552d3f8bc30b6d6efa83ca3ff120dba4b54..cbd2f58730c107eafba6358b12517e7d
  
  enum PointerType {
    kPointerNone                              = 1,             // 1 << 0
-@@ -208,6 +209,19 @@ struct WebPreferences {
+@@ -218,6 +219,19 @@ struct WebPreferences {
    // If true, stylus handwriting recognition to text input will be available in
    // editable input fields which are non-password type.
    bool stylus_handwriting_enabled;

+ 1 - 1
patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch

@@ -6,7 +6,7 @@ Subject: allow new privileges in unsandboxed child processes
 This allows unsandboxed child process to launch setuid processes on Linux.
 
 diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
-index b7f21237e87fa994b304a26fea8fec2531bca8de..7f6a4197aa7da2ba6a16cd83b78243e49ec1f2f4 100644
+index 1b4f9c8e3b79abcab08b9bfb80109d7f032d9d5f..6d8aa39ab75edcba3e34134566c9fcbe56a7ec57 100644
 --- a/content/browser/child_process_launcher_helper_linux.cc
 +++ b/content/browser/child_process_launcher_helper_linux.cc
 @@ -62,6 +62,15 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(

+ 6 - 6
patches/chromium/blink_local_frame.patch

@@ -15,10 +15,10 @@ Refs changes in:
 This patch reverts the changes to fix associated crashes in Electron.
 
 diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
-index 33c676021af1165993cb20d92378dea3ab3bd8d4..98fc59d9dac47fa6f0725e088ddc2f9dc70ecc7e 100644
+index b7bff829d779036ce0341b52ce9adc28eac91fa2..79b48d028ff6742d0d43ac6d32242f505587dafd 100644
 --- a/third_party/blink/renderer/core/frame/frame.cc
 +++ b/third_party/blink/renderer/core/frame/frame.cc
-@@ -124,14 +124,6 @@ bool Frame::Detach(FrameDetachType type) {
+@@ -125,14 +125,6 @@ bool Frame::Detach(FrameDetachType type) {
  
    DCHECK(!IsDetached());
  
@@ -33,7 +33,7 @@ index 33c676021af1165993cb20d92378dea3ab3bd8d4..98fc59d9dac47fa6f0725e088ddc2f9d
    if (type == FrameDetachType::kRemove) {
      if (provisional_frame_) {
        provisional_frame_->Detach(FrameDetachType::kRemove);
-@@ -155,6 +147,14 @@ bool Frame::Detach(FrameDetachType type) {
+@@ -156,6 +148,14 @@ bool Frame::Detach(FrameDetachType type) {
      GetWindowProxyManager()->ClearForSwap();
    }
  
@@ -49,10 +49,10 @@ index 33c676021af1165993cb20d92378dea3ab3bd8d4..98fc59d9dac47fa6f0725e088ddc2f9d
    // its owning reference back to our owning LocalFrame.
    client_->Detached(type);
 diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
-index 34cb438b0559cc133c8be67768fec35c4890e946..8ebcae8f67814537a5350f89d163e2a510532f7f 100644
+index 9cf36959fc6afeb56a8a03e88698515df9b7b1c0..176039ff509633ba771b820012f85fc19f914d91 100644
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
-@@ -576,10 +576,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -622,10 +622,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
    }
    DCHECK(!view_ || !view_->IsAttached());
  
@@ -63,7 +63,7 @@ index 34cb438b0559cc133c8be67768fec35c4890e946..8ebcae8f67814537a5350f89d163e2a5
    if (!Client())
      return false;
  
-@@ -627,6 +623,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -673,6 +669,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
    DCHECK(!view_->IsAttached());
    Client()->WillBeDetached();
  

+ 1 - 1
patches/chromium/boringssl_build_gn.patch

@@ -6,7 +6,7 @@ Subject: boringssl BUILD.gn
 Build BoringSSL with some extra functions that nodejs needs.
 
 diff --git a/third_party/boringssl/BUILD.gn b/third_party/boringssl/BUILD.gn
-index dfd4ff9d338683214566345f1c6a0a3add12094c..6c14f780e7cc1478385da23e843256f101206220 100644
+index 40073723173388015f0c78899214ba155e7cdc53..72978c43a522e5716ba06e8b989710cc99bd8773 100644
 --- a/third_party/boringssl/BUILD.gn
 +++ b/third_party/boringssl/BUILD.gn
 @@ -44,6 +44,20 @@ config("no_asm_config") {

+ 3 - 3
patches/chromium/build_add_electron_tracing_category.patch

@@ -8,14 +8,14 @@ categories in use are known / declared.  This patch is required for us
 to introduce a new Electron category for Electron-specific tracing.
 
 diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h
-index 686b0af1442fb43669782e524779dd69814f17cc..1ad2455893384b0330afe0be0c731d7847b57510 100644
+index 7146ce14ee1a235b134ed4c7b16fb2a37f63a865..bf4dbc1813944135d67700fd6e744dfc80dd777d 100644
 --- a/base/trace_event/builtin_categories.h
 +++ b/base/trace_event/builtin_categories.h
-@@ -81,6 +81,7 @@
+@@ -80,6 +80,7 @@
    X("drmcursor")                                                         \
    X("dwrite")                                                            \
    X("DXVA_Decoding")                                                     \
 +  X("electron")                                                          \
    X("evdev")                                                             \
    X("event")                                                             \
-   X("exo")                                                               \
+   X("event_latency")                                                     \

+ 8 - 8
patches/chromium/build_disable_partition_alloc_on_mac.patch

@@ -9,15 +9,15 @@ and can be removed when the crash in fork is resolved.
 Related issue: https://github.com/electron/electron/issues/32718
 
 diff --git a/build_overrides/partition_alloc.gni b/build_overrides/partition_alloc.gni
-index e1fa5fe9f6da68451d364fadbc021239a8c3e19a..4850698ef66776333fad27812a5414a9aa55fe08 100644
+index c2f7bd2958ed447f23d9b45bf09c8ed47c88c5e7..681a8d2b829eba05e77d2904e8a27d8d983a4a75 100644
 --- a/build_overrides/partition_alloc.gni
 +++ b/build_overrides/partition_alloc.gni
-@@ -42,7 +42,7 @@ _disable_partition_alloc_everywhere = is_component_build || (is_win && is_debug)
- 
- # - NaCl: No plans to support it.
- # - iOS: not done yet.
--_is_partition_alloc_everywhere_platform = !is_nacl && !is_ios
-+_is_partition_alloc_everywhere_platform = !is_nacl && !is_ios && !is_mac
+@@ -45,7 +45,7 @@ _disable_partition_alloc_everywhere = is_component_build || (is_win && is_debug)
+ if (is_ios) {
+   _is_partition_alloc_everywhere_platform = ios_partition_alloc_enabled
+ } else {
+-  _is_partition_alloc_everywhere_platform = !is_nacl
++  _is_partition_alloc_everywhere_platform = !is_nacl && !is_mac
+ }
  
  # Under Windows debug build, the allocator shim is not compatible with CRT.
- #     NaCl in particular does seem to link some binaries statically

+ 19 - 20
patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch

@@ -11,10 +11,10 @@ if we ever align our .pak file generation with Chrome we can remove this
 patch.
 
 diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
-index 8f003ac2da1e49bc2bbf3a7cce1a648980e325c1..f216efc553847fe1ce41e41c8a7144d2f6911dee 100644
+index cf53c168b31fecca8fd07f167d1e3523bc3be568..b13ffdfb9ffdaea0908b0b4b8260666f2c24988b 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
-@@ -187,11 +187,16 @@ if (!is_android && !is_mac) {
+@@ -186,11 +186,16 @@ if (!is_android && !is_mac) {
          "common/crash_keys.h",
        ]
  
@@ -33,10 +33,10 @@ index 8f003ac2da1e49bc2bbf3a7cce1a648980e325c1..f216efc553847fe1ce41e41c8a7144d2
          "//base",
          "//build:branding_buildflags",
 diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
-index 6fd94d13f11645f389b0c5cbd185e40c86f11d44..5333a8a16ed62747830083c427a07a9546f0a42d 100644
+index 717724a0736dfa27e61697cbfb2df9040647898b..21982376d6d9537b62ad8ba6b751b46db1fea62c 100644
 --- a/chrome/browser/BUILD.gn
 +++ b/chrome/browser/BUILD.gn
-@@ -4557,7 +4557,7 @@ static_library("browser") {
+@@ -4550,7 +4550,7 @@ static_library("browser") {
  
      # On Windows, the hashes are embedded in //chrome:chrome_initial rather
      # than here in :chrome_dll.
@@ -46,18 +46,18 @@ index 6fd94d13f11645f389b0c5cbd185e40c86f11d44..5333a8a16ed62747830083c427a07a95
        sources += [ "certificate_viewer_stub.cc" ]
      }
 diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
-index 18ca933e7a07e73c1dcd7dc60be42c6180653b59..d01b8278141a4f19f3888f895efc24a415fe45b3 100644
+index 2a859f1f0646e4a95af08b7d6d871857cdb9bddc..feefed02d976eadcad82c74b4349e5529b725a91 100644
 --- a/chrome/test/BUILD.gn
 +++ b/chrome/test/BUILD.gn
-@@ -6229,7 +6229,6 @@ test("unit_tests") {
+@@ -6383,7 +6383,6 @@ test("unit_tests") {
  
      deps += [
        "//chrome:other_version",
 -      "//chrome:packed_resources_integrity",
        "//chrome//services/util_win:unit_tests",
        "//chrome/app:chrome_dll_resources",
-       "//chrome/app:crash_reporter_client_win_unit_tests",
-@@ -6255,6 +6254,10 @@ test("unit_tests") {
+       "//chrome/app:win_unit_tests",
+@@ -6409,6 +6408,10 @@ test("unit_tests") {
        "//ui/resources",
      ]
  
@@ -68,23 +68,22 @@ index 18ca933e7a07e73c1dcd7dc60be42c6180653b59..d01b8278141a4f19f3888f895efc24a4
      ldflags = [
        "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
        "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
-@@ -7167,7 +7170,7 @@ test("unit_tests") {
+@@ -7334,7 +7337,6 @@ test("unit_tests") {
      }
  
      deps += [
 -      "//chrome:packed_resources_integrity_hash",
-+    # "//chrome:packed_resources_integrity_hash",
+       "//chrome/browser/apps:icon_standardizer",
        "//chrome/browser/apps/app_service",
        "//chrome/browser/apps/app_service:test_support",
-       "//chrome/browser/enterprise/connectors/analysis:features",
-@@ -7300,6 +7303,10 @@ test("unit_tests") {
-     }
-   }
+@@ -7410,6 +7412,10 @@ test("unit_tests") {
+       "//ui/webui/resources/js/browser_command:mojo_bindings",
+     ]
  
-+  if (!is_electron_build) {
-+    deps += [ "//chrome:packed_resources_integrity_hash" ]
-+  }
++    if (!is_electron_build) {
++      deps += [ "//chrome:packed_resources_integrity_hash" ]
++    }
 +
-   if (is_chromeos_ash) {
-     sources -= [
-       "../browser/policy/cloud/user_policy_signin_service_unittest.cc",
+     data += [ "//ash/components/arc/test/data/icons/" ]
+ 
+     if (include_js_tests) {

+ 1 - 1
patches/chromium/build_gn.patch

@@ -14,7 +14,7 @@ tradeoff is that switching from MAS_BUILD to !MAS_BUILD or vice-versa will
 rebuild the entire tree.
 
 diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
-index e675e08bee105e475ae7aa784d030d5dbaa12080..5a4570c4699cde1376c21fb50954b6562acd999f 100644
+index e4925e51432533b8ecc521b6fd8dd37b33dce2e5..cae98422abedad1eb1dc0b3e0baf0ca341b31ec7 100644
 --- a/build/config/BUILDCONFIG.gn
 +++ b/build/config/BUILDCONFIG.gn
 @@ -123,6 +123,9 @@ if (current_os == "") {

+ 1 - 1
patches/chromium/build_make_libcxx_abi_unstable_false_for_electron.patch

@@ -6,7 +6,7 @@ Subject: build: make libcxx_abi_unstable false for electron
 https://nornagon.medium.com/a-libc-odyssey-973e51649063
 
 diff --git a/buildtools/third_party/libc++/__config_site b/buildtools/third_party/libc++/__config_site
-index 2df8632ec45777b387988fea1f2932661ed5ff3c..8b9995a6144f77d2772debf0e772b5e6d4063929 100644
+index 4ac81de659b1e70fd64d0a538a48f2e1f1530b5e..135141c8b7f6f20ee5a6df5a3e469f8da5cc837b 100644
 --- a/buildtools/third_party/libc++/__config_site
 +++ b/buildtools/third_party/libc++/__config_site
 @@ -12,7 +12,6 @@

+ 58 - 50
patches/chromium/build_only_use_the_mas_build_config_in_the_required_components.patch

@@ -6,10 +6,10 @@ Subject: build: only use the mas build config in the required components
 Before landing this patch should be split into the relevant MAS patches, or at least the patch this one partially reverts
 
 diff --git a/base/BUILD.gn b/base/BUILD.gn
-index 29344e62d32b50cceef20c5c869c77f992880667..90dbf4ad6f38f6380aa65679d8114fd8cb230444 100644
+index 80f6eaf01c022b979ff8c3049e7b1d66aaa605c3..c472e10fdc5c9cce7934e584f2848e74aecd8801 100644
 --- a/base/BUILD.gn
 +++ b/base/BUILD.gn
-@@ -1485,6 +1485,7 @@ component("base") {
+@@ -1035,6 +1035,7 @@ component("base") {
      "//build/config/compiler:prevent_unsafe_narrowing",
      "//build/config/compiler:wexit_time_destructors",
      "//build/config/compiler:wglobal_constructors",
@@ -18,7 +18,7 @@ index 29344e62d32b50cceef20c5c869c77f992880667..90dbf4ad6f38f6380aa65679d8114fd8
  
    deps = [
 diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
-index 5a4570c4699cde1376c21fb50954b6562acd999f..7172c144eacccf8efce6cc85545599ecf14c5d4a 100644
+index cae98422abedad1eb1dc0b3e0baf0ca341b31ec7..6bdef81c3a027942e2987c0005d67d10c5c1089c 100644
 --- a/build/config/BUILDCONFIG.gn
 +++ b/build/config/BUILDCONFIG.gn
 @@ -355,7 +355,6 @@ default_compiler_configs = [
@@ -29,11 +29,11 @@ index 5a4570c4699cde1376c21fb50954b6562acd999f..7172c144eacccf8efce6cc85545599ec
  ]
  
  if (is_win) {
-diff --git a/components/os_crypt/BUILD.gn b/components/os_crypt/BUILD.gn
-index 8448ff2d912ed8664ba1117397a2407c08e9a578..5f6bb1a87615c474e06209fc8034ff36ee6a5b75 100644
---- a/components/os_crypt/BUILD.gn
-+++ b/components/os_crypt/BUILD.gn
-@@ -65,6 +65,8 @@ component("os_crypt") {
+diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn
+index 3314c2a5cdcef04d7f1a8bf0e07cafa073f2815e..ef75cef4e449bb5c689f95ab664c19a1c2362b16 100644
+--- a/components/os_crypt/sync/BUILD.gn
++++ b/components/os_crypt/sync/BUILD.gn
+@@ -70,6 +70,8 @@ component("os_crypt") {
        "keychain_password_mac.mm",
        "os_crypt_mac.mm",
      ]
@@ -43,7 +43,7 @@ index 8448ff2d912ed8664ba1117397a2407c08e9a578..5f6bb1a87615c474e06209fc8034ff36
  
    if (is_win) {
 diff --git a/components/remote_cocoa/app_shim/BUILD.gn b/components/remote_cocoa/app_shim/BUILD.gn
-index 1adfddd0fa65aac18e4bc98a38e52dfd62701ff4..6ac3d77d7259970394537e164097cd8dbefec6b0 100644
+index 0625f07f317de46af619fdb279be78d9ecdc0029..5897820839d6d57ada22a83fe753e3a6b3d752de 100644
 --- a/components/remote_cocoa/app_shim/BUILD.gn
 +++ b/components/remote_cocoa/app_shim/BUILD.gn
 @@ -16,6 +16,7 @@ component("app_shim") {
@@ -55,23 +55,31 @@ index 1adfddd0fa65aac18e4bc98a38e52dfd62701ff4..6ac3d77d7259970394537e164097cd8d
      "alert.h",
      "alert.mm",
 diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
-index c320ce10cfcd8b62dc516871bae900f6da9600f5..c9347d61c76098c9df5e0142872b5078017e6270 100644
+index a808f967a95fca4847588f1d88a210bfd7f53767..7c3c71cac9162b8f565494fdad16fb06aa9563d5 100644
 --- a/components/viz/service/BUILD.gn
 +++ b/components/viz/service/BUILD.gn
-@@ -306,6 +306,8 @@ viz_component("service") {
+@@ -314,6 +314,7 @@ viz_component("service") {
  
-     deps += [ "//ui/accelerated_widget_mac" ]
-     frameworks = [ "IOSurface.framework" ]
-+
+       frameworks += [ "CoreGraphics.framework" ]
+     }
 +    configs = ["//electron/build/config:mas_build"]
    }
  
    if (is_android || use_ozone) {
+@@ -567,6 +568,8 @@ viz_source_set("unit_tests") {
+       "display_embedder/software_output_device_mac_unittest.mm",
+     ]
+     frameworks = [ "IOSurface.framework" ]
++
++    configs += ["//electron/build/config:mas_build"]
+   }
+ 
+   if (is_win) {
 diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
-index 9ba992e9ce8e107949db8dfc928a478b50fea35a..564467c1dda1210085488aed47d64052c457bd8a 100644
+index fccddda5803b6838bcfde366b4812308fce5522e..6fa821c72d385579bbc6f1b86443323138e32f77 100644
 --- a/content/browser/BUILD.gn
 +++ b/content/browser/BUILD.gn
-@@ -57,6 +57,7 @@ source_set("browser") {
+@@ -56,6 +56,7 @@ source_set("browser") {
      "//content:content_implementation",
      "//v8:external_startup_data",
    ]
@@ -80,10 +88,10 @@ index 9ba992e9ce8e107949db8dfc928a478b50fea35a..564467c1dda1210085488aed47d64052
    libs = []
    frameworks = []
 diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
-index d01ad9dbeabeef8a5679823d8b1678d0a46c3865..2c4d34bc40aec5de7603ada2777e532be4416fce 100644
+index 1bfc069882b2fd56bb4e872c792809615e4f70c9..e5df5a35d270229787d0d9637b23813e2e1da115 100644
 --- a/content/common/BUILD.gn
 +++ b/content/common/BUILD.gn
-@@ -170,6 +170,7 @@ source_set("common") {
+@@ -168,6 +168,7 @@ source_set("common") {
      "//content:content_implementation",
      "//build/config:precompiled_headers",
    ]
@@ -92,10 +100,10 @@ index d01ad9dbeabeef8a5679823d8b1678d0a46c3865..2c4d34bc40aec5de7603ada2777e532b
    public_deps = [
      ":mojo_bindings",
 diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
-index a1f691c0d3452b440210190c467f96c727b3ec58..2c4808ec4b7018165947c311816d113067e8542c 100644
+index 3ec54c242fb920a53fcaa6d8040f2ec88c2727df..27dee1596183d2ead5290a60c08e47e69e905d21 100644
 --- a/content/renderer/BUILD.gn
 +++ b/content/renderer/BUILD.gn
-@@ -220,6 +220,7 @@ target(link_target_type, "renderer") {
+@@ -224,6 +224,7 @@ target(link_target_type, "renderer") {
    }
  
    configs += [ "//content:content_implementation" ]
@@ -104,19 +112,19 @@ index a1f691c0d3452b440210190c467f96c727b3ec58..2c4808ec4b7018165947c311816d1130
  
    public_deps = [
 diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn
-index 0b526044dcc7cbc21cc25cfdd7be8e4cdd8f06eb..c5c61601a684ea08e2279b4fc6b77d81ff2f03e1 100644
+index 5e9f447e4d946cd48d7b18d81c256baa169f93ea..fcfda1b4fde66c39b53a52d57c5e57b7f239bda1 100644
 --- a/device/bluetooth/BUILD.gn
 +++ b/device/bluetooth/BUILD.gn
-@@ -249,6 +249,7 @@ component("bluetooth") {
+@@ -240,6 +240,7 @@ component("bluetooth") {
        "IOKit.framework",
        "Foundation.framework",
      ]
 +    configs += ["//electron/build/config:mas_build"]
    }
  
-   if (is_win) {
+   if (is_mac) {
 diff --git a/gpu/ipc/service/BUILD.gn b/gpu/ipc/service/BUILD.gn
-index e5bc3c86e07873f5ad5a54fba950e3105049ab2b..6774273357a7b6a465a9918f81b4cee90c0859a4 100644
+index 89e0e91bb24cb1b92abb8670f56328499c0669e0..6b6dd9c74011c1acafb931842d6675ff65e17bd9 100644
 --- a/gpu/ipc/service/BUILD.gn
 +++ b/gpu/ipc/service/BUILD.gn
 @@ -119,6 +119,7 @@ component("service") {
@@ -125,22 +133,22 @@ index e5bc3c86e07873f5ad5a54fba950e3105049ab2b..6774273357a7b6a465a9918f81b4cee9
      defines += [ "GL_SILENCE_DEPRECATION" ]
 +    configs += ["//electron/build/config:mas_build"]
    }
-   if (is_android) {
+   if (is_ios) {
      sources += [
 diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
-index 44635f13048890b20c74870d26c4e74bab363ddb..33ad7650832b7572949fb6f362bef02879f4c31b 100644
+index f1b4cd5055d00df425926e83a3b2e7f32af4c2e6..a80aaa7fde1fd9c70e7038aef4e322f1ec6a307a 100644
 --- a/media/audio/BUILD.gn
 +++ b/media/audio/BUILD.gn
-@@ -188,6 +188,7 @@ source_set("audio") {
-       "CoreAudio.framework",
-       "CoreFoundation.framework",
+@@ -194,6 +194,7 @@ source_set("audio") {
+       "mac/coreaudio_dispatch_override.h",
      ]
+     frameworks += [ "AudioUnit.framework" ]
 +    configs += ["//electron/build/config:mas_build"]
    }
  
-   if (is_win) {
+   if (is_ios) {
 diff --git a/net/dns/BUILD.gn b/net/dns/BUILD.gn
-index 1467334057a0f2ae4f2d2bb1bae9ec0b1ca1d77b..c358a3d9e16865eb8247b67c4369e3aaeea1a49a 100644
+index a8193d411da14f4ff0087fba81e63809832d1806..94c410b59ab7b40654fb214a6a9d828170fe2095 100644
 --- a/net/dns/BUILD.gn
 +++ b/net/dns/BUILD.gn
 @@ -173,6 +173,8 @@ source_set("dns") {
@@ -153,7 +161,7 @@ index 1467334057a0f2ae4f2d2bb1bae9ec0b1ca1d77b..c358a3d9e16865eb8247b67c4369e3aa
  
  # The standard API of net/dns.
 diff --git a/sandbox/mac/BUILD.gn b/sandbox/mac/BUILD.gn
-index b078486d595ec38e5db1462486ab31a2951430e0..5cafd91460d5f98a20caa884834cc3edb116d9b2 100644
+index 5e9fc18352d1bf0939f8366d2282b49aeb307994..69dcc2cafa27b3d8bdf3fe8d0a22a98050bb3cc6 100644
 --- a/sandbox/mac/BUILD.gn
 +++ b/sandbox/mac/BUILD.gn
 @@ -37,6 +37,7 @@ component("seatbelt") {
@@ -181,10 +189,10 @@ index b078486d595ec38e5db1462486ab31a2951430e0..5cafd91460d5f98a20caa884834cc3ed
  
  source_set("sandbox_unittests") {
 diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
-index fabf49654cebc659348e3505487b2be583647fed..58efb9cfe6e4ed44a8e3753ef4af8e4db84617cd 100644
+index f61e0ad85e7e7faf97274bad4b59fc91c41e3168..c308bcb30f57e7b0c9ae58420bedd343f4b54184 100644
 --- a/third_party/blink/renderer/core/BUILD.gn
 +++ b/third_party/blink/renderer/core/BUILD.gn
-@@ -280,6 +280,7 @@ component("core") {
+@@ -304,6 +304,7 @@ component("core") {
    configs -= core_config_remove
    configs += core_config_add
    configs += [ "//v8:external_startup_data" ]
@@ -193,20 +201,20 @@ index fabf49654cebc659348e3505487b2be583647fed..58efb9cfe6e4ed44a8e3753ef4af8e4d
    public_deps = [
      ":core_generated",
 diff --git a/ui/accelerated_widget_mac/BUILD.gn b/ui/accelerated_widget_mac/BUILD.gn
-index 1ca2843130e81f9ea6be7a71b6b2a8d68bd413ae..712e4428bc9417f114a695a5980c488801007b77 100644
+index 7637db0ce03b9e8d242e47f5aff85c21967a541f..e66fdb98adb035a917942432806e0dfaff19e471 100644
 --- a/ui/accelerated_widget_mac/BUILD.gn
 +++ b/ui/accelerated_widget_mac/BUILD.gn
-@@ -53,6 +53,8 @@ component("accelerated_widget_mac") {
-     "OpenGL.framework",
+@@ -32,6 +32,8 @@ component("accelerated_widget_mac") {
      "QuartzCore.framework",
    ]
-+
-+  configs += ["//electron/build/config:mas_build"]
- }
  
- test("accelerated_widget_mac_unittests") {
++  configs += ["//electron/build/config:mas_build"]
++
+   if (is_ios) {
+     sources += [ "ca_layer_frame_sink_provider.h" ]
+   }
 diff --git a/ui/accessibility/platform/BUILD.gn b/ui/accessibility/platform/BUILD.gn
-index 3bec9f0f7d46f09842d785092295370c04d7b613..85aea7cc7fe5466aed6bf28f73409ce9b487e4b6 100644
+index ebc2470893838ec41ac1bf536c5a6db304bfa7cb..4a2082c2fed4e220cb8cbc2c803f682ca6f07179 100644
 --- a/ui/accessibility/platform/BUILD.gn
 +++ b/ui/accessibility/platform/BUILD.gn
 @@ -249,6 +249,7 @@ component("platform") {
@@ -218,19 +226,19 @@ index 3bec9f0f7d46f09842d785092295370c04d7b613..85aea7cc7fe5466aed6bf28f73409ce9
  
      if (use_atk) {
 diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
-index 8ed2cd062b2e9531742835c61f015975c7d59d40..989005583f46879f6ed32aa121d9dc2d7af0d589 100644
+index 90074c3e90d9b4bbfaf2c86f8c1a5a3c36babdc8..991bc348a5fb5c2e9a744b14ed5894fe3155f4c0 100644
 --- a/ui/base/BUILD.gn
 +++ b/ui/base/BUILD.gn
-@@ -348,6 +348,7 @@ component("base") {
+@@ -345,6 +345,7 @@ component("base") {
        "l10n/l10n_util_mac.mm",
        "resource/resource_bundle_mac.mm",
      ]
 +    configs += ["//electron/build/config:mas_build"]
    }
  
-   if (is_chromeos_lacros) {
+   if (is_apple) {
 diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
-index aadf9f2a52fd6bf4f027a070656c893b5025c714..445fa39d3676b80901ffb734bfb5ca1045dc4c41 100644
+index 7bd65e6d61d0845cf3a557a43b377ee7894fd7d1..91a470467ddd5e2118a08b5b63f96e5e94c554bc 100644
 --- a/ui/display/BUILD.gn
 +++ b/ui/display/BUILD.gn
 @@ -56,6 +56,10 @@ component("display") {
@@ -245,10 +253,10 @@ index aadf9f2a52fd6bf4f027a070656c893b5025c714..445fa39d3676b80901ffb734bfb5ca10
  
    if (is_win) {
 diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
-index d2692c7422e4694a783876addc1b283d451e937f..a07aaa7e88f38fa91c1254f7af03675cb22bf4e7 100644
+index af0e7466f1a265c9d55ba81f3b2c9c68dafa7767..d991513ee82f4406f578a4751bf30fac1910c741 100644
 --- a/ui/gfx/BUILD.gn
 +++ b/ui/gfx/BUILD.gn
-@@ -188,6 +188,7 @@ component("gfx") {
+@@ -193,6 +193,7 @@ component("gfx") {
        "scoped_ns_graphics_context_save_gstate_mac.h",
        "scoped_ns_graphics_context_save_gstate_mac.mm",
      ]
@@ -257,10 +265,10 @@ index d2692c7422e4694a783876addc1b283d451e937f..a07aaa7e88f38fa91c1254f7af03675c
    if (is_win) {
      sources += [
 diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
-index 36bc22a122193bf5ccd7e86df08cce7e5451a035..6d64206ee17042b6eef9ba15977eba0458903c75 100644
+index 14b9424f12ae3d3978f834e2bb765d9f18892ce5..7ad880f66fa720b3b708d0f4fe8ee4f81d98d10c 100644
 --- a/ui/views/BUILD.gn
 +++ b/ui/views/BUILD.gn
-@@ -664,6 +664,7 @@ component("views") {
+@@ -673,6 +673,7 @@ component("views") {
        "IOSurface.framework",
        "QuartzCore.framework",
      ]

+ 23 - 23
patches/chromium/can_create_window.patch

@@ -9,10 +9,10 @@ potentially prevent a window from being created.
 TODO(loc): this patch is currently broken.
 
 diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
-index 337aab0addc0a0e31df71b5dce3b62626b7f9504..080c99e23a4a81a4ddbf8a7689c8c10b66f9e039 100644
+index 7773acfa5ee3bae6d17a391d873abf399839eb25..3da982748c96b6e774d57af7ee3c873a5d474b9f 100644
 --- a/content/browser/renderer_host/render_frame_host_impl.cc
 +++ b/content/browser/renderer_host/render_frame_host_impl.cc
-@@ -7474,6 +7474,7 @@ void RenderFrameHostImpl::CreateNewWindow(
+@@ -7653,6 +7653,7 @@ void RenderFrameHostImpl::CreateNewWindow(
            last_committed_origin_, params->window_container_type,
            params->target_url, params->referrer.To<Referrer>(),
            params->frame_name, params->disposition, *params->features,
@@ -21,10 +21,10 @@ index 337aab0addc0a0e31df71b5dce3b62626b7f9504..080c99e23a4a81a4ddbf8a7689c8c10b
            &no_javascript_access);
  
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 720156a65fe9804834aa943dbcad975076d99193..03082815e5c4de60da566176af10bc972cff0072 100644
+index 79e0289b713ceba36383b64bea6d7b0cd402db94..37daf25c2a2a8c72fce2c5c49e5799c4bccc54df 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -4127,6 +4127,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -4147,6 +4147,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
  
    auto* new_contents_impl = new_contents.get();
  
@@ -37,7 +37,7 @@ index 720156a65fe9804834aa943dbcad975076d99193..03082815e5c4de60da566176af10bc97
    // If the new frame has a name, make sure any SiteInstances that can find
    // this named frame have proxies for it.  Must be called after
    // SetSessionStorageNamespace, since this calls CreateRenderView, which uses
-@@ -4168,12 +4174,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -4188,12 +4194,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
      AddWebContentsDestructionObserver(new_contents_impl);
    }
  
@@ -51,10 +51,10 @@ index 720156a65fe9804834aa943dbcad975076d99193..03082815e5c4de60da566176af10bc97
                               new_contents_impl, opener, params.target_url,
                               params.referrer.To<Referrer>(), params.disposition,
 diff --git a/content/common/frame.mojom b/content/common/frame.mojom
-index d2f710218b4fb7c24be02ea1cc78abcfb5718fc9..4d6f86e5674cf4f419061a0f67f3700f7d10a16c 100644
+index c7cc09531bd7b2c67085a7a3d9f98ab060a62ccb..faa0a7cd254b84af686f0c321f4d718f85636770 100644
 --- a/content/common/frame.mojom
 +++ b/content/common/frame.mojom
-@@ -591,6 +591,10 @@ struct CreateNewWindowParams {
+@@ -599,6 +599,10 @@ struct CreateNewWindowParams {
    // The navigation initiator's user activation and ad status.
    blink.mojom.NavigationInitiatorActivationAndAdStatus
        initiator_activation_and_ad_status;
@@ -66,10 +66,10 @@ index d2f710218b4fb7c24be02ea1cc78abcfb5718fc9..4d6f86e5674cf4f419061a0f67f3700f
  
  // Operation result when the renderer asks the browser to create a new window.
 diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
-index 28afdb7d6f13a0a7331048197762acb44381bc57..b8712563ca3804872a6aab6b6f0fd170f21bbcd6 100644
+index cd77eefb577e610612e5af8cd7b89c064b6b6fe6..789df626f7b0592868c77c2e2ddc35522865be46 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
-@@ -634,6 +634,8 @@ bool ContentBrowserClient::CanCreateWindow(
+@@ -636,6 +636,8 @@ bool ContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,
@@ -79,7 +79,7 @@ index 28afdb7d6f13a0a7331048197762acb44381bc57..b8712563ca3804872a6aab6b6f0fd170
      bool opener_suppressed,
      bool* no_javascript_access) {
 diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
-index 174a8d9197876cc7167407560fa011ed2e9d6adf..b1e3179eae105e29a360cc5a92c475e7c545704d 100644
+index 5500a0cec01ec6b48c0f8faadf1528ccc9eea120..552714d86b77b2346371b86ad6087db4bb54f9e5 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
 @@ -164,6 +164,7 @@ class NetworkService;
@@ -90,7 +90,7 @@ index 174a8d9197876cc7167407560fa011ed2e9d6adf..b1e3179eae105e29a360cc5a92c475e7
  }  // namespace network
  
  namespace sandbox {
-@@ -1029,6 +1030,8 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -1031,6 +1032,8 @@ class CONTENT_EXPORT ContentBrowserClient {
        const std::string& frame_name,
        WindowOpenDisposition disposition,
        const blink::mojom::WindowFeatures& features,
@@ -100,10 +100,10 @@ index 174a8d9197876cc7167407560fa011ed2e9d6adf..b1e3179eae105e29a360cc5a92c475e7
        bool opener_suppressed,
        bool* no_javascript_access);
 diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
-index 3c6897e12b0a14a7502158e1e977fe4ea318b41d..6f6a5eee43f3f5ecc89f907b825451d1bb833836 100644
+index 885899b151520e0173a5ca68c2613b1333cadddf..5b53ee691c0a07ed1655139ca2d90341b5fa55a3 100644
 --- a/content/public/browser/web_contents_delegate.cc
 +++ b/content/public/browser/web_contents_delegate.cc
-@@ -27,6 +27,17 @@ namespace content {
+@@ -28,6 +28,17 @@ namespace content {
  
  WebContentsDelegate::WebContentsDelegate() = default;
  
@@ -122,7 +122,7 @@ index 3c6897e12b0a14a7502158e1e977fe4ea318b41d..6f6a5eee43f3f5ecc89f907b825451d1
                                                   const OpenURLParams& params) {
    return nullptr;
 diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
-index 2717fd39b99c6c3f8b0cb8278fc5011dfb6d34a8..fae93468160463c098b5b115ef293989bbc1f38c 100644
+index 5da6f93293bc5ddae88c17ac2dd8d7037ba8e8f3..76d699790fb7d92587293b14332f696dc5460322 100644
 --- a/content/public/browser/web_contents_delegate.h
 +++ b/content/public/browser/web_contents_delegate.h
 @@ -16,6 +16,7 @@
@@ -131,9 +131,9 @@ index 2717fd39b99c6c3f8b0cb8278fc5011dfb6d34a8..fae93468160463c098b5b115ef293989
  #include "content/common/content_export.h"
 +#include "content/common/frame.mojom.h"
  #include "content/public/browser/eye_dropper.h"
+ #include "content/public/browser/fullscreen_types.h"
  #include "content/public/browser/invalidate_type.h"
- #include "content/public/browser/media_stream_request.h"
-@@ -342,6 +343,13 @@ class CONTENT_EXPORT WebContentsDelegate {
+@@ -343,6 +344,13 @@ class CONTENT_EXPORT WebContentsDelegate {
        const StoragePartitionConfig& partition_config,
        SessionStorageNamespace* session_storage_namespace);
  
@@ -148,10 +148,10 @@ index 2717fd39b99c6c3f8b0cb8278fc5011dfb6d34a8..fae93468160463c098b5b115ef293989
    // typically happens when popups are created.
    virtual void WebContentsCreated(WebContents* source_contents,
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index b5feb7b1c89954409c18f2a8d348ff1ca2f6389c..a0123eac7193282dbfba9712f0d88b2b87fccd9f 100644
+index 77a944d5f347f595ec525d4c43b25bc1eaf2d75d..ec5f9cd23baefd6a1fd6d0185566ebbad908c3aa 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -6290,6 +6290,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
+@@ -6265,6 +6265,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
        blink::GetNavigationInitiatorActivationAndAdStatus(
            request.HasUserGesture(), GetWebFrame()->IsAdScriptInStack());
  
@@ -163,10 +163,10 @@ index b5feb7b1c89954409c18f2a8d348ff1ca2f6389c..a0123eac7193282dbfba9712f0d88b2b
    // moved on send.
    bool is_background_tab =
 diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc
-index c1e5e53f49eee554daf7acbd097b3f3d4e2a084c..602f74dad295c86afa8506c0db7156966b4cce11 100644
+index 48a07780e61463b7e70e2a511bc6f81bd6fbdbf3..465cfb29380df203de7bcf2d27617b604097118a 100644
 --- a/content/web_test/browser/web_test_content_browser_client.cc
 +++ b/content/web_test/browser/web_test_content_browser_client.cc
-@@ -501,6 +501,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
+@@ -499,6 +499,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,
@@ -176,7 +176,7 @@ index c1e5e53f49eee554daf7acbd097b3f3d4e2a084c..602f74dad295c86afa8506c0db715696
      bool opener_suppressed,
      bool* no_javascript_access) {
 diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h
-index 55f3b2ce596f18fdffde7f23f01da98778816395..07496fded98e6ac926b219f56f769e2aab41b021 100644
+index 22254206063abe36739e1c0e7c065223ab6807d2..7f5d89f8dc8b46ac1338e73b0394872569d803b8 100644
 --- a/content/web_test/browser/web_test_content_browser_client.h
 +++ b/content/web_test/browser/web_test_content_browser_client.h
 @@ -84,6 +84,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -210,10 +210,10 @@ index a50a83d36f9172add44867ee0b0f1c89779b387e..c4ac7d4c885e764cfcfc3f2cd25e31b4
  
  }  // namespace blink
 diff --git a/third_party/blink/renderer/core/frame/local_dom_window.cc b/third_party/blink/renderer/core/frame/local_dom_window.cc
-index c88166f2b60dcb799f56bfecfd0a8a10e70a887f..6b58d128b238ebc98078e62f9f388d9e5f70c76d 100644
+index 8e675fcf1227af5123fd7a62a1eadd341aa5a9ec..4c023dbb0e659f027498e1c72fcf1dbe8b2de752 100644
 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc
 +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
-@@ -2213,6 +2213,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
+@@ -2211,6 +2211,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
    WebWindowFeatures window_features =
        GetWindowFeaturesFromString(features, entered_window, completed_url);
  

+ 6 - 6
patches/chromium/chore_add_electron_deps_to_gitignores.patch

@@ -6,10 +6,10 @@ Subject: chore: add electron deps to gitignores
 Makes things like "git status" quicker when developing electron locally
 
 diff --git a/.gitignore b/.gitignore
-index 13ace36474a9de85ba7111c4b9794206e112e46d..ee8c0a6daed14a51a76595546f02f9834986decc 100644
+index f39533c8951d81fba73910a89b5cf2de9bd34a02..00756eb8a32aec3bc109db9aa1b370ab9f0b1d26 100644
 --- a/.gitignore
 +++ b/.gitignore
-@@ -236,6 +236,7 @@ vs-chromium-project.txt
+@@ -238,6 +238,7 @@ vs-chromium-project.txt
  /delegate_execute
  /device/serial/device_serial_mojo.xml
  /docs/website
@@ -18,10 +18,10 @@ index 13ace36474a9de85ba7111c4b9794206e112e46d..ee8c0a6daed14a51a76595546f02f983
  /google_apis/internal
  /googleurl
 diff --git a/third_party/.gitignore b/third_party/.gitignore
-index d2d1b438f80fa6fe94c935f64d1ba007265bd3fa..cf0966f75b61e407aa781849bfc5b1b5a8d1e033 100644
+index 99375ca00842dabd41280333a680564ac557616e..825f913eb826de264ac101d6810c7f41aa822af2 100644
 --- a/third_party/.gitignore
 +++ b/third_party/.gitignore
-@@ -87,6 +87,7 @@
+@@ -90,6 +90,7 @@
  /directxsdk
  /dom_distiller_js/dist
  /eigen3/src
@@ -29,7 +29,7 @@ index d2d1b438f80fa6fe94c935f64d1ba007265bd3fa..cf0966f75b61e407aa781849bfc5b1b5
  /elfutils/src
  /emoji-metadata/src
  /emoji-segmenter/src
-@@ -186,6 +187,7 @@
+@@ -195,6 +196,7 @@
  /mocha
  /mockito/src
  /nacl_sdk_binaries/
@@ -37,7 +37,7 @@ index d2d1b438f80fa6fe94c935f64d1ba007265bd3fa..cf0966f75b61e407aa781849bfc5b1b5
  /nasm
  /nearby/src
  /neon_2_sse/src
-@@ -249,6 +251,7 @@
+@@ -258,6 +260,7 @@
  /speex
  /sqlite/src
  /sqlite4java/lib/

+ 12 - 12
patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch

@@ -7,11 +7,11 @@ With WCO, allow chromium to handle synthetic mouse events generated for touch
 actions in the non-client caption area.
 
 diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
-index e534b895eca4e28e003ef35de4a2fb5b32baf88b..756738951476ba1d509935d0eb152c978cfde7e6 100644
+index b2e8e4127d73d1c8f0f3698fe9c7f37a03868c06..79e00fd9f83dc6cb4114ceac53ea025dcb7595b7 100644
 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
 +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
-@@ -1204,6 +1204,10 @@ void DesktopWindowTreeHostWin::HandleWindowScaleFactorChanged(
-   }
+@@ -1209,6 +1209,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
+   window()->SetProperty(aura::client::kHeadlessBoundsKey, bounds);
  }
  
 +bool DesktopWindowTreeHostWin::HandleMouseEventForCaption(UINT message) const {
@@ -22,22 +22,22 @@ index e534b895eca4e28e003ef35de4a2fb5b32baf88b..756738951476ba1d509935d0eb152c97
  DesktopWindowTreeHostWin::GetSingletonDesktopNativeCursorManager() {
    return new DesktopNativeCursorManagerWin();
 diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
-index b23ba1bf3a49f72d1cd0f0ae4b0f316e7c15fa76..bf0a4869af4aaca15074fae42508b54aef611cf6 100644
+index 2b935ac09209c1b043aa416f886a84dff742826e..04b586a7fd15bc2e85cb62cd6cefe63461a2539e 100644
 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
 +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.h
-@@ -258,6 +258,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
-   void HandleWindowSizeChanging() override;
+@@ -259,6 +259,7 @@ class VIEWS_EXPORT DesktopWindowTreeHostWin
    void HandleWindowSizeUnchanged() override;
    void HandleWindowScaleFactorChanged(float window_scale_factor) override;
+   void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) override;
 +  bool HandleMouseEventForCaption(UINT message) const override;
  
    Widget* GetWidget();
    const Widget* GetWidget() const;
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 214a596da0dfdff2566a7642ac04e501655c5d88..dff84d16386acfb3ccc72a22878476f1ac463ea1 100644
+index 66444599384981681a3018b5de516e2242324285..c55e27bfc275ff63282f8d703dcdf723b5b2385d 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -3094,15 +3094,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
+@@ -3209,15 +3209,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
        SetMsgHandled(FALSE);
      // We must let Windows handle the caption buttons if it's drawing them, or
      // they won't work.
@@ -60,12 +60,12 @@ index 214a596da0dfdff2566a7642ac04e501655c5d88..dff84d16386acfb3ccc72a22878476f1
    }
  
 diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
-index da6afe2ae8940faebe3fbacfd7780fa0d5b1591a..4263d68e8b01eb961ab0e38d6b64b0c0b24146eb 100644
+index fde18715e33ee67f64740ebda7c641954360483c..cf1ea75f8e9dd1d95045736959c4f3ca1a27a1ab 100644
 --- a/ui/views/win/hwnd_message_handler_delegate.h
 +++ b/ui/views/win/hwnd_message_handler_delegate.h
-@@ -251,6 +251,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
-   // Called when the window scale factor has changed.
-   virtual void HandleWindowScaleFactorChanged(float window_scale_factor) = 0;
+@@ -255,6 +255,10 @@ class VIEWS_EXPORT HWNDMessageHandlerDelegate {
+   // Called when the headless window bounds has changed.
+   virtual void HandleHeadlessWindowBoundsChanged(const gfx::Rect& bounds) = 0;
  
 +  // Called when synthetic mouse event is generated for touch event on
 +  // caption buttons.

+ 23 - 0
patches/chromium/chore_defer_usb_service_getdevices_request_until_usb_service_is.patch

@@ -0,0 +1,23 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: John Kleinschmidt <[email protected]>
+Date: Thu, 2 Mar 2023 15:26:46 -0500
+Subject: chore: defer USB service GetDevices request until USB service is
+ ready.
+
+On macOS we need to wait until the USB service is ready before the list of
+devices is available. This should no longer be necessary if/when
+https://crbug.com/1096743 is completed.
+
+diff --git a/services/device/usb/usb_service_impl.cc b/services/device/usb/usb_service_impl.cc
+index 99456d1baa098e8a48b4a31cc8f5661586f7fc82..11d98208c85093598813897a144812c76bc67bea 100644
+--- a/services/device/usb/usb_service_impl.cc
++++ b/services/device/usb/usb_service_impl.cc
+@@ -198,7 +198,7 @@ void UsbServiceImpl::GetDevices(GetDevicesCallback callback) {
+     return;
+   }
+ 
+-  if (enumeration_in_progress_) {
++  if (enumeration_in_progress_ || !enumeration_ready_) {
+     pending_enumeration_callbacks_.push_back(std::move(callback));
+     return;
+   }

+ 5 - 5
patches/chromium/chore_introduce_blocking_api_for_electron.patch

@@ -7,10 +7,10 @@ This patch comes after Chromium removed the ScopedAllowIO API in favor
 of explicitly adding ScopedAllowBlocking calls as friends.
 
 diff --git a/base/threading/thread_restrictions.h b/base/threading/thread_restrictions.h
-index f5436c117c2663a6c69e139d8a21338137c79ef0..ef0290a799dfd916b3aa971a71b41326100dbb52 100644
+index 861c5f9da0506d8180d4e2a2af9c0c59a3f18bac..20d07b453ec28eb43736776f6cb6a6e20ded2885 100644
 --- a/base/threading/thread_restrictions.h
 +++ b/base/threading/thread_restrictions.h
-@@ -129,6 +129,7 @@ class FirefoxProfileLock;
+@@ -133,6 +133,7 @@ class FirefoxProfileLock;
  class KeyStorageLinux;
  class NativeBackendKWallet;
  class NativeDesktopMediaList;
@@ -18,7 +18,7 @@ index f5436c117c2663a6c69e139d8a21338137c79ef0..ef0290a799dfd916b3aa971a71b41326
  class Profile;
  class ProfileImpl;
  class StartupTabProviderImpl;
-@@ -265,6 +266,9 @@ class BackendImpl;
+@@ -269,6 +270,9 @@ class BackendImpl;
  class InFlightIO;
  bool CleanupDirectorySync(const base::FilePath&);
  }  // namespace disk_cache
@@ -28,7 +28,7 @@ index f5436c117c2663a6c69e139d8a21338137c79ef0..ef0290a799dfd916b3aa971a71b41326
  namespace enterprise_connectors {
  class LinuxKeyRotationCommand;
  }  // namespace enterprise_connectors
-@@ -553,6 +557,7 @@ class BASE_EXPORT ScopedAllowBlocking {
+@@ -574,6 +578,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
    friend class ::DesktopNotificationBalloon;
    friend class ::FirefoxProfileLock;
    friend class ::GaiaConfig;
@@ -36,7 +36,7 @@ index f5436c117c2663a6c69e139d8a21338137c79ef0..ef0290a799dfd916b3aa971a71b41326
    friend class ::ProfileImpl;
    friend class ::ScopedAllowBlockingForProfile;
    friend class ::StartupTabProviderImpl;
-@@ -593,6 +598,7 @@ class BASE_EXPORT ScopedAllowBlocking {
+@@ -611,6 +616,7 @@ class BASE_EXPORT [[maybe_unused, nodiscard]] ScopedAllowBlocking {
    friend class crosapi::LacrosThreadTypeDelegate;
    friend class crypto::ScopedAllowBlockingForNSS;  // http://crbug.com/59847
    friend class drive::FakeDriveService;

+ 2 - 2
patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch

@@ -14,10 +14,10 @@ This change patches it out to prevent the DCHECK.
 It can be removed once/if we see a better solution to the problem.
 
 diff --git a/content/browser/site_instance_impl.cc b/content/browser/site_instance_impl.cc
-index c204a15da17d7ca717bc130c29a70c696b7299be..a06dcd028a39c85bf0f3649396155063dcc90e83 100644
+index d1b5f3c4af7b28260e91e2be741da2e5e727c2ca..7caa42d0155a42f2bf768d70900ea57e66ba49e4 100644
 --- a/content/browser/site_instance_impl.cc
 +++ b/content/browser/site_instance_impl.cc
-@@ -209,7 +209,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
+@@ -215,7 +215,7 @@ scoped_refptr<SiteInstanceImpl> SiteInstanceImpl::CreateForGuest(
      BrowserContext* browser_context,
      const StoragePartitionConfig& partition_config) {
    DCHECK(browser_context);

+ 3 - 3
patches/chromium/chore_patch_out_profile_methods_in_profile_selections_cc.patch

@@ -8,10 +8,10 @@ is therefore not a method that will compile given we don't include
 relevant files.
 
 diff --git a/chrome/browser/profiles/profile_selections.cc b/chrome/browser/profiles/profile_selections.cc
-index 35c60a617a3d092b4ffbcc8652b7a80cc0d1f958..cd71486d98d5ade773f1d99bcec2215ac76e9c1d 100644
+index e98875bb5e214d36c0290c33377bc516e5f61947..8ebf54a6f9ce7b3e79cbbd591f2249ca6b9a6a14 100644
 --- a/chrome/browser/profiles/profile_selections.cc
 +++ b/chrome/browser/profiles/profile_selections.cc
-@@ -23,6 +23,7 @@ BASE_FEATURE(kGuestProfileSelectionDefaultNone,
+@@ -18,6 +18,7 @@ BASE_FEATURE(kSystemProfileSelectionDefaultNone,
               base::FeatureState::FEATURE_DISABLED_BY_DEFAULT);
  
  bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
@@ -19,7 +19,7 @@ index 35c60a617a3d092b4ffbcc8652b7a80cc0d1f958..cd71486d98d5ade773f1d99bcec2215a
    if (profile && profile->IsSystemProfile()) {
      // The default behavior of the system profile selection depends on the value
      // of `kSystemProfileSelectionDefaultNone` feature flag.
-@@ -33,7 +34,7 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
+@@ -28,7 +29,7 @@ bool AreKeyedServicesDisabledForProfileByDefault(const Profile* profile) {
  
      return system_profile_default == ProfileSelection::kNone;
    }

+ 24 - 24
patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch

@@ -80,10 +80,10 @@ index aaaa61d5c3a1d5ade2fd355e38a3985ef5cc4e7d..b45746ba0f38a381a2ee5ca17f3a1685
    }
  
 diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
-index 08ac5f0afd874913929e6ea9c79b38c6b28789ce..efe0f782e7747825a836a590400b65106f557c43 100644
+index f1e679d2db0f0f0b70c9be8d60d1351f48d44ad5..ebffc4b40e994d170380876130ec9182cf123fb3 100644
 --- a/chrome/browser/ui/browser.cc
 +++ b/chrome/browser/ui/browser.cc
-@@ -1840,12 +1840,11 @@ bool Browser::IsWebContentsCreationOverridden(
+@@ -1837,12 +1837,11 @@ bool Browser::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -99,10 +99,10 @@ index 08ac5f0afd874913929e6ea9c79b38c6b28789ce..efe0f782e7747825a836a590400b6510
  
  WebContents* Browser::CreateCustomWebContents(
 diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
-index 08879ac2f134a338200f841cea1dea3323b6696f..136f86297dc03610e725526a70d0aaa1c45d81d0 100644
+index 83b8260beb59da437ae08a5b62746c40603a1200..3ea5f7c42ef350cc094355154c52220e68e6ceb5 100644
 --- a/chrome/browser/ui/browser.h
 +++ b/chrome/browser/ui/browser.h
-@@ -853,8 +853,7 @@ class Browser : public TabStripModelObserver,
+@@ -862,8 +862,7 @@ class Browser : public TabStripModelObserver,
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -218,10 +218,10 @@ index 4e32d708ecf4afd3913d86ec1602ef2dc9a60998..1dd2f50fba1387b5eeb554dd540957d7
    void AddNewContents(content::WebContents* source,
                        std::unique_ptr<content::WebContents> new_contents,
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 465dcd8c19fff3f435ed1286a9932a484b7d7d4e..6fbf7fc57e7188d4fc323e0276a85a58c3d9cbc4 100644
+index 71b2238a1f2302bf3ec3fb648b98843a01c6dc0c..c4ac501e42f753f715d0ea890976ad7e9766d39e 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -4027,8 +4027,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -4050,8 +4050,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
  
    if (delegate_ && delegate_->IsWebContentsCreationOverridden(
                         source_site_instance, params.window_container_type,
@@ -232,12 +232,12 @@ index 465dcd8c19fff3f435ed1286a9932a484b7d7d4e..6fbf7fc57e7188d4fc323e0276a85a58
          static_cast<WebContentsImpl*>(delegate_->CreateCustomWebContents(
              opener, source_site_instance, is_new_browsing_instance,
 diff --git a/content/public/browser/web_contents_delegate.cc b/content/public/browser/web_contents_delegate.cc
-index 6f6a5eee43f3f5ecc89f907b825451d1bb833836..457cf0f6a5c254afca6148038b951391ca32addf 100644
+index 5b53ee691c0a07ed1655139ca2d90341b5fa55a3..684b2f9c1f20a2dd460491d9d4285756907a8aa4 100644
 --- a/content/public/browser/web_contents_delegate.cc
 +++ b/content/public/browser/web_contents_delegate.cc
-@@ -135,8 +135,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
+@@ -136,8 +136,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
      SiteInstance* source_site_instance,
-     content::mojom::WindowContainerType window_container_type,
+     mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
 -    const std::string& frame_name,
 -    const GURL& target_url) {
@@ -246,12 +246,12 @@ index 6f6a5eee43f3f5ecc89f907b825451d1bb833836..457cf0f6a5c254afca6148038b951391
  }
  
 diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
-index fae93468160463c098b5b115ef293989bbc1f38c..3d6bcc0c6a21f318b76607c6fa25a3aafc975e60 100644
+index 76d699790fb7d92587293b14332f696dc5460322..2b15ee95474fab528fd710b52d3a1d9e6a60b871 100644
 --- a/content/public/browser/web_contents_delegate.h
 +++ b/content/public/browser/web_contents_delegate.h
-@@ -321,8 +321,7 @@ class CONTENT_EXPORT WebContentsDelegate {
+@@ -322,8 +322,7 @@ class CONTENT_EXPORT WebContentsDelegate {
        SiteInstance* source_site_instance,
-       content::mojom::WindowContainerType window_container_type,
+       mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
 -      const std::string& frame_name,
 -      const GURL& target_url);
@@ -260,10 +260,10 @@ index fae93468160463c098b5b115ef293989bbc1f38c..3d6bcc0c6a21f318b76607c6fa25a3aa
    // Allow delegate to creates a custom WebContents when
    // WebContents::CreateNewWindow() is called. This function is only called
 diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.cc b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
-index 2d6b5c054087593cff571daf1dcb5a10bdc6f157..fa255c126064a4072ede486d59e6dc00f63777cb 100644
+index 5579bd54453d9dd2c15b949dee9f6ddf3e5ec67b..459c15913c91b9a77c8ffaa30445dff7a0d9751b 100644
 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc
 +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
-@@ -207,8 +207,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
+@@ -206,8 +206,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -288,10 +288,10 @@ index 675780388e55aaabcb099f795e7e388f7105e56c..fd876690186533cde2fde6a08a5a8916
        content::RenderFrameHost* opener,
        content::SiteInstance* source_site_instance,
 diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
-index ec5521a6e20051b1b66bc41ccee79b9aa43de4d0..7d89a6c8f13feb533964eb26a390902813a48bbc 100644
+index 44d0b99677a74cd57c5f2d0462b0983812726083..72d66188452b8b5cb56b08475c6d94d84ea5c4c1 100644
 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
 +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.cc
-@@ -400,8 +400,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
+@@ -404,8 +404,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -302,10 +302,10 @@ index ec5521a6e20051b1b66bc41ccee79b9aa43de4d0..7d89a6c8f13feb533964eb26a3909028
  }
  
 diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
-index 810289b11cba74feec6ee3f61f02562980050d06..db1f6baccb883cc35f35bf7c111483c2ecec776d 100644
+index 2ade4d0b28ba4c7179886c740952e963f828888e..b5e70e7e52df862a64baa8e3ca7e59020ac35871 100644
 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
 +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h
-@@ -172,8 +172,7 @@ class MimeHandlerViewGuest
+@@ -175,8 +175,7 @@ class MimeHandlerViewGuest
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -316,10 +316,10 @@ index 810289b11cba74feec6ee3f61f02562980050d06..db1f6baccb883cc35f35bf7c111483c2
        content::RenderFrameHost* opener,
        content::SiteInstance* source_site_instance,
 diff --git a/fuchsia_web/webengine/browser/frame_impl.cc b/fuchsia_web/webengine/browser/frame_impl.cc
-index c3af8403a996bac2742c6502dbe8e13e0809b0c0..fbea9891e2a5e533c3eb9d98ff16c3cc03396cc4 100644
+index 87348466587ed5f21cd3d89da13f5c8599fbeb2f..116199ab85aa8ccd2717a689b5ce9f3038253091 100644
 --- a/fuchsia_web/webengine/browser/frame_impl.cc
 +++ b/fuchsia_web/webengine/browser/frame_impl.cc
-@@ -567,8 +567,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
+@@ -565,8 +565,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -330,10 +330,10 @@ index c3af8403a996bac2742c6502dbe8e13e0809b0c0..fbea9891e2a5e533c3eb9d98ff16c3cc
    // can catch bad client behavior while not interfering with normal operation.
    constexpr size_t kMaxPendingWebContentsCount = 10;
 diff --git a/fuchsia_web/webengine/browser/frame_impl.h b/fuchsia_web/webengine/browser/frame_impl.h
-index 69e45b758a48fd2a117715869861d70294b334b3..5e36410b91e92b399a7179e14dd18fca16d17268 100644
+index 0ba76ffa875efe29e576310cfb210e4e86cc3478..e565a89da74fe1b455a03ede05cb302ae81d6e21 100644
 --- a/fuchsia_web/webengine/browser/frame_impl.h
 +++ b/fuchsia_web/webengine/browser/frame_impl.h
-@@ -300,8 +300,7 @@ class WEB_ENGINE_EXPORT FrameImpl : public fuchsia::web::Frame,
+@@ -305,8 +305,7 @@ class WEB_ENGINE_EXPORT FrameImpl : public fuchsia::web::Frame,
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -358,10 +358,10 @@ index 2bb690e05876c497abd1ad7d2c600b78532df1e6..c595d97a478a7475c8a56f322112006a
          ->options()
          ->block_new_web_contents();
 diff --git a/ui/views/controls/webview/web_dialog_view.cc b/ui/views/controls/webview/web_dialog_view.cc
-index a4e4703e5c2a3e668806e61ca5437a6a571e73d2..f1198ac26f34c68efd70e77453b0705c7c73376a 100644
+index af075e83021d4362b3ab75ee13f057d52afc5435..9291f978fca54fe600d3058ed3886ef412ea0889 100644
 --- a/ui/views/controls/webview/web_dialog_view.cc
 +++ b/ui/views/controls/webview/web_dialog_view.cc
-@@ -427,8 +427,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
+@@ -426,8 +426,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,

+ 0 - 37
patches/chromium/chrome_key_systems.patch

@@ -1,37 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: deepak1556 <[email protected]>
-Date: Thu, 20 Sep 2018 17:50:13 -0700
-Subject: chrome_key_systems.patch
-
-Disable persiste licence support check for widevine cdm,
-as its not supported in the current version of chrome.
-
-diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc
-index 56533ee562300302d27e3bde27148d36612f2f65..dcb9816d632dd3198377de3f87252fda5bc90133 100644
---- a/chrome/renderer/media/chrome_key_systems.cc
-+++ b/chrome/renderer/media/chrome_key_systems.cc
-@@ -17,7 +17,9 @@
- #include "base/strings/utf_string_conversions.h"
- #include "build/build_config.h"
- #include "build/chromeos_buildflags.h"
-+#if 0
- #include "chrome/renderer/chrome_render_thread_observer.h"
-+#endif
- #include "components/cdm/renderer/external_clear_key_key_system_info.h"
- #include "components/cdm/renderer/widevine_key_system_info.h"
- #include "content/public/renderer/render_thread.h"
-@@ -238,12 +240,14 @@ SupportedCodecs GetSupportedCodecs(const media::CdmCapability& capability,
- 
- // Returns whether persistent-license session can be supported.
- bool CanSupportPersistentLicense() {
-+#if 0
-   // Do not support persistent-license if the process cannot persist data.
-   // TODO(crbug.com/457487): Have a better plan on this. See bug for details.
-   if (ChromeRenderThreadObserver::is_incognito_process()) {
-     DVLOG(2) << __func__ << ": Not supported in incognito process.";
-     return false;
-   }
-+#endif
- 
- // On ChromeOS, platform verification is similar to CDM host verification.
- #if BUILDFLAG(ENABLE_CDM_HOST_VERIFICATION) || BUILDFLAG(IS_CHROMEOS)

+ 7 - 7
patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch

@@ -7,7 +7,7 @@ By default, chromium sets up one v8 snapshot to be used in all v8 contexts. This
 to have a dedicated browser process v8 snapshot defined by the file `browser_v8_context_snapshot.bin`.
 
 diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
-index c2ef1da09511b9314298b4e55a23bd521ba17969..d95b992daae050ea601da86008823bbd41df9b6d 100644
+index 6a72d0a8f731b5dbc4468ba302bb76a18b4dff92..3550cd5711b98283ed87aa8399b7f38560ee0052 100644
 --- a/content/app/content_main_runner_impl.cc
 +++ b/content/app/content_main_runner_impl.cc
 @@ -39,6 +39,7 @@
@@ -18,7 +18,7 @@ index c2ef1da09511b9314298b4e55a23bd521ba17969..d95b992daae050ea601da86008823bbd
  #include "base/strings/string_number_conversions.h"
  #include "base/strings/string_util.h"
  #include "base/task/single_thread_task_runner.h"
-@@ -251,8 +252,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
+@@ -253,8 +254,13 @@ std::string GetSnapshotDataDescriptor(const base::CommandLine& command_line) {
  
  #endif
  
@@ -33,7 +33,7 @@ index c2ef1da09511b9314298b4e55a23bd521ba17969..d95b992daae050ea601da86008823bbd
  #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
    base::FileDescriptorStore& file_descriptor_store =
        base::FileDescriptorStore::GetInstance();
-@@ -281,11 +287,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
+@@ -283,11 +289,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
  
  #endif  // V8_USE_EXTERNAL_STARTUP_DATA
  
@@ -48,7 +48,7 @@ index c2ef1da09511b9314298b4e55a23bd521ba17969..d95b992daae050ea601da86008823bbd
  #endif  // V8_USE_EXTERNAL_STARTUP_DATA
  }
  
-@@ -965,7 +972,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
+@@ -962,7 +969,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
      return TerminateForFatalInitializationError();
  #endif  // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
  
@@ -102,10 +102,10 @@ index d4bb0e9a017a833b403916e1d6e64fb058f40f86..35ba35a95e39700824d6e0b480b99bc3
    friend class ContentClientCreator;
    friend class ContentClientInitializer;
 diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
-index 3fd76d7051ccc5f7e6f45c5be17fca4b22463b24..1d197cb685d14fb440c0136a6b4fff7336e9e946 100644
+index d8c8fa7b1862aa46e9384c898244cc1da2bfdcac..b751c9dd9d4b04ea2ebb1b813577169877a513e6 100644
 --- a/gin/v8_initializer.cc
 +++ b/gin/v8_initializer.cc
-@@ -494,8 +494,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
+@@ -497,8 +497,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,
  
  #if defined(V8_USE_EXTERNAL_STARTUP_DATA)
  
@@ -115,7 +115,7 @@ index 3fd76d7051ccc5f7e6f45c5be17fca4b22463b24..1d197cb685d14fb440c0136a6b4fff73
    if (g_mapped_snapshot) {
      // TODO(crbug.com/802962): Confirm not loading different type of snapshot
      // files in a process.
-@@ -504,10 +503,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
+@@ -507,10 +506,17 @@ void V8Initializer::LoadV8Snapshot(V8SnapshotFileType snapshot_file_type) {
  
    base::MemoryMappedFile::Region file_region;
    base::File file =

+ 4 - 4
patches/chromium/custom_protocols_plzserviceworker.patch

@@ -8,10 +8,10 @@ Allow registering custom protocols to handle service worker main script fetching
 Refs https://bugs.chromium.org/p/chromium/issues/detail?id=996511
 
 diff --git a/content/browser/service_worker/service_worker_context_wrapper.cc b/content/browser/service_worker/service_worker_context_wrapper.cc
-index 88a5ecbb040e74822be75585f8f0265825e63a3c..faac202dec6ba0b482ee4e3869a22fc6da7e852b 100644
+index b8a47c0a91a23c7cbd65595f857caed4f8404102..564785198facec512e0a241c8d1948f218c84279 100644
 --- a/content/browser/service_worker/service_worker_context_wrapper.cc
 +++ b/content/browser/service_worker/service_worker_context_wrapper.cc
-@@ -1724,6 +1724,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
+@@ -1727,6 +1727,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
        loader_factory_bundle_info =
            context()->loader_factory_bundle_for_update_check()->Clone();
  
@@ -38,7 +38,7 @@ index 88a5ecbb040e74822be75585f8f0265825e63a3c..faac202dec6ba0b482ee4e3869a22fc6
    if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig(
            browser_context(), scope_origin)) {
      // If this is a Service Worker for a WebUI, the WebUI's URLDataSource
-@@ -1743,9 +1763,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
+@@ -1746,9 +1766,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
              features::kEnableServiceWorkersForChromeScheme) &&
          scope.scheme_piece() == kChromeUIScheme) {
        config->RegisterURLDataSource(browser_context());
@@ -49,7 +49,7 @@ index 88a5ecbb040e74822be75585f8f0265825e63a3c..faac202dec6ba0b482ee4e3869a22fc6
            .emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory(
                                          browser_context(), kChromeUIScheme,
                                          base::flat_set<std::string>()));
-@@ -1753,9 +1771,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
+@@ -1756,9 +1774,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
                     features::kEnableServiceWorkersForChromeUntrusted) &&
                 scope.scheme_piece() == kChromeUIUntrustedScheme) {
        config->RegisterURLDataSource(browser_context());

+ 2 - 2
patches/chromium/dcheck.patch

@@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
 failing checks and allow the rest of the target to have them enabled.
 
 diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
-index 2114f75a3172c70b70625ecc97e1135e9f58b699..12d289efee5920dcd9f54a7f8b9586b107daf7d5 100644
+index 76346ed43ed6afb9ed454103ad1deebbbef9f45d..00a147a1f3a8f19092c1bc0562025850bc720657 100644
 --- a/ui/base/clipboard/clipboard_win.cc
 +++ b/ui/base/clipboard/clipboard_win.cc
-@@ -891,10 +891,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
+@@ -912,10 +912,10 @@ SkBitmap ClipboardWin::ReadBitmapInternal(ClipboardBuffer buffer) const {
  
  void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
    UINT cf_format = format.ToFormatEtc().cfFormat;

+ 4 - 4
patches/chromium/desktop_media_list.patch

@@ -82,10 +82,10 @@ index 33ca7a53dfb6d2c9e3a33f0065a3acd806e82e01..9fdf2e8ff0056ff407015b914c6b03eb
    const Source& GetSource(int index) const override;
    DesktopMediaList::Type GetMediaListType() const override;
 diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc
-index 97d1618356d2c42eda3e24ab0038c961d220194f..60aa0f41fbe1115d8367b024cacdfb71be26aff0 100644
+index b548c9fbd3c0bf425447b29dcd866cd27e96b14c..f994ac6086c7b4cd3e8534f34691189d78a21601 100644
 --- a/chrome/browser/media/webrtc/native_desktop_media_list.cc
 +++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc
-@@ -141,7 +141,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
+@@ -147,7 +147,7 @@ BOOL CALLBACK AllHwndCollector(HWND hwnd, LPARAM param) {
  #if BUILDFLAG(IS_MAC)
  BASE_FEATURE(kWindowCaptureMacV2,
               "WindowCaptureMacV2",
@@ -94,7 +94,7 @@ index 97d1618356d2c42eda3e24ab0038c961d220194f..60aa0f41fbe1115d8367b024cacdfb71
  #endif
  
  }  // namespace
-@@ -451,6 +451,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
+@@ -457,6 +457,9 @@ void NativeDesktopMediaList::Worker::RefreshNextThumbnail() {
        FROM_HERE,
        base::BindOnce(&NativeDesktopMediaList::UpdateNativeThumbnailsFinished,
                       media_list_));
@@ -104,7 +104,7 @@ index 97d1618356d2c42eda3e24ab0038c961d220194f..60aa0f41fbe1115d8367b024cacdfb71
  }
  
  void NativeDesktopMediaList::Worker::OnCaptureResult(
-@@ -823,6 +826,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
+@@ -829,6 +832,11 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows(
          FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails,
                                    base::Unretained(worker_.get()),
                                    std::move(native_ids), thumbnail_size_));

+ 15 - 15
patches/chromium/disable_color_correct_rendering.patch

@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
 https://crbug.com/634542 and https://crbug.com/711107.
 
 diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
-index 940f15cab30983c3f05ef886d3b055bcc35159f2..4ddc504b02b8d0abcefd6e3e7871875df9b0fd81 100644
+index 89f3522136226ee007a7d142bac48ac3f3132718..a8e86133abeba844332b37873385a331ea97b8ae 100644
 --- a/cc/trees/layer_tree_host_impl.cc
 +++ b/cc/trees/layer_tree_host_impl.cc
-@@ -1880,6 +1880,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
+@@ -1888,6 +1888,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
  TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
      gfx::ContentColorUsage content_color_usage) const {
    TargetColorParams params;
@@ -35,7 +35,7 @@ index 940f15cab30983c3f05ef886d3b055bcc35159f2..4ddc504b02b8d0abcefd6e3e7871875d
    // If we are likely to software composite the resource, we use sRGB because
    // software compositing is unable to perform color conversion.
 diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
-index 012e0f781d21b96890b88e0bc2cb2d46cb1e3829..e74783c3f8003d87fbb343087a83da3cb2b06ab3 100644
+index 29cd1a8a5db8ad7533458e4ed3f7a08479747b3c..db87c255789f9194b6f0d5d2d9c7e33658e8dcc1 100644
 --- a/cc/trees/layer_tree_settings.h
 +++ b/cc/trees/layer_tree_settings.h
 @@ -96,6 +96,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -81,10 +81,10 @@ index c7ca2458708dd9577afdaef7fbcafaaa68046904..c4a1f1368ef053830c86cf86c3bec7ce
        !command_line->HasSwitch(switches::kUIDisablePartialSwap);
  
 diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
-index 9f1efcdd0ef27c528c4aec954ab9ca74085a6e74..f86f288f32404ce75d4f177c7bfd1253c7b1ee3f 100644
+index 98e21ef6e75cb86e3408514fb42124949e611b64..a699285a41537932b5c1182cafc1024b8284bb4a 100644
 --- a/content/browser/gpu/gpu_process_host.cc
 +++ b/content/browser/gpu/gpu_process_host.cc
-@@ -224,6 +224,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
+@@ -226,6 +226,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
  
  // Command-line switches to propagate to the GPU process.
  static const char* const kSwitchNames[] = {
@@ -93,10 +93,10 @@ index 9f1efcdd0ef27c528c4aec954ab9ca74085a6e74..f86f288f32404ce75d4f177c7bfd1253
      sandbox::policy::switches::kGpuSandboxAllowSysVShm,
      sandbox::policy::switches::kGpuSandboxFailuresFatal,
 diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index 31678701d6ee0aefdb86c046178abdf11277de3d..7632aeeba116e08c9d2c7fdfb684334c7fa0ba76 100644
+index 43987c78c7d1248f429c6bed4336e0db2e151c2c..bf9595d303fc91a855e125036ee7f0f53afd4cbb 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -3309,6 +3309,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
+@@ -3317,6 +3317,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
    // Propagate the following switches to the renderer command line (along
    // with any associated values) if present in the browser command line.
    static const char* const kSwitchNames[] = {
@@ -148,7 +148,7 @@ index 318005b66e04ed03ce6d44931d9360c0e009cb94..0d622fddb95720141ccf8a285ace4714
  }
  
 diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
-index 284cc1a6369e8fecce41f94643b77be7abbf25b0..d331a4bbe7fec9a870e84b7ed96048e2d0ab6b90 100644
+index 77624a8b54b6e05da79bd913aa3d25187118090c..0057d51aebaf7530cc91e87fc826dd70c49c1df4 100644
 --- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
 +++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
 @@ -25,6 +25,7 @@
@@ -159,7 +159,7 @@ index 284cc1a6369e8fecce41f94643b77be7abbf25b0..d331a4bbe7fec9a870e84b7ed96048e2
  #include "ui/native_theme/native_theme_features.h"
  #include "ui/native_theme/overlay_scrollbar_constants_aura.h"
  
-@@ -217,6 +218,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
+@@ -214,6 +215,9 @@ cc::LayerTreeSettings GenerateLayerTreeSettings(
    settings.main_frame_before_activation_enabled =
        cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation);
  
@@ -170,7 +170,7 @@ index 284cc1a6369e8fecce41f94643b77be7abbf25b0..d331a4bbe7fec9a870e84b7ed96048e2
    // is what the renderer uses if its not threaded.
    settings.enable_checker_imaging =
 diff --git a/ui/gfx/mac/io_surface.cc b/ui/gfx/mac/io_surface.cc
-index c119ef410f437b27ae4d0ff76627af55a2679171..997558e36dc1aec86005d05a824336910468ba73 100644
+index 95d74c90b324760a0fafcf92fe3f40071ffa0187..cb138579bdb5b552a198d47fde220d8148e67d12 100644
 --- a/ui/gfx/mac/io_surface.cc
 +++ b/ui/gfx/mac/io_surface.cc
 @@ -20,6 +20,7 @@
@@ -181,7 +181,7 @@ index c119ef410f437b27ae4d0ff76627af55a2679171..997558e36dc1aec86005d05a82433691
  
  namespace gfx {
  
-@@ -150,6 +151,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
+@@ -152,6 +153,14 @@ void IOSurfaceMachPortTraits::Release(mach_port_t port) {
  // Common method used by IOSurfaceSetColorSpace and IOSurfaceCanSetColorSpace.
  bool IOSurfaceSetColorSpace(IOSurfaceRef io_surface,
                              const ColorSpace& color_space) {
@@ -196,7 +196,7 @@ index c119ef410f437b27ae4d0ff76627af55a2679171..997558e36dc1aec86005d05a82433691
    // Allow but ignore invalid color spaces.
    if (!color_space.IsValid())
      return true;
-@@ -320,6 +329,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
+@@ -322,6 +331,15 @@ IOSurfaceRef CreateIOSurface(const gfx::Size& size,
      DCHECK_EQ(kIOReturnSuccess, r);
    }
  
@@ -213,7 +213,7 @@ index c119ef410f437b27ae4d0ff76627af55a2679171..997558e36dc1aec86005d05a82433691
    IOSurfaceSetValue(surface, CFSTR("IOSurfaceColorSpace"), kCGColorSpaceSRGB);
  
 diff --git a/ui/gfx/switches.cc b/ui/gfx/switches.cc
-index 52d44ad6b3e7c602711d304e07ce32138c99b4e0..e25476c76ad2d0aae66ee5a157548078b9f90ebd 100644
+index cbdfb60d42cb16848847eba67937b95b3504bedf..16c8ff102070ce75c518f8d444cae1e51580d0b4 100644
 --- a/ui/gfx/switches.cc
 +++ b/ui/gfx/switches.cc
 @@ -13,6 +13,8 @@ namespace switches {
@@ -226,10 +226,10 @@ index 52d44ad6b3e7c602711d304e07ce32138c99b4e0..e25476c76ad2d0aae66ee5a157548078
  // sharpness, kerning, hinting and layout.
  const char kDisableFontSubpixelPositioning[] =
 diff --git a/ui/gfx/switches.h b/ui/gfx/switches.h
-index 166ac12df74510fd72d619251d4e7e455af075da..299a68885b5a5a4e6a684f12c96e61a1b34af273 100644
+index df3520997950911ab8dcd81f654016b2f726ce7d..ac38f23312eef89fb9e2614744c7226fc7091bad 100644
 --- a/ui/gfx/switches.h
 +++ b/ui/gfx/switches.h
-@@ -12,6 +12,7 @@
+@@ -13,6 +13,7 @@
  namespace switches {
  
  GFX_SWITCHES_EXPORT extern const char kAnimationDurationScale[];

+ 2 - 2
patches/chromium/disable_compositor_recycling.patch

@@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling
 Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron.
 
 diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
-index a557cc2b06e68e54817f154f2d1e6a7635958d0e..386bd7e06917a69b7fdcc26056aeccc5ad967b7b 100644
+index 66c8dda8af5605fb270011bd58c7bed59fe71fcf..383c6dcfe93753f6b84c18b6db2fd4c6fe453b23 100644
 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
 +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
-@@ -531,7 +531,11 @@
+@@ -527,7 +527,11 @@
      return;
  
    host()->WasHidden();

+ 4 - 4
patches/chromium/disable_freezing_flags_after_init_in_node.patch

@@ -15,12 +15,12 @@ at some point be an API to "unfreeze" the flags, or we may be able to refactor
 node initialization to not update flags after V8 initialization.
 
 diff --git a/content/renderer/render_process_impl.cc b/content/renderer/render_process_impl.cc
-index af6e5cee1b9e79821a3cf064b6336dbc96d2895b..58b6d3daca0eb85b63c3680742afa43e4af1f47b 100644
+index 94016c74d962d7e5459ff5457f276e6742146280..0ca99a62d1289f9eff38291bd7af23cefd9cf77d 100644
 --- a/content/renderer/render_process_impl.cc
 +++ b/content/renderer/render_process_impl.cc
-@@ -223,6 +223,9 @@ RenderProcessImpl::RenderProcessImpl()
-   SetV8FlagIfNotFeature(features::kWebAssemblyDynamicTiering,
-                         "--no-wasm-dynamic-tiering");
+@@ -231,6 +231,9 @@ RenderProcessImpl::RenderProcessImpl()
+     v8::V8::SetFlagsFromString(kSABPerContextFlag, sizeof(kSABPerContextFlag));
+   }
  
 +  // Freezing flags after init conflicts with node in the renderer.
 +  v8::V8::SetFlagsFromString("--no-freeze-flags-after-init");

+ 3 - 3
patches/chromium/disable_hidden.patch

@@ -6,7 +6,7 @@ Subject: disable_hidden.patch
 Electron uses this to disable background throttling for hidden windows.
 
 diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
-index a689c6e60b5d55c1dd2f09c40da9c8a60786b90f..f49cf68e4b5be592000b193a3b1fae18e0bd41dc 100644
+index 6dab72c3c7471fe567a39e988a75b6b97a4da702..d164a86023ceb2718dfefce23d0a9fc910150f0e 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
 @@ -800,6 +800,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -20,7 +20,7 @@ index a689c6e60b5d55c1dd2f09c40da9c8a60786b90f..f49cf68e4b5be592000b193a3b1fae18
        blink::mojom::PointerLockResult::kWrongDocument);
  
 diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
-index 3910d3a1642abc19d01556b275582170ecc520ce..60224d202aa14bd83d5eb2a52b13e37282d621dc 100644
+index f4775ddc34202803b3b015dc565bdcf5d0f5d8e0..e33c5b8ea948523a91fee51f03651e1033e73407 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.h
 +++ b/content/browser/renderer_host/render_widget_host_impl.h
 @@ -896,6 +896,8 @@ class CONTENT_EXPORT RenderWidgetHostImpl
@@ -33,7 +33,7 @@ index 3910d3a1642abc19d01556b275582170ecc520ce..60224d202aa14bd83d5eb2a52b13e372
   protected:
    // |routing_id| must not be MSG_ROUTING_NONE.
 diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc
-index 65daab40548600bff98bdd1273b7325611f6b82f..f09d6289319c5dbaff6002af60cfd53c1a6cc5cc 100644
+index 7098e7e553bcd73ed5cebd8cf46efc4261ceb5a0..4e96b2b03835ce147d841c5358b77e1135927cb0 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
 @@ -605,7 +605,7 @@ void RenderWidgetHostViewAura::HideImpl() {

+ 3 - 3
patches/chromium/disable_unload_metrics.patch

@@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we
 should continue seeking for a real fix.
 
 diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc
-index f4b46f5f002366d9aaee6b851c8d0643ce8e556b..fb5344a6f91fb71d7b6ea483f25a1fac5729ba29 100644
+index 9f15b20a3871eed69f2d45d94298214b4ede3933..07514d08bc558ca49e6e93b8dc85cd4aa0775488 100644
 --- a/content/browser/renderer_host/navigator.cc
 +++ b/content/browser/renderer_host/navigator.cc
-@@ -1265,6 +1265,7 @@ void Navigator::RecordNavigationMetrics(
+@@ -1244,6 +1244,7 @@ void Navigator::RecordNavigationMetrics(
              .InMilliseconds());
    }
  
@@ -35,7 +35,7 @@ index f4b46f5f002366d9aaee6b851c8d0643ce8e556b..fb5344a6f91fb71d7b6ea483f25a1fac
    // If this is a same-process navigation and we have timestamps for unload
    // durations, fill those metrics out as well.
    if (params.unload_start && params.unload_end &&
-@@ -1314,6 +1315,7 @@ void Navigator::RecordNavigationMetrics(
+@@ -1293,6 +1294,7 @@ void Navigator::RecordNavigationMetrics(
           first_before_unload_start_time)
              .InMilliseconds());
    }

+ 3 - 3
patches/chromium/enable_reset_aspect_ratio.patch

@@ -6,7 +6,7 @@ Subject: feat: enable setting aspect ratio to 0
 Make SetAspectRatio accept 0 as valid input, which would reset to null.
 
 diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
-index 0be1688818063dac2242428393babcca1d03e836..e534b895eca4e28e003ef35de4a2fb5b32baf88b 100644
+index d52fc15106eb3a834f1008846df6cb954db17250..b2e8e4127d73d1c8f0f3698fe9c7f37a03868c06 100644
 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
 +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc
 @@ -564,7 +564,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
@@ -19,10 +19,10 @@ index 0be1688818063dac2242428393babcca1d03e836..e534b895eca4e28e003ef35de4a2fb5b
                                     aspect_ratio.height());
  }
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 22bb24f2afcefc3d875fe6959a7926cf2eaf7d6f..0a546b2649b37ad2a8de2783079d0fe93a24d7ac 100644
+index 5de1045439dca219331968dcac3c721907e20c35..8edbbbea1afcae8a32d18d23afa706224bf58b14 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -1009,8 +1009,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
+@@ -1123,8 +1123,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
  }
  
  void HWNDMessageHandler::SetAspectRatio(float aspect_ratio) {

+ 4 - 4
patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch

@@ -9,10 +9,10 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead
 of the default V8 allocator.  This probably can't be usptreamed.
 
 diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h
-index c4f2df96133012faebec25ac3a738c34cd6b4cf8..54bc2625686b9344c2c793c74589ed85de8227ba 100644
+index 9c3575725576cddf90e5681a52342f6b8d345bd1..f89ff175d2adf88c16167e8f306c9d3451afe94f 100644
 --- a/gin/public/v8_platform.h
 +++ b/gin/public/v8_platform.h
-@@ -30,6 +30,7 @@ class GIN_EXPORT V8Platform : public v8::Platform {
+@@ -31,6 +31,7 @@ class GIN_EXPORT V8Platform : public v8::Platform {
    // enabling Arm's Branch Target Instructions for executable pages. This is
    // verified in the tests for gin::PageAllocator.
    PageAllocator* GetPageAllocator() override;
@@ -21,10 +21,10 @@ index c4f2df96133012faebec25ac3a738c34cd6b4cf8..54bc2625686b9344c2c793c74589ed85
    v8::ZoneBackingAllocator* GetZoneBackingAllocator() override;
  #endif
 diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
-index bbb16efbf5208989fa88c7f6d83d36aa5e54a0d1..ef562c9a9abed85198282728287637d178a0af0f 100644
+index 2cf6d986102904e3aa44b3333938b3bfcbc87470..f40799e5ae37f96ec5f3c8ae2ee73776783b0e5f 100644
 --- a/gin/v8_platform.cc
 +++ b/gin/v8_platform.cc
-@@ -370,6 +370,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
+@@ -330,6 +330,10 @@ PageAllocator* V8Platform::GetPageAllocator() {
    return g_page_allocator.Pointer();
  }
  

+ 10 - 10
patches/chromium/expose_setuseragent_on_networkcontext.patch

@@ -33,10 +33,10 @@ index 0ab8187b0db8ae6db46d81738f653a2bc4c566f6..de3d55e85c22317f7f9375eb94d0d5d4
  
  }  // namespace net
 diff --git a/services/network/network_context.cc b/services/network/network_context.cc
-index 74b881ef99b32d085f58fc7b30cd42005855dcbc..ab34e6ad6736a5b4c154750d95eef622f2051f0d 100644
+index 1e6769d9091d0c0c17869730c754aec116dd372c..68044a4d9d271ce3930c0247533e8533059d2fe6 100644
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
-@@ -1387,6 +1387,13 @@ void NetworkContext::SetNetworkConditions(
+@@ -1410,6 +1410,13 @@ void NetworkContext::SetNetworkConditions(
                                        std::move(network_conditions));
  }
  
@@ -51,22 +51,22 @@ index 74b881ef99b32d085f58fc7b30cd42005855dcbc..ab34e6ad6736a5b4c154750d95eef622
    // This may only be called on NetworkContexts created with the constructor
    // that calls MakeURLRequestContext().
 diff --git a/services/network/network_context.h b/services/network/network_context.h
-index 98c33a3048f1a10e8293c51213a99089ca55456b..92cf6606e0cef6e640accbacfdacd9cb9f1aeef1 100644
+index 4e74b29c4063da63cb2b8b46ec0879d3a5a3f76d..9822ecde4ddd8209b4d1f129eb26a0b7a17d43ba 100644
 --- a/services/network/network_context.h
 +++ b/services/network/network_context.h
-@@ -302,6 +302,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -309,6 +309,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
    void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
                              mojom::NetworkConditionsPtr conditions) override;
 +  void SetUserAgent(const std::string& new_user_agent) override;
    void SetAcceptLanguage(const std::string& new_accept_language) override;
    void SetEnableReferrers(bool enable_referrers) override;
-   void SetEnablePreconnect(bool enable_preconnect) override;
+ #if BUILDFLAG(IS_CHROMEOS)
 diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
-index a9e7ccf5676cf72fddfd882d7582cc8f6f3162da..5b533f299ce753f5c40fbc432d6550f67fe994c0 100644
+index aabe94b0c6a5d131723217118469465b7cc808f1..e8586f71bae62339b43eea554d7e0306eb4c8da1 100644
 --- a/services/network/public/mojom/network_context.mojom
 +++ b/services/network/public/mojom/network_context.mojom
-@@ -1113,6 +1113,9 @@ interface NetworkContext {
+@@ -1099,6 +1099,9 @@ interface NetworkContext {
    SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
                         NetworkConditions? conditions);
  
@@ -77,14 +77,14 @@ index a9e7ccf5676cf72fddfd882d7582cc8f6f3162da..5b533f299ce753f5c40fbc432d6550f6
    SetAcceptLanguage(string new_accept_language);
  
 diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
-index 5415522f3b145519825082d31d4e4c95f8d5e848..842e8981d0f517196bd58f2a952d71f88991c56e 100644
+index 53e79f16daaa2c536d7a867b8fc11874c00a042b..1b12249c279f83c486485d0ce8bf42e67e224fa4 100644
 --- a/services/network/test/test_network_context.h
 +++ b/services/network/test/test_network_context.h
-@@ -137,6 +137,7 @@ class TestNetworkContext : public mojom::NetworkContext {
+@@ -139,6 +139,7 @@ class TestNetworkContext : public mojom::NetworkContext {
    void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
    void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
                              mojom::NetworkConditionsPtr conditions) override {}
 +  void SetUserAgent(const std::string& new_user_agent) override {}
    void SetAcceptLanguage(const std::string& new_accept_language) override {}
    void SetEnableReferrers(bool enable_referrers) override {}
-   void SetEnablePreconnect(bool enable_preconnect) override {}
+ #if BUILDFLAG(IS_CHROMEOS)

+ 2 - 2
patches/chromium/expose_v8initializer_codegenerationcheckcallbackinmainthread.patch

@@ -6,10 +6,10 @@ Subject: expose V8Initializer::CodeGenerationCheckCallbackInMainThread
 This is needed to blend Blink and Node's policy for code generation policy.
 
 diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
-index c9c33c560476e43e097f04d1b21154debc20667c..fcbccbb67b0d152a771e26aaae5beb85ffe83bc2 100644
+index 491fe7c8cda4899c37ad98da2b6daffc03944942..42ccef313e33f233342a8bd7bd5e4f0bc3847e85 100644
 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
 +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
-@@ -443,8 +443,9 @@ TrustedTypesCodeGenerationCheck(v8::Local<v8::Context> context,
+@@ -444,8 +444,9 @@ TrustedTypesCodeGenerationCheck(v8::Local<v8::Context> context,
    return {true, V8String(context->GetIsolate(), stringified_source)};
  }
  

+ 4 - 4
patches/chromium/extend_apply_webpreferences.patch

@@ -12,18 +12,18 @@ Ideally we could add an embedder observer pattern here but that can be
 done in future work.
 
 diff --git a/third_party/blink/renderer/core/exported/web_view_impl.cc b/third_party/blink/renderer/core/exported/web_view_impl.cc
-index 490a381e1afd0a175cd1ca12926a21278c051712..66dabaf4f57ede27416b7f14fa30e652a056fefc 100644
+index 10692a1eb265f18756a1d9c4f39fa504f83b8144..3ae965726500762305064168bfb7db6a51eab99b 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
-@@ -164,6 +164,7 @@
- #include "third_party/blink/renderer/core/timing/window_performance.h"
+@@ -165,6 +165,7 @@
+ #include "third_party/blink/renderer/core/view_transition/view_transition_supplement.h"
  #include "third_party/blink/renderer/platform/fonts/font_cache.h"
  #include "third_party/blink/renderer/platform/fonts/generic_font_family_settings.h"
 +#include "third_party/blink/renderer/platform/graphics/color.h"
  #include "third_party/blink/renderer/platform/graphics/image.h"
  #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
  #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
-@@ -1816,6 +1817,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
+@@ -1825,6 +1826,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
  #if BUILDFLAG(IS_MAC)
    web_view_impl->SetMaximumLegibleScale(
        prefs.default_maximum_page_scale_factor);

+ 6 - 6
patches/chromium/feat_add_data_parameter_to_processsingleton.patch

@@ -179,10 +179,10 @@ index 0e1baf024e7aee3bc1edad1e0620bd56647d042b..2302cd0b1c536f5c5bc5125a7bbe133e
    if (!WriteToSocket(socket.fd(), to_send.data(), to_send.length())) {
      // Try to kill the other process, because it might have been dead.
 diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc
-index 51a109504c1c8f79ef8748641ef21efed3a9315d..7df5b345b7e6a2360c226e0aaf48bcdf95c99afa 100644
+index 3dff138357d9e1ae8d572df7630aa6ec429728a3..ae123a441bcf7939fad222d84e4bd6ec84bf6422 100644
 --- a/chrome/browser/process_singleton_win.cc
 +++ b/chrome/browser/process_singleton_win.cc
-@@ -81,10 +81,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) {
+@@ -80,10 +80,12 @@ BOOL CALLBACK BrowserWindowEnumeration(HWND window, LPARAM param) {
  
  bool ParseCommandLine(const COPYDATASTRUCT* cds,
                        base::CommandLine* parsed_command_line,
@@ -197,7 +197,7 @@ index 51a109504c1c8f79ef8748641ef21efed3a9315d..7df5b345b7e6a2360c226e0aaf48bcdf
    static const int min_message_size = 7;
    if (cds->cbData < min_message_size * sizeof(wchar_t) ||
        cds->cbData % sizeof(wchar_t) != 0) {
-@@ -134,6 +136,37 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
+@@ -133,6 +135,37 @@ bool ParseCommandLine(const COPYDATASTRUCT* cds,
      const std::wstring cmd_line =
          msg.substr(second_null + 1, third_null - second_null);
      *parsed_command_line = base::CommandLine::FromString(cmd_line);
@@ -235,7 +235,7 @@ index 51a109504c1c8f79ef8748641ef21efed3a9315d..7df5b345b7e6a2360c226e0aaf48bcdf
      return true;
    }
    return false;
-@@ -155,13 +188,14 @@ bool ProcessLaunchNotification(
+@@ -154,13 +187,14 @@ bool ProcessLaunchNotification(
  
    base::CommandLine parsed_command_line(base::CommandLine::NO_PROGRAM);
    base::FilePath current_directory;
@@ -253,7 +253,7 @@ index 51a109504c1c8f79ef8748641ef21efed3a9315d..7df5b345b7e6a2360c226e0aaf48bcdf
    return true;
  }
  
-@@ -267,9 +301,11 @@ bool ProcessSingleton::EscapeVirtualization(
+@@ -264,9 +298,11 @@ bool ProcessSingleton::EscapeVirtualization(
  ProcessSingleton::ProcessSingleton(
      const std::string& program_name,
      const base::FilePath& user_data_dir,
@@ -265,7 +265,7 @@ index 51a109504c1c8f79ef8748641ef21efed3a9315d..7df5b345b7e6a2360c226e0aaf48bcdf
        program_name_(program_name),
        is_app_sandboxed_(is_app_sandboxed),
        is_virtualized_(false),
-@@ -296,7 +332,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
+@@ -293,7 +329,7 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() {
      return PROCESS_NONE;
    }
  

+ 2 - 2
patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch

@@ -26,7 +26,7 @@ index 835fa36e64e2cb350f3f09798b0040b234f7c0ee..f9a754acab125bc50660e9c3763b3693
  }
  
 diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
-index a97bf39a8b481ce5d6c87a22054451f5fd470b75..4748ef033d939173b4dbe6f6cb83eb3b9ebcd970 100644
+index 535e60b3efeb02ca9789e84460fde31e969b4043..5d9f3fa03f88c820cc3573c2d27f9b4f21ccc4a8 100644
 --- a/ui/native_theme/native_theme.h
 +++ b/ui/native_theme/native_theme.h
 @@ -407,6 +407,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -53,7 +53,7 @@ index a97bf39a8b481ce5d6c87a22054451f5fd470b75..4748ef033d939173b4dbe6f6cb83eb3b
    // Returns a shared instance of the native theme that should be used for web
    // rendering. Do not use it in a normal application context (i.e. browser).
    // The returned object should not be deleted by the caller. This function is
-@@ -588,6 +605,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
+@@ -589,6 +606,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
    PageColors page_colors_ = PageColors::kOff;
    PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
    PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;

+ 1 - 1
patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch

@@ -13,7 +13,7 @@ other protocols to register their streaming behavior. MultibufferDataSource::Ass
 then refers to the list so that it can correctly determine the data source's settings.
 
 diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
-index a26d2de400d1a2b5d97d03eb438c4d7024e03ef5..c1ae23cda6a72d92c508ef239b7c4892dc81c4af 100644
+index f1b47787d5296e8bdc3090840573270fff1f344e..ac114e77a335b0f66670be88873c071e18f4726f 100644
 --- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
 +++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
 @@ -11,8 +11,10 @@

+ 3 - 3
patches/chromium/feat_add_support_for_overriding_the_base_spellchecker_download_url.patch

@@ -9,7 +9,7 @@ production use cases.  This is unlikely to be upstreamed as the change
 is entirely in //chrome.
 
 diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
-index 27f5a789f39c3ac896e3d4b8fd9fedcb562ef8c4..cf73bd941d82d54cbd6fab95123672439a652f0e 100644
+index 8302d03e58eede9376d399eaf5f5de166bea9b20..1ee63c9349f8c6e12e3b3f483bb2a7d14dae9676 100644
 --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
 +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
 @@ -49,6 +49,9 @@ namespace {
@@ -22,7 +22,7 @@ index 27f5a789f39c3ac896e3d4b8fd9fedcb562ef8c4..cf73bd941d82d54cbd6fab9512367243
  // Close the file.
  void CloseDictionary(base::File file) {
    base::ScopedBlockingCall scoped_blocking_call(FROM_HERE,
-@@ -269,6 +272,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
+@@ -266,6 +269,10 @@ void SpellcheckHunspellDictionary::SetDownloadURLForTesting(const GURL url) {
    g_download_url_for_testing.Get() = url;
  }
  
@@ -33,7 +33,7 @@ index 27f5a789f39c3ac896e3d4b8fd9fedcb562ef8c4..cf73bd941d82d54cbd6fab9512367243
  GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
    if (g_download_url_for_testing.Get() != GURL())
      return g_download_url_for_testing.Get();
-@@ -276,6 +283,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
+@@ -273,6 +280,9 @@ GURL SpellcheckHunspellDictionary::GetDictionaryURL() {
    std::string bdict_file = dictionary_file_.path.BaseName().MaybeAsASCII();
    DCHECK(!bdict_file.empty());
  

+ 13 - 14
patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch

@@ -7,20 +7,19 @@ Subject: feat: allow embedders to add observers on created hunspell
 This patch is used by Electron to implement spellchecker events.
 
 diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
-index 0409bf02684e1d01a76e04f43fe30bb19098ac4c..b1102a326d8ef74ac42494f6bc2a36815d56d465 100644
+index 83e8a4cc6cac723173121daea2374b874ed5e5f1..5c73b3b93653671a1ab3c6567a2b76fde5ce5ab3 100644
 --- a/chrome/browser/spellchecker/spellcheck_service.cc
 +++ b/chrome/browser/spellchecker/spellcheck_service.cc
-@@ -463,6 +463,9 @@ void SpellcheckService::LoadDictionaries() {
+@@ -468,6 +468,8 @@ void SpellcheckService::LoadDictionaries() {
          std::make_unique<SpellcheckHunspellDictionary>(
              dictionary, platform_spellcheck_language, context_, this));
      hunspell_dictionaries_.back()->AddObserver(this);
-+    if (hunspell_observer_) {
++    if (hunspell_observer_)
 +      hunspell_dictionaries_.back()->AddObserver(hunspell_observer_);
-+    }
      hunspell_dictionaries_.back()->Load();
    }
  
-@@ -515,6 +518,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
+@@ -520,6 +522,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const {
           (!hunspell_dictionaries_.empty() || enable_if_uninitialized);
  }
  
@@ -38,23 +37,23 @@ index 0409bf02684e1d01a76e04f43fe30bb19098ac4c..b1102a326d8ef74ac42494f6bc2a3681
 +  hunspell_observer_ = observer;
 +}
 +
- void SpellcheckService::OnRenderProcessHostCreated(
-     content::RenderProcessHost* host) {
-   InitForRenderer(host);
+ void SpellcheckService::Observe(int type,
+                                 const content::NotificationSource& source,
+                                 const content::NotificationDetails& details) {
 diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h
-index 00e613bb4ca4346eb0b0e65b9b818d817ac724d9..bd9745d29a61944a23b83b274aace2ea8cb37a0f 100644
+index 17b0aaeb05bcb1f8dadc6551c6b688c7b084c1ff..1e1060f348bc9c5ee23ecf6cbffddad27a80af18 100644
 --- a/chrome/browser/spellchecker/spellcheck_service.h
 +++ b/chrome/browser/spellchecker/spellcheck_service.h
-@@ -135,6 +135,8 @@ class SpellcheckService : public KeyedService,
+@@ -138,6 +138,8 @@ class SpellcheckService : public KeyedService,
    // dictionaries available.
    bool IsSpellcheckEnabled() const;
  
 +  void SetHunspellObserver(SpellcheckHunspellDictionary::Observer* observer);
 +
-   // content::RenderProcessHostCreationObserver implementation.
-   void OnRenderProcessHostCreated(content::RenderProcessHost* host) override;
- 
-@@ -299,6 +301,8 @@ class SpellcheckService : public KeyedService,
+   // NotificationProfile implementation.
+   void Observe(int type,
+                const content::NotificationSource& source,
+@@ -305,6 +307,8 @@ class SpellcheckService : public KeyedService,
    // A pointer to the BrowserContext which this service refers to.
    raw_ptr<content::BrowserContext> context_;
  

Some files were not shown because too many files changed in this diff