Browse Source

chore: bump chromium to 133.0.6920.0 (main) (#45055)

* chore: bump chromium in DEPS to 133.0.6902.0

* chore: bump chromium in DEPS to 133.0.6903.0

* chore: update patches

* Update PdfViewer Save File Picker to use showSaveFilePicker.

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6074308

* Code Health: Clean up stale MacWebContentsOcclusion

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6078344

* Change RenderProcessHost::GetID to RenderProcessHost::GetDeprecatedID

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6065543

* [WebRTC] Make WebRTC IP Handling policy a mojo enum

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6063620

* chore: gen filenames.libcxx.gni

* Remove allow_unsafe_buffers pragma in //printing

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6092280

* refactor: to use ChildProcessId where possible

Refs https://issues.chromium.org/issues/379869738

* [Win] Update TabletMode detection code

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6003486

* chore: bump chromium in DEPS to 133.0.6905.0

* chore: update patches

* Reland "Move global shortcut listener to //ui/base"

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6099035

* [shared storage] Implement the batch `with_lock` option for response header

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6072742

* chore: bump chromium in DEPS to 133.0.6907.0

* chore: bump chromium in DEPS to 133.0.6909.0

* chore: bump chromium in DEPS to 133.0.6911.0

* chore: bump chromium in DEPS to 133.0.6912.0

* chore: update patches

* WebUI: Reveal hidden deps to ui/webui/resources.

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6096291

* chore: bump chromium in DEPS to 133.0.6913.0

* chore: bump chromium in DEPS to 133.0.6915.0

* Code Health: Clean up stale base::Feature "AccessibilityTreeForViews"

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6104174

Co-authored-by: David Sanders <[email protected]>

* fix: remove fastapitypedarray usage

* chore: update patches

* chore: script/gen-libc++-filenames.js

* Code Health: Clean up stale base::Feature "WinRetrieveSuggestionsOnlyOnDemand"

Refs https://chromium-review.googlesource.com/c/chromium/src/+/6109477

* fix: empty suggestions with windows platform checker

Amends the fix from https://github.com/electron/electron/pull/29690
since the feature flag is no longer available. We follow the
same pattern as //chrome/browser/renderer_context_menu/spelling_menu_observer.cc
to generate the suggestion list on demand when context menu action
is invoked.

Co-authored-by: David Sanders <[email protected]>

* fixup! fix: empty suggestions with windows platform checker

* fixup! fix: empty suggestions with windows platform checker

* revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | https://chromium-review.googlesource.com/c/chromium/src/+/6078344

* Revert "revert: 6078344: Code Health: Clean up stale MacWebContentsOcclusion | https://chromium-review.googlesource.com/c/chromium/src/+/6078344"

This reverts commit 9cacda452ed5a072351e8f5a35b009d91843a08c.

* chore: bump to 133.0.6920.0, update patches

* Revert "6078344: Code Health: Clean up stale MacWebContentsOcclusion"

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/6078344

* fixup! Update PdfViewer Save File Picker to use showSaveFilePicker.

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: deepak1556 <[email protected]>
Co-authored-by: David Sanders <[email protected]>
Co-authored-by: Keeley Hammond <[email protected]>
electron-roller[bot] 3 months ago
parent
commit
7d05b78479
100 changed files with 1072 additions and 2519 deletions
  1. 1 1
      DEPS
  2. 1 11
      chromium_src/BUILD.gn
  3. 2 2
      electron_paks.gni
  4. 16 4
      filenames.libcxx.gni
  5. 1 1
      patches/boringssl/expose_ripemd160.patch
  6. 1 1
      patches/boringssl/feat_expose_several_extra_cipher_functions.patch
  7. 3 3
      patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch
  8. 1 1
      patches/chromium/.patches
  9. 1 1
      patches/chromium/accelerator.patch
  10. 3 3
      patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
  11. 13 13
      patches/chromium/add_didinstallconditionalfeatures.patch
  12. 14 14
      patches/chromium/adjust_accessibility_ui_for_electron.patch
  13. 4 4
      patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch
  14. 4 4
      patches/chromium/blink_local_frame.patch
  15. 1 1
      patches/chromium/build_add_electron_tracing_category.patch
  16. 8 8
      patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch
  17. 2 2
      patches/chromium/build_expose_webplugininfo_interface_to_electron.patch
  18. 1 1
      patches/chromium/build_gn.patch
  19. 3 3
      patches/chromium/build_run_reclient_cfg_generator_after_chrome.patch
  20. 21 21
      patches/chromium/can_create_window.patch
  21. 8 8
      patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
  22. 8 9
      patches/chromium/chore_partial_revert_of.patch
  23. 2 2
      patches/chromium/chore_patch_out_partition_attribute_dcheck_for_webviews.patch
  24. 35 35
      patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch
  25. 1 1
      patches/chromium/chore_remove_check_is_test_on_script_injection_tracker.patch
  26. 55 55
      patches/chromium/command-ismediakey.patch
  27. 3 3
      patches/chromium/crash_allow_setting_more_options.patch
  28. 7 7
      patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch
  29. 4 4
      patches/chromium/custom_protocols_plzserviceworker.patch
  30. 1 1
      patches/chromium/disable_compositor_recycling.patch
  31. 6 6
      patches/chromium/disable_hidden.patch
  32. 3 3
      patches/chromium/disable_unload_metrics.patch
  33. 4 4
      patches/chromium/enable_reset_aspect_ratio.patch
  34. 8 8
      patches/chromium/expose_setuseragent_on_networkcontext.patch
  35. 1 1
      patches/chromium/extend_apply_webpreferences.patch
  36. 8 8
      patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch
  37. 2 2
      patches/chromium/feat_allow_code_cache_in_custom_schemes.patch
  38. 3 3
      patches/chromium/feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch
  39. 13 13
      patches/chromium/feat_configure_launch_options_for_service_process.patch
  40. 1 1
      patches/chromium/feat_enable_customizing_symbol_color_in_framecaptionbutton.patch
  41. 4 4
      patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch
  42. 4 4
      patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch
  43. 2 2
      patches/chromium/feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch
  44. 11 11
      patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch
  45. 4 4
      patches/chromium/fix_activate_background_material_on_windows.patch
  46. 14 13
      patches/chromium/fix_adapt_exclusive_access_for_electron_needs.patch
  47. 4 3
      patches/chromium/fix_aspect_ratio_with_max_size.patch
  48. 5 5
      patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch
  49. 6 70
      patches/chromium/fix_crash_when_saving_edited_pdf_files.patch
  50. 14 14
      patches/chromium/fix_media_key_usage_with_globalshortcuts.patch
  51. 2 2
      patches/chromium/fix_move_autopipsettingshelper_behind_branding_buildflag.patch
  52. 6 6
      patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch
  53. 9 7
      patches/chromium/fix_properly_honor_printing_page_ranges.patch
  54. 2 2
      patches/chromium/fix_remove_caption-removing_style_call.patch
  55. 2 2
      patches/chromium/fix_restore_original_resize_performance_on_macos.patch
  56. 5 5
      patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch
  57. 5 5
      patches/chromium/fix_select_the_first_menu_item_when_opened_via_keyboard.patch
  58. 1 1
      patches/chromium/fix_software_compositing_infinite_loop.patch
  59. 3 3
      patches/chromium/fix_use_delegated_generic_capturer_when_available.patch
  60. 4 4
      patches/chromium/frame_host_manager.patch
  61. 1 1
      patches/chromium/gin_enable_disable_v8_platform.patch
  62. 2 2
      patches/chromium/gritsettings_resource_ids.patch
  63. 1 1
      patches/chromium/gtk_visibility.patch
  64. 2 2
      patches/chromium/load_v8_snapshot_in_browser_process.patch
  65. 2 2
      patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch
  66. 58 57
      patches/chromium/mas_avoid_private_macos_api_usage.patch.patch
  67. 13 13
      patches/chromium/network_service_allow_remote_certificate_verification_logic.patch
  68. 14 14
      patches/chromium/notification_provenance.patch
  69. 2 2
      patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch
  70. 2 2
      patches/chromium/picture-in-picture.patch
  71. 4 4
      patches/chromium/port_autofill_colors_to_the_color_pipeline.patch
  72. 12 12
      patches/chromium/printing.patch
  73. 9 9
      patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
  74. 4 4
      patches/chromium/refactor_expose_hostimportmoduledynamically_and.patch
  75. 2 2
      patches/chromium/refactor_restore_base_adaptcallbackforrepeating.patch
  76. 2 2
      patches/chromium/refactor_unfilter_unresponsive_events.patch
  77. 0 80
      patches/chromium/reland_set_app_container_acls_reliably_on_out_directory.patch
  78. 1 1
      patches/chromium/resource_file_conflict.patch
  79. 143 0
      patches/chromium/revert_code_health_clean_up_stale_macwebcontentsocclusion.patch
  80. 2 2
      patches/chromium/scroll_bounce_flag.patch
  81. 2 2
      patches/chromium/support_mixed_sandbox_with_zygote.patch
  82. 6 6
      patches/chromium/web_contents.patch
  83. 5 5
      patches/chromium/webview_fullscreen.patch
  84. 6 6
      patches/chromium/worker_context_will_destroy.patch
  85. 6 6
      patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch
  86. 2 2
      patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch
  87. 1 0
      patches/node/.patches
  88. 277 0
      patches/node/fix_remove_fastapitypedarray_usage.patch
  89. 0 3
      patches/v8/.patches
  90. 2 2
      patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch
  91. 0 419
      patches/v8/revert_api_delete_deprecated_struct_fastapitypedarray.patch
  92. 0 525
      patches/v8/revert_fastapi_add_support_for_attribute_setters.patch
  93. 0 853
      patches/v8/revert_fastapi_remove_dynamic_overload_resolution.patch
  94. 12 9
      shell/browser/api/electron_api_app.cc
  95. 5 3
      shell/browser/api/electron_api_app.h
  96. 67 16
      shell/browser/api/electron_api_web_contents.cc
  97. 13 1
      shell/browser/api/electron_api_web_contents.h
  98. 2 2
      shell/browser/api/electron_api_web_frame_main.cc
  99. 1 1
      shell/browser/api/electron_api_web_frame_main.h
  100. 8 6
      shell/browser/badging/badge_manager.h

+ 1 - 1
DEPS

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
 
 vars = {
   'chromium_version':
-    '133.0.6887.0',
+    '133.0.6920.0',
   'node_version':
     'v22.9.0',
   'nan_version':

+ 1 - 11
chromium_src/BUILD.gn

@@ -155,8 +155,6 @@ static_library("chrome") {
 
   if (is_win) {
     sources += [
-      "//chrome/browser/extensions/global_shortcut_listener_win.cc",
-      "//chrome/browser/extensions/global_shortcut_listener_win.h",
       "//chrome/browser/icon_loader_win.cc",
       "//chrome/browser/media/webrtc/window_icon_util_win.cc",
       "//chrome/browser/process_singleton_win.cc",
@@ -204,6 +202,7 @@ static_library("chrome") {
     "//components/enterprise/obfuscation/core:enterprise_obfuscation",
     "//components/safe_browsing/core/browser/db:safebrowsing_proto",
     "//components/vector_icons:vector_icons",
+    "//ui/base/accelerators/global_accelerator_listener",
     "//ui/snapshot",
     "//ui/views/controls/webview",
   ]
@@ -224,13 +223,6 @@ static_library("chrome") {
       "//chrome/browser/extensions/global_shortcut_listener_linux.h",
       "//chrome/browser/icon_loader_auralinux.cc",
     ]
-    if (use_ozone) {
-      deps += [ "//ui/ozone" ]
-      sources += [
-        "//chrome/browser/extensions/global_shortcut_listener_ozone.cc",
-        "//chrome/browser/extensions/global_shortcut_listener_ozone.h",
-      ]
-    }
     sources += [
       "//chrome/browser/ui/views/status_icons/concat_menu_model.cc",
       "//chrome/browser/ui/views/status_icons/concat_menu_model.h",
@@ -263,8 +255,6 @@ static_library("chrome") {
 
   if (is_mac) {
     sources += [
-      "//chrome/browser/extensions/global_shortcut_listener_mac.h",
-      "//chrome/browser/extensions/global_shortcut_listener_mac.mm",
       "//chrome/browser/icon_loader_mac.mm",
       "//chrome/browser/media/webrtc/system_media_capture_permissions_mac.h",
       "//chrome/browser/media/webrtc/system_media_capture_permissions_mac.mm",

+ 2 - 2
electron_paks.gni

@@ -85,7 +85,7 @@ template("electron_extra_paks") {
       "//net:net_resources",
       "//third_party/blink/public:devtools_inspector_resources",
       "//third_party/blink/public:resources",
-      "//ui/resources",
+      "//ui/webui/resources",
     ]
     if (defined(invoker.deps)) {
       deps += invoker.deps
@@ -98,7 +98,7 @@ template("electron_extra_paks") {
     sources += [
       "$root_gen_dir/content/browser/devtools/devtools_resources.pak",
       "$root_gen_dir/content/process_resources.pak",
-      "$root_gen_dir/ui/resources/webui_resources.pak",
+      "$root_gen_dir/ui/webui/resources/webui_resources.pak",
     ]
     deps += [ "//content/browser/devtools:devtools_resources" ]
     if (enable_pdf_viewer) {

+ 16 - 4
filenames.libcxx.gni

@@ -213,11 +213,13 @@ libcxx_headers = [
   "//third_party/libc++/src/include/__atomic/atomic_sync.h",
   "//third_party/libc++/src/include/__atomic/check_memory_order.h",
   "//third_party/libc++/src/include/__atomic/contention_t.h",
-  "//third_party/libc++/src/include/__atomic/cxx_atomic_impl.h",
   "//third_party/libc++/src/include/__atomic/fence.h",
   "//third_party/libc++/src/include/__atomic/is_always_lock_free.h",
   "//third_party/libc++/src/include/__atomic/kill_dependency.h",
   "//third_party/libc++/src/include/__atomic/memory_order.h",
+  "//third_party/libc++/src/include/__atomic/support/c11.h",
+  "//third_party/libc++/src/include/__atomic/support/gcc.h",
+  "//third_party/libc++/src/include/__atomic/support.h",
   "//third_party/libc++/src/include/__atomic/to_gcc_order.h",
   "//third_party/libc++/src/include/__bit/bit_cast.h",
   "//third_party/libc++/src/include/__bit/bit_ceil.h",
@@ -331,7 +333,6 @@ libcxx_headers = [
   "//third_party/libc++/src/include/__cstddef/nullptr_t.h",
   "//third_party/libc++/src/include/__cstddef/ptrdiff_t.h",
   "//third_party/libc++/src/include/__cstddef/size_t.h",
-  "//third_party/libc++/src/include/__cxx03/CMakeLists.txt",
   "//third_party/libc++/src/include/__cxx03/__algorithm/adjacent_find.h",
   "//third_party/libc++/src/include/__cxx03/__algorithm/all_of.h",
   "//third_party/libc++/src/include/__cxx03/__algorithm/any_of.h",
@@ -652,6 +653,7 @@ libcxx_headers = [
   "//third_party/libc++/src/include/__cxx03/__configuration/abi.h",
   "//third_party/libc++/src/include/__cxx03/__configuration/availability.h",
   "//third_party/libc++/src/include/__cxx03/__configuration/compiler.h",
+  "//third_party/libc++/src/include/__cxx03/__configuration/config_site_shim.h",
   "//third_party/libc++/src/include/__cxx03/__configuration/language.h",
   "//third_party/libc++/src/include/__cxx03/__configuration/platform.h",
   "//third_party/libc++/src/include/__cxx03/__coroutine/coroutine_handle.h",
@@ -1379,6 +1381,7 @@ libcxx_headers = [
   "//third_party/libc++/src/include/__filesystem/space_info.h",
   "//third_party/libc++/src/include/__filesystem/u8path.h",
   "//third_party/libc++/src/include/__flat_map/flat_map.h",
+  "//third_party/libc++/src/include/__flat_map/key_value_iterator.h",
   "//third_party/libc++/src/include/__flat_map/sorted_unique.h",
   "//third_party/libc++/src/include/__format/buffer.h",
   "//third_party/libc++/src/include/__format/concepts.h",
@@ -1520,13 +1523,12 @@ libcxx_headers = [
   "//third_party/libc++/src/include/__locale_dir/locale_base_api/ibm.h",
   "//third_party/libc++/src/include/__locale_dir/locale_base_api/musl.h",
   "//third_party/libc++/src/include/__locale_dir/locale_base_api/openbsd.h",
-  "//third_party/libc++/src/include/__locale_dir/locale_base_api/win32.h",
   "//third_party/libc++/src/include/__locale_dir/locale_base_api.h",
-  "//third_party/libc++/src/include/__locale_dir/locale_guard.h",
   "//third_party/libc++/src/include/__locale_dir/pad_and_output.h",
   "//third_party/libc++/src/include/__locale_dir/support/apple.h",
   "//third_party/libc++/src/include/__locale_dir/support/bsd_like.h",
   "//third_party/libc++/src/include/__locale_dir/support/freebsd.h",
+  "//third_party/libc++/src/include/__locale_dir/support/windows.h",
   "//third_party/libc++/src/include/__math/abs.h",
   "//third_party/libc++/src/include/__math/copysign.h",
   "//third_party/libc++/src/include/__math/error_functions.h",
@@ -1599,6 +1601,16 @@ libcxx_headers = [
   "//third_party/libc++/src/include/__mutex/once_flag.h",
   "//third_party/libc++/src/include/__mutex/tag_types.h",
   "//third_party/libc++/src/include/__mutex/unique_lock.h",
+  "//third_party/libc++/src/include/__new/align_val_t.h",
+  "//third_party/libc++/src/include/__new/allocate.h",
+  "//third_party/libc++/src/include/__new/destroying_delete_t.h",
+  "//third_party/libc++/src/include/__new/exceptions.h",
+  "//third_party/libc++/src/include/__new/global_new_delete.h",
+  "//third_party/libc++/src/include/__new/interference_size.h",
+  "//third_party/libc++/src/include/__new/launder.h",
+  "//third_party/libc++/src/include/__new/new_handler.h",
+  "//third_party/libc++/src/include/__new/nothrow_t.h",
+  "//third_party/libc++/src/include/__new/placement_new_delete.h",
   "//third_party/libc++/src/include/__node_handle",
   "//third_party/libc++/src/include/__numeric/accumulate.h",
   "//third_party/libc++/src/include/__numeric/adjacent_difference.h",

+ 1 - 1
patches/boringssl/expose_ripemd160.patch

@@ -62,7 +62,7 @@ index e1b08fa2f2e2e3afca95b1f8b719220c5436903b..90a5d1895b9d5dff2748ef638c06c127
 +
  #undef CHECK
 diff --git a/decrepit/evp/evp_do_all.cc b/decrepit/evp/evp_do_all.cc
-index a3fb077b9b9e66d1bc524fd7987622e73aa4776a..852b76bea69988e0b3ac76a17b603128f239dde0 100644
+index e199e10ca6602f231df4d83e1efe5254ee20e98f..9fd0e0225fa48b0afb90b525236e54cff17c1c84 100644
 --- a/decrepit/evp/evp_do_all.cc
 +++ b/decrepit/evp/evp_do_all.cc
 @@ -79,6 +79,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher,

+ 1 - 1
patches/boringssl/feat_expose_several_extra_cipher_functions.patch

@@ -64,7 +64,7 @@ index 62850ab6a216d401d023f81007fb59a33b4585f3..95bd172c99874610ec9157c52df4fe02
  
  const EVP_CIPHER *EVP_get_cipherbynid(int nid) {
 diff --git a/decrepit/evp/evp_do_all.cc b/decrepit/evp/evp_do_all.cc
-index 852b76bea69988e0b3ac76a17b603128f239dde0..43fc792697519325725e9ce87801c5dc176c70a1 100644
+index 9fd0e0225fa48b0afb90b525236e54cff17c1c84..dded715011ac8c1dd9e4525f0bdd64088f8007cf 100644
 --- a/decrepit/evp/evp_do_all.cc
 +++ b/decrepit/evp/evp_do_all.cc
 @@ -20,8 +20,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher,

+ 3 - 3
patches/boringssl/revert_track_ssl_error_zero_return_explicitly.patch

@@ -8,10 +8,10 @@ This reverts commit ebd8b8965c74ab06bb91f7a00b23822e1f1f26ca.
 It is causing significant TLS failures in Node.js.
 
 diff --git a/ssl/ssl_buffer.cc b/ssl/ssl_buffer.cc
-index 7de8923518dbfb69fef62d7781f906b30cf62155..7a4310d6d8e85f07f0ae6c97726d909c4503bce9 100644
+index 76c74e2941d9912ca93a69254f540a6a6ddd9e74..3baf5043800c8cbca73efa4d8a65a68e9ec0ecc4 100644
 --- a/ssl/ssl_buffer.cc
 +++ b/ssl/ssl_buffer.cc
-@@ -235,7 +235,6 @@ int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret,
+@@ -230,7 +230,6 @@ int ssl_handle_open_record(SSL *ssl, bool *out_retry, ssl_open_record_t ret,
        return 1;
  
      case ssl_open_record_close_notify:
@@ -20,7 +20,7 @@ index 7de8923518dbfb69fef62d7781f906b30cf62155..7a4310d6d8e85f07f0ae6c97726d909c
  
      case ssl_open_record_error:
 diff --git a/ssl/ssl_lib.cc b/ssl/ssl_lib.cc
-index d601695f51322f3ccecfd31b623eabf8440fceaa..0eb0e88c495d6934345e067298305041ee3d9a8b 100644
+index 4ede3ad282b30b84df70a24ed9b89c516cddae4e..4d8fe9eb9a2138da994e54da6fa00ffa6a62a71d 100644
 --- a/ssl/ssl_lib.cc
 +++ b/ssl/ssl_lib.cc
 @@ -1323,7 +1323,7 @@ int SSL_get_error(const SSL *ssl, int ret_code) {

+ 1 - 1
patches/chromium/.patches

@@ -136,4 +136,4 @@ fix_software_compositing_infinite_loop.patch
 refactor_unfilter_unresponsive_events.patch
 build_disable_thin_lto_mac.patch
 build_add_public_config_simdutf_config.patch
-reland_set_app_container_acls_reliably_on_out_directory.patch
+revert_code_health_clean_up_stale_macwebcontentsocclusion.patch

+ 1 - 1
patches/chromium/accelerator.patch

@@ -10,7 +10,7 @@ This patch makes three changes to Accelerator::GetShortcutText to improve shortc
 3. Ctrl-Shift-= and Ctrl-Plus show up as such
 
 diff --git a/ui/base/accelerators/accelerator.cc b/ui/base/accelerators/accelerator.cc
-index 8d9f2ac729ebc5b8ff23bab934a58ac3716a60bf..850f4720d2bc5dcb7f545d9406dad53957129734 100644
+index 1f90103d1ddb04a24797cf1214c3d0c862d77e9f..67eec0d3526349448a56acf9724806aec06104df 100644
 --- a/ui/base/accelerators/accelerator.cc
 +++ b/ui/base/accelerators/accelerator.cc
 @@ -12,6 +12,7 @@

+ 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 59ab3b746782c71f7d9401c13a7c866e6e7a823d..f95842da98d3a1d853633b53c745be9c394b25d5 100644
+index d4ba7601d9e92972b86aa0ca97c33ceb97cd5d10..531a031e69b1a70a9e2c22f8ee72d952abcea7fe 100644
 --- a/content/gpu/gpu_main.cc
 +++ b/content/gpu/gpu_main.cc
-@@ -258,6 +258,10 @@ int GpuMain(MainFunctionParams parameters) {
+@@ -265,6 +265,10 @@ int GpuMain(MainFunctionParams parameters) {
    // to the GpuProcessHost once the GpuServiceImpl has started.
    viz::GpuServiceImpl::InstallPreInitializeLogHandler();
  
@@ -24,7 +24,7 @@ index 59ab3b746782c71f7d9401c13a7c866e6e7a823d..f95842da98d3a1d853633b53c745be9c
    // 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
-@@ -368,7 +372,6 @@ int GpuMain(MainFunctionParams parameters) {
+@@ -375,7 +379,6 @@ int GpuMain(MainFunctionParams parameters) {
  #endif
    const bool dead_on_arrival = !init_success;
  

+ 13 - 13
patches/chromium/add_didinstallconditionalfeatures.patch

@@ -10,10 +10,10 @@ 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 ad0092ef2e13853e4bb8b923481559a043b00ab7..1c2dfd23f18733e21312992877ae1499634d3849 100644
+index dbfaa28f2424f5b109816cfe951d734fc116a39f..d25cece2f5bef606307d44d4fc45eab051e651cc 100644
 --- a/content/public/renderer/render_frame_observer.h
 +++ b/content/public/renderer/render_frame_observer.h
-@@ -150,6 +150,8 @@ class CONTENT_EXPORT RenderFrameObserver
+@@ -149,6 +149,8 @@ class CONTENT_EXPORT RenderFrameObserver
    virtual void DidHandleOnloadEvents() {}
    virtual void DidCreateScriptContext(v8::Local<v8::Context> context,
                                        int32_t world_id) {}
@@ -23,10 +23,10 @@ index ad0092ef2e13853e4bb8b923481559a043b00ab7..1c2dfd23f18733e21312992877ae1499
                                          int32_t world_id) {}
    virtual void DidClearWindowObject() {}
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index 4bf834dc836e4238a98c5f9db216b0054ed7add1..fd2505d9e0608b1c2258e6596b1817835c37b36e 100644
+index 2f3190e81c665cdfbf75ffee9bf09c5936b4a760..2df3bedc57b27afd2d63a0c726f0479246228d33 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -4793,6 +4793,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
+@@ -4794,6 +4794,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
      observer.DidCreateScriptContext(context, world_id);
  }
  
@@ -40,10 +40,10 @@ index 4bf834dc836e4238a98c5f9db216b0054ed7add1..fd2505d9e0608b1c2258e6596b181783
                                                 int world_id) {
    for (auto& observer : observers_)
 diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
-index 0980dad73ed2d5cbcbabee8f7d6fc827bb31b623..fcc651f75677ad1ae25e4edc5e2ae9a82ddd31d0 100644
+index 1994dc767874809091f478efe298aa88e0de9bb7..a4c9ae4e92906aa114e25994951b50816ca78489 100644
 --- a/content/renderer/render_frame_impl.h
 +++ b/content/renderer/render_frame_impl.h
-@@ -651,6 +651,8 @@ class CONTENT_EXPORT RenderFrameImpl
+@@ -650,6 +650,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 0980dad73ed2d5cbcbabee8f7d6fc827bb31b623..fcc651f75677ad1ae25e4edc5e2ae9a8
                                  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 403d654e9a5c1196ac11cccce45c8c53b03275f3..2e03b5f2fea36d9bdf71b4bb15c604de2dc3cf5c 100644
+index 5ea679f5ff3fa5ec6d4937354cb1f52343a05e0d..f4de83e31fe2064adffdb837cd2b8376a545b8bc 100644
 --- a/third_party/blink/public/web/web_local_frame_client.h
 +++ b/third_party/blink/public/web/web_local_frame_client.h
-@@ -665,6 +665,9 @@ class BLINK_EXPORT WebLocalFrameClient {
+@@ -663,6 +663,9 @@ class BLINK_EXPORT WebLocalFrameClient {
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) {}
  
@@ -79,10 +79,10 @@ index f7e0144c74f879e9b29871d7c372b99e127966bb..c3cd7b77ed282f212a56d151dc3fbec3
    if (World().IsMainWorld()) {
      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 d4fe8d76a94eeb27aed8f2261394edc0acdf5694..5af657a1f20949fb4df7b101aa27ed0cd29c89ca 100644
+index c3fb21c5add440acc13ec673b132ccb0bedb5046..5f16a2f3a9583613e319b85f348ea40e4b75c65f 100644
 --- a/third_party/blink/renderer/core/frame/local_frame_client.h
 +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
-@@ -301,6 +301,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
+@@ -299,6 +299,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
  
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) = 0;
@@ -92,7 +92,7 @@ index d4fe8d76a94eeb27aed8f2261394edc0acdf5694..5af657a1f20949fb4df7b101aa27ed0c
                                          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 0975fc371a20d21df2dd9d08986c665237d6d38f..63c365ed8dd65f6b15b3d887aa2d7f2f18111eb7 100644
+index 92d2e7e209cac354bec7088a2a64ade3aa88a679..d1d86aeb163134e59f9b2b3a9bd17bcc268fc6e3 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
 @@ -294,6 +294,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -110,10 +110,10 @@ index 0975fc371a20d21df2dd9d08986c665237d6d38f..63c365ed8dd65f6b15b3d887aa2d7f2f
      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 526a61b4e9ecb3f0343dcafa6b17e7b24c8db830..5b16f232c651c428ebc150b427dedd73fcd25e2f 100644
+index 2a5537ffa0b5c547237d1d3f0a3dfb1f442a9ce2..d3bb5a4fd712f853da56e9dd2480d56dbf013536 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
-@@ -83,6 +83,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
+@@ -81,6 +81,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
  
    void DidCreateScriptContext(v8::Local<v8::Context>,
                                int32_t world_id) override;

+ 14 - 14
patches/chromium/adjust_accessibility_ui_for_electron.patch

@@ -10,7 +10,7 @@ usage of BrowserList and Browser as we subclass related methods and use our
 WindowList.
 
 diff --git a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
-index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498a262ac35 100644
+index 4693833f389b54d6c62efdbd8343df8c1f33795d..4bd07712e551162c8df1bad29137f8f27c8a7d7b 100644
 --- a/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
 +++ b/chrome/browser/ui/webui/accessibility/accessibility_ui.cc
 @@ -43,6 +43,7 @@
@@ -21,8 +21,8 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
  #include "ui/accessibility/accessibility_features.h"
  #include "ui/accessibility/ax_updates_and_events.h"
  #include "ui/accessibility/platform/ax_platform_node.h"
-@@ -169,7 +170,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
-                                accessibility_mode);
+@@ -166,7 +167,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
+                                rvh->GetRoutingID(), accessibility_mode);
  }
  
 -#if !BUILDFLAG(IS_ANDROID)
@@ -30,7 +30,7 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
  base::Value::Dict BuildTargetDescriptor(Browser* browser) {
    base::Value::Dict target_data;
    target_data.Set(kSessionIdField, browser->session_id().id());
-@@ -203,7 +204,7 @@ void HandleAccessibilityRequestCallback(
+@@ -187,7 +188,7 @@ void HandleAccessibilityRequestCallback(
    DCHECK(ShouldHandleAccessibilityRequestCallback(path));
  
    base::Value::Dict data;
@@ -39,8 +39,8 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
    ui::AXMode mode =
        content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
    bool is_native_enabled = content::BrowserAccessibilityState::GetInstance()
-@@ -236,7 +237,7 @@ void HandleAccessibilityRequestCallback(
-   data.Set(kViewsAccessibility, features::IsAccessibilityTreeForViewsEnabled());
+@@ -216,7 +217,7 @@ void HandleAccessibilityRequestCallback(
+   data.Set(kPDFPrinting, pdf_printing ? kOn : kOff);
  
    std::string pref_api_type =
 -      pref->GetString(prefs::kShownAccessibilityApiType);
@@ -48,7 +48,7 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
    bool pref_api_type_supported = false;
  
    std::vector<ui::AXApiType::Type> supported_api_types =
-@@ -303,11 +304,11 @@ void HandleAccessibilityRequestCallback(
+@@ -283,11 +284,11 @@ void HandleAccessibilityRequestCallback(
    data.Set(kPagesField, std::move(page_list));
  
    base::Value::List browser_list;
@@ -61,8 +61,8 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
 +#endif
    data.Set(kBrowsersField, std::move(browser_list));
  
-   base::Value::List widgets_list;
-@@ -639,7 +640,8 @@ void AccessibilityUIMessageHandler::SetGlobalString(
+   std::string json_string;
+@@ -606,7 +607,8 @@ void AccessibilityUIMessageHandler::SetGlobalString(
    const std::string value = CheckJSValue(data.FindString(kValueField));
  
    if (string_name == kApiTypeField) {
@@ -72,7 +72,7 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
      pref->SetString(prefs::kShownAccessibilityApiType, value);
    }
  }
-@@ -692,7 +694,8 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
+@@ -659,7 +661,8 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
                       AXPropertyFilter::ALLOW_EMPTY);
    AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
  
@@ -82,7 +82,7 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
    ui::AXApiType::Type api_type =
        ui::AXApiType::From(pref->GetString(prefs::kShownAccessibilityApiType));
    std::string accessibility_contents =
-@@ -719,6 +722,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
+@@ -686,6 +689,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
                       AXPropertyFilter::ALLOW_EMPTY);
    AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
  
@@ -90,7 +90,7 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
    for (Browser* browser : *BrowserList::GetInstance()) {
      if (browser->session_id().id() == session_id) {
        base::Value::Dict result = BuildTargetDescriptor(browser);
-@@ -731,6 +735,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
+@@ -698,6 +702,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
        return;
      }
    }
@@ -98,7 +98,7 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
  #endif  // !BUILDFLAG(IS_ANDROID)
    // No browser with the specified |session_id| was found.
    base::Value::Dict result;
-@@ -799,11 +804,13 @@ void AccessibilityUIMessageHandler::StopRecording(
+@@ -741,11 +746,13 @@ void AccessibilityUIMessageHandler::StopRecording(
  }
  
  ui::AXApiType::Type AccessibilityUIMessageHandler::GetRecordingApiType() {
@@ -115,7 +115,7 @@ index d0fe2040a65211c6ba25ce74c71b397573b7519c..7dfe50a1c90b028b79a22534800ee498
    // Check to see if it is in the supported types list.
    if (std::find(supported_types.begin(), supported_types.end(), api_type) ==
        supported_types.end()) {
-@@ -873,8 +880,11 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
+@@ -815,8 +822,11 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
  // static
  void AccessibilityUIMessageHandler::RegisterProfilePrefs(
      user_prefs::PrefRegistrySyncable* registry) {

+ 4 - 4
patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch

@@ -23,7 +23,7 @@ index 63470e0c3d77a2aeeab80e25580b5ccc081cb2b9..e652131f10aa6c74ea9581fcc66a6ffa
      return receiver_.BindNewEndpointAndPassDedicatedRemote();
    }
 diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
-index 4675bec818108c5c28f582d3bcffac0b760ff266..c201a7e44ac992e38ed85456be9d69bfc0a843a3 100644
+index 1dc919585dd11d70402f1a054f9f7c82a7a4e703..7807defd0ed367b2d4f815ea5df65777fd1d89ca 100644
 --- a/content/browser/renderer_host/render_view_host_impl.cc
 +++ b/content/browser/renderer_host/render_view_host_impl.cc
 @@ -754,6 +754,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -51,10 +51,10 @@ index 5fb8a3dc69dc5fc5bfa08e01d8f03707a23c9274..41774b60b8cb7e0a22cedc597dc07ad1
    void SendRendererPreferencesToRenderer(
        const blink::RendererPreferences& preferences);
 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 0686fa205c43b70e6125502f8a9e76492ddafb5e..fb551f7bebc3b8d1d0c3679e060d0f103e3f7a73 100644
+index e65c2b9ed1d6d3cc53ee5ba145aa22cb149d9dde..50cac7b36d6e83dea6686636b5e7a2943c44ceac 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
-@@ -586,8 +586,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
+@@ -579,8 +579,8 @@ void RenderWidgetHostViewAura::ShowImpl(PageVisibilityState page_visibility) {
    // OnShowWithPageVisibility will not call NotifyHostAndDelegateOnWasShown,
    // which updates `visibility_`, unless the host is hidden. Make sure no update
    // is needed.
@@ -116,7 +116,7 @@ index 083af135d890c2837e72c314e170e81931bd2a20..5245ea88441ef84c15b8052a9011ce70
    // 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 c1aebbc3db3e22e7e9391cb0eb2654a28a2052f4..77f2b8a03f92062fc9c07b04adb22d421127b73a 100644
+index 041ef7c3079f41a273300bcaeddd32342a5e94c4..aa786f1b88186bea18bccb2a99c9d393df7c684c 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
 @@ -2468,6 +2468,10 @@ void WebViewImpl::SetPageLifecycleStateInternal(

+ 4 - 4
patches/chromium/blink_local_frame.patch

@@ -15,7 +15,7 @@ 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 7e564e9970ef5abf51a212130a8cfb3ec590c5ff..af48a64ae405ffe7d89c8bc074f614efde360b3a 100644
+index e662d4d61595735a30d5c721147a95698d4da3d9..6a0388aad469422dd1c0c2164f8aa858c55cce70 100644
 --- a/third_party/blink/renderer/core/frame/frame.cc
 +++ b/third_party/blink/renderer/core/frame/frame.cc
 @@ -134,14 +134,6 @@ bool Frame::Detach(FrameDetachType type) {
@@ -49,10 +49,10 @@ index 7e564e9970ef5abf51a212130a8cfb3ec590c5ff..af48a64ae405ffe7d89c8bc074f614ef
    // 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 0b2043673b01c7b47d85895e6133d1b73d941cad..91d67a69cddcb7ae4425b893f625e40975e665cc 100644
+index 9dbccdb33f73d25416c6c94d59afe9c3261f4875..d43ee5ce7695a7c41cc4f8dc96e066422553b1dd 100644
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
-@@ -746,10 +746,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -748,10 +748,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
    }
    DCHECK(!view_ || !view_->IsAttached());
  
@@ -63,7 +63,7 @@ index 0b2043673b01c7b47d85895e6133d1b73d941cad..91d67a69cddcb7ae4425b893f625e409
    if (!Client())
      return false;
  
-@@ -801,6 +797,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -805,6 +801,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
    DCHECK(!view_->IsAttached());
    Client()->WillBeDetached();
  

+ 1 - 1
patches/chromium/build_add_electron_tracing_category.patch

@@ -8,7 +8,7 @@ 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 59e484bd1e2e39827a74ec4607b7325a57823e00..8a5ba55507f3d6e5997c2c3fac74ca2844dd9593 100644
+index 0370dff555cc5bd12f5e2a1b000707aa0d4aae74..1ff235570cb61a3288ddc70802b29a63b2e39f64 100644
 --- a/base/trace_event/builtin_categories.h
 +++ b/base/trace_event/builtin_categories.h
 @@ -93,6 +93,7 @@

+ 8 - 8
patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch

@@ -11,7 +11,7 @@ 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 3ea31014540b5679880a00e1a3ae8674b8858348..d8b18d03446b6aecad22ab778f6b512ced7fb1cb 100644
+index 0a236366b3f5050fa5d07971404afa111e699ce8..fb0f867dcf846f64887abc11f1aec67ccb7c5145 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
 @@ -200,11 +200,16 @@ if (!is_android && !is_mac) {
@@ -33,11 +33,11 @@ index 3ea31014540b5679880a00e1a3ae8674b8858348..d8b18d03446b6aecad22ab778f6b512c
            "//base",
            "//build:branding_buildflags",
 diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
-index 0e22dc99e59133363b5d56dc6fba9f603a6d9c67..59162df964cf90225010591a722ed8bd0e8269c6 100644
+index 9f35905480ebcbacc724b60a35fe6ecc5f55fa7d..250d9f581018b02ee0e5b1e9630ff292ca3c91c2 100644
 --- a/chrome/browser/BUILD.gn
 +++ b/chrome/browser/BUILD.gn
-@@ -4516,7 +4516,7 @@ static_library("browser") {
-       ]
+@@ -4527,7 +4527,7 @@ static_library("browser") {
+           [ "//chrome/browser/ui/webui/signin:profile_impl" ]
      }
  
 -    if (!is_win) {
@@ -46,10 +46,10 @@ index 0e22dc99e59133363b5d56dc6fba9f603a6d9c67..59162df964cf90225010591a722ed8bd
        # than here in :chrome_dll.
        deps += [ "//chrome:packed_resources_integrity_header" ]
 diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
-index 50bbabb107314333070aabaf78ca79e5f8fa801f..4e2255f209d6523359cb626f361742e70285b2ae 100644
+index 44ac256b44bee638e91b8322d549eedebf762b5a..745f1cf8153d93876c3246b3f4e951cb6ae25098 100644
 --- a/chrome/test/BUILD.gn
 +++ b/chrome/test/BUILD.gn
-@@ -6887,9 +6887,12 @@ test("unit_tests") {
+@@ -6913,9 +6913,12 @@ test("unit_tests") {
        "//chrome/notification_helper",
      ]
  
@@ -63,7 +63,7 @@ index 50bbabb107314333070aabaf78ca79e5f8fa801f..4e2255f209d6523359cb626f361742e7
        "//chrome//services/util_win:unit_tests",
        "//chrome/app:chrome_dll_resources",
        "//chrome/app:win_unit_tests",
-@@ -7823,6 +7826,10 @@ test("unit_tests") {
+@@ -7855,6 +7858,10 @@ test("unit_tests") {
        "../browser/performance_manager/policies/background_tab_loading_policy_unittest.cc",
      ]
  
@@ -74,7 +74,7 @@ index 50bbabb107314333070aabaf78ca79e5f8fa801f..4e2255f209d6523359cb626f361742e7
      sources += [
        # The importer code is not used on Android.
        "../common/importer/firefox_importer_utils_unittest.cc",
-@@ -7875,7 +7882,6 @@ test("unit_tests") {
+@@ -7908,7 +7915,6 @@ test("unit_tests") {
      # Non-android deps for "unit_tests" target.
      deps += [
        "../browser/screen_ai:screen_ai_install_state",

+ 2 - 2
patches/chromium/build_expose_webplugininfo_interface_to_electron.patch

@@ -7,10 +7,10 @@ Allows implementing electron::mojom::ElectronPluginInfoHost interface
 which provides plugin details between browser<->renderer.
 
 diff --git a/content/public/common/BUILD.gn b/content/public/common/BUILD.gn
-index b84e3a73036b0bc2b782d35c04359ba401521917..2d8b206a118592f15a93c2a7bcb2c37c80571cd8 100644
+index bfb8b8a712274e7326bbfd0f7c2c8e60106ea135..ce7abdc8dbf30f63694f5f576851a6d6259e3ec0 100644
 --- a/content/public/common/BUILD.gn
 +++ b/content/public/common/BUILD.gn
-@@ -377,6 +377,7 @@ mojom("interfaces") {
+@@ -372,6 +372,7 @@ mojom("interfaces") {
      "//content/common/*",
      "//extensions/common:mojom",
      "//extensions/common:mojom_blink",

+ 1 - 1
patches/chromium/build_gn.patch

@@ -7,7 +7,7 @@ These are variables we add to the root BUILDCONFIG so that they're available
 everywhere, without having to import("//electron/.../flags.gni").
 
 diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
-index c01896919e5a4549bd5e1d2d8d54f69fcb2b8aa6..3c032756188714f68828060e693e5db96a4b5bba 100644
+index 9164ee0578686c88fc76ea3c59a7d3e50d15147d..243ac3cc41b095c4a0932c9a48f2db38c941badc 100644
 --- a/build/config/BUILDCONFIG.gn
 +++ b/build/config/BUILDCONFIG.gn
 @@ -123,6 +123,9 @@ if (current_os == "") {

+ 3 - 3
patches/chromium/build_run_reclient_cfg_generator_after_chrome.patch

@@ -20,7 +20,7 @@ index 17103061c4752e6fcac07413dbf574e0c6fd6d39..848be71fa6dc81a64b7274b31d461f9d
  /win-cross/
  reproxy.cfg
 diff --git a/buildtools/reclient_cfgs/configure_reclient_cfgs.py b/buildtools/reclient_cfgs/configure_reclient_cfgs.py
-index e367bf89e2ebabe731dcf8714ea7a0fa3b15d50d..f5cf97c51b7cc1d07ca4effb04aa6d9a3ee52845 100755
+index 128bda296c91eac5f0c2fcfeed0c553deb5514dd..f1e33d36810dba80a42608655beb27c6e197a888 100755
 --- a/buildtools/reclient_cfgs/configure_reclient_cfgs.py
 +++ b/buildtools/reclient_cfgs/configure_reclient_cfgs.py
 @@ -344,4 +344,13 @@ def main():
@@ -40,12 +40,12 @@ index e367bf89e2ebabe731dcf8714ea7a0fa3b15d50d..f5cf97c51b7cc1d07ca4effb04aa6d9a
 +    print('done')
 diff --git a/buildtools/reclient_cfgs/nacl/rewrapper_linux.cfg b/buildtools/reclient_cfgs/nacl/rewrapper_linux.cfg
 deleted file mode 100644
-index f4690257587ee8a83111abc39039c3d552da0979..0000000000000000000000000000000000000000
+index 0a0771da2d7ab44f13037c95f8b948cf9b8c663f..0000000000000000000000000000000000000000
 --- a/buildtools/reclient_cfgs/nacl/rewrapper_linux.cfg
 +++ /dev/null
 @@ -1,10 +0,0 @@
 -# use the same platform container image as build/config/siso/main.star
--platform=container-image=docker://gcr.io/chops-public-images-prod/rbe/siso-chromium/linux@sha256:912808c295e578ccde53b0685bcd0d56c15d7a03e819dcce70694bfe3fdab35e,label:action_default=1
+-platform=container-image=docker://gcr.io/chops-public-images-prod/rbe/siso-chromium/linux@sha256:ef35d347f4a4a2d32b76fd908e66e96f59bf8ba7379fd5626548244c45343b2b,label:action_default=1
 -server_address=unix:///tmp/reproxy.sock
 -labels=type=compile,compiler=nacl,lang=cpp
 -exec_strategy=racing

+ 21 - 21
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 62105d810472187a8ddb71e57873d5084e7921a7..7b91ba71aadbf44ba76dd38ea2ca69ef16e48dc8 100644
+index ea77770f7412bc4507897d6edf423966b2111eb4..88396edf058aaf6f18ae8cf09cb7175de5ae8d1c 100644
 --- a/content/browser/renderer_host/render_frame_host_impl.cc
 +++ b/content/browser/renderer_host/render_frame_host_impl.cc
-@@ -9137,6 +9137,7 @@ void RenderFrameHostImpl::CreateNewWindow(
+@@ -9244,6 +9244,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 62105d810472187a8ddb71e57873d5084e7921a7..7b91ba71aadbf44ba76dd38ea2ca69ef
            &no_javascript_access);
  
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index c87953ecbdbc1226134ae51bcb8acf3e627b6ca9..b056a3dad69316b919c058458ee9de3ad4a88147 100644
+index e131c77f42a7f5183319ff41ec57118981fe76f7..9175a4958c80451dc80205d10856cac40785140e 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -4923,6 +4923,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -4947,6 +4947,12 @@ FrameTree* WebContentsImpl::CreateNewWindow(
    SetPartitionedPopinOpenerOnNewWindowIfNeeded(new_contents_impl, params,
                                                 opener);
  
@@ -37,7 +37,7 @@ index c87953ecbdbc1226134ae51bcb8acf3e627b6ca9..b056a3dad69316b919c058458ee9de3a
    // 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
-@@ -4964,12 +4970,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -4988,12 +4994,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
      AddWebContentsDestructionObserver(new_contents_impl);
    }
  
@@ -51,10 +51,10 @@ index c87953ecbdbc1226134ae51bcb8acf3e627b6ca9..b056a3dad69316b919c058458ee9de3a
                               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 8e571dc1371cf2aa7c8354f0b4e492e0d030b485..c878169e7838849cbc23df2ed94ca65da4518f7f 100644
+index 91dcf6c9c4a2d840fb50cb329fe3ef1bba9103c3..cbc887a3034605a93468e73a310e9ca6838b32d8 100644
 --- a/content/common/frame.mojom
 +++ b/content/common/frame.mojom
-@@ -617,6 +617,10 @@ struct CreateNewWindowParams {
+@@ -621,6 +621,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 8e571dc1371cf2aa7c8354f0b4e492e0d030b485..c878169e7838849cbc23df2ed94ca65d
  
  // 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 ff59226e8f953cd7cc5e9c95250187836d64764b..5338c3a292ff3c34ab33a64341b17d0c9948f7e7 100644
+index a344bce909add234e5757ddd08d2fafa5e732a42..de3b79ada34d261ab452efd1934bb3ea4fb74c03 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
-@@ -794,6 +794,8 @@ bool ContentBrowserClient::CanCreateWindow(
+@@ -790,6 +790,8 @@ bool ContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,
@@ -79,10 +79,10 @@ index ff59226e8f953cd7cc5e9c95250187836d64764b..5338c3a292ff3c34ab33a64341b17d0c
      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 800f3314ecbdb8fe9d5ef8320ef952a3bcdf05d1..f2f7571b76542bd4c0d44750639e36b191cd5bd7 100644
+index f3cf5f2d45503b683488c3b39708057749fccdfd..87388bf398413d963a4902bfbd43e6509982fb33 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -202,6 +202,7 @@ class NetworkService;
+@@ -201,6 +201,7 @@ class NetworkService;
  class TrustedURLLoaderHeaderClient;
  }  // namespace mojom
  struct ResourceRequest;
@@ -90,7 +90,7 @@ index 800f3314ecbdb8fe9d5ef8320ef952a3bcdf05d1..f2f7571b76542bd4c0d44750639e36b1
  }  // namespace network
  
  namespace sandbox {
-@@ -1356,6 +1357,8 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -1347,6 +1348,8 @@ class CONTENT_EXPORT ContentBrowserClient {
        const std::string& frame_name,
        WindowOpenDisposition disposition,
        const blink::mojom::WindowFeatures& features,
@@ -100,7 +100,7 @@ index 800f3314ecbdb8fe9d5ef8320ef952a3bcdf05d1..f2f7571b76542bd4c0d44750639e36b1
        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 d4546ddda4a14cd5a826a13d4c8132a7fb8b5a7c..d5a7a639089ad37cb611c2ae253675b119ac357b 100644
+index 2f27fcb0b320d1dcfeb398d34770a9a48ea49915..4d2c03d7102d1217d1b436bf17fa9f293239b049 100644
 --- a/content/public/browser/web_contents_delegate.cc
 +++ b/content/public/browser/web_contents_delegate.cc
 @@ -31,6 +31,17 @@ namespace content {
@@ -122,7 +122,7 @@ index d4546ddda4a14cd5a826a13d4c8132a7fb8b5a7c..d5a7a639089ad37cb611c2ae253675b1
      WebContents* source,
      const OpenURLParams& params,
 diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
-index c0be779a4c1d89426c30261aff72ea55be900087..7413c1bef86f5e4633db7220c5de4de7fbdcc654 100644
+index 0bab4dd08a28dd572c9cac00c337672af6aee352..d17b95b6b0c9842b6db3d4696525984fbbcc8ddd 100644
 --- a/content/public/browser/web_contents_delegate.h
 +++ b/content/public/browser/web_contents_delegate.h
 @@ -18,6 +18,7 @@
@@ -133,7 +133,7 @@ index c0be779a4c1d89426c30261aff72ea55be900087..7413c1bef86f5e4633db7220c5de4de7
  #include "content/public/browser/back_forward_transition_animation_manager.h"
  #include "content/public/browser/eye_dropper.h"
  #include "content/public/browser/fullscreen_types.h"
-@@ -365,6 +366,13 @@ class CONTENT_EXPORT WebContentsDelegate {
+@@ -366,6 +367,13 @@ class CONTENT_EXPORT WebContentsDelegate {
        const StoragePartitionConfig& partition_config,
        SessionStorageNamespace* session_storage_namespace);
  
@@ -148,10 +148,10 @@ index c0be779a4c1d89426c30261aff72ea55be900087..7413c1bef86f5e4633db7220c5de4de7
    // 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 5c4be625e42065c99e327ee6b60ee241eff75ac0..4bf834dc836e4238a98c5f9db216b0054ed7add1 100644
+index 7431b6773d9f0a38f30c00fbff2fa45076beedc9..2f3190e81c665cdfbf75ffee9bf09c5936b4a760 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -6862,6 +6862,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
+@@ -6863,6 +6863,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
            request.HasUserGesture(), GetWebFrame()->IsAdFrame(),
            GetWebFrame()->IsAdScriptInStack());
  
@@ -163,10 +163,10 @@ index 5c4be625e42065c99e327ee6b60ee241eff75ac0..4bf834dc836e4238a98c5f9db216b005
    // 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 ec1790317ad4865ba6d529e8b1853d646263f92d..850cfe988b23a03b35ea0325d179753280187180 100644
+index 5d4101558a3672b747f8f62d4ffaa84416df06a7..204664c08f14bcaf45e287a18fad4aea24a7fa72 100644
 --- a/content/web_test/browser/web_test_content_browser_client.cc
 +++ b/content/web_test/browser/web_test_content_browser_client.cc
-@@ -524,6 +524,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
+@@ -523,6 +523,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,
@@ -210,10 +210,10 @@ index c576ace24e81cc877aa2595d40e0a13a7af9f6a2..210fb97d44c19c29af424cc7b9cb3169
  
  }  // 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 d0c31388d403b99874bed968a1fca3b199e3c333..a7d38e72e6704998a886afe9abc1620c0032eabc 100644
+index 3287ea39797ceca64947f9d69f6bcb6dcb8de56e..f7b31e1cfd29c2c5385b33024448d46ac8d79bd3 100644
 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc
 +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
-@@ -2235,6 +2235,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
+@@ -2226,6 +2226,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
    WebWindowFeatures window_features =
        GetWindowFeaturesFromString(features, entered_window);
  

+ 8 - 8
patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch

@@ -7,10 +7,10 @@ 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 21df259c3e596cecda15cff2c7a290e75a50d2b3..ae5ecefbb916bb503a9203ab05384aa097adbe8b 100644
+index b001362220febea5641615b4afa7174bccac50ed..0734f637faf3b693c5ae358a3eb495e630f6f54e 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
-@@ -1291,6 +1291,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
+@@ -1314,6 +1314,10 @@ void DesktopWindowTreeHostWin::HandleHeadlessWindowBoundsChanged(
    window()->SetProperty(aura::client::kHeadlessBoundsKey, bounds);
  }
  
@@ -34,11 +34,11 @@ index 1e2c5bb35cc314d44dba85a9bafc5e55bf2b5f14..d110d0a2f005888c4450262fc1887cbf
    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 9ac53e223aa095acdf90b68bc1e6bc81e3021ab9..026b0f9b404267b17e1ea6b61b5ebb188b9b0bed 100644
+index 3e7066bcdc551f1c798c75f279b57318b4bf18e4..7e8c077edaa6b55011b0f3a3df382e2b71566bf1 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -3042,15 +3042,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
-       SetMsgHandled(FALSE);
+@@ -3147,15 +3147,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
+     }
      // We must let Windows handle the caption buttons if it's drawing them, or
      // they won't work.
 +    bool simulate_mouse_event_for_caption = false;
@@ -54,11 +54,11 @@ index 9ac53e223aa095acdf90b68bc1e6bc81e3021ab9..026b0f9b404267b17e1ea6b61b5ebb18
      // Let resize events fall through. Ignore everything else, as we're either
      // letting Windows handle it above or we've already handled the equivalent
      // touch message.
--    if (!IsHitTestOnResizeHandle(hittest))
-+    if (!IsHitTestOnResizeHandle(hittest) && !simulate_mouse_event_for_caption)
+-    if (!IsHitTestOnResizeHandle(hittest)) {
++    if (!IsHitTestOnResizeHandle(hittest) && !simulate_mouse_event_for_caption) {
        return 0;
+     }
    }
- 
 diff --git a/ui/views/win/hwnd_message_handler_delegate.h b/ui/views/win/hwnd_message_handler_delegate.h
 index 04dea68d74ea4f559db60f716c919e555db9ec80..2f8bd1a3c156bb6c04663c74b7279bb59926fc3d 100644
 --- a/ui/views/win/hwnd_message_handler_delegate.h

+ 8 - 9
patches/chromium/chore_partial_revert_of.patch

@@ -14,16 +14,15 @@ track down the source of this problem & figure out if we can fix it
 by changing something in Electron.
 
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index e878d103eb79cbb67878e7c6da369d355b45ac40..e49fd4b3278b4a25af30ecc522794847440d4c50 100644
+index a81cb902e77e1246b7a1d190e89b2da02952abf9..042f69afa3192e9161264c244499b76184f53e70 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -4849,9 +4849,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
-   bool renderer_started_hidden =
-       params.disposition == WindowOpenDisposition::NEW_BACKGROUND_TAB;
- 
--  // While some guest types do not have a guest SiteInstance, the ones that
--  // don't all override WebContents creation above.
--  CHECK_EQ(source_site_instance->IsGuest(), IsGuest());
-   bool is_guest = IsGuest();
+@@ -4866,7 +4866,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+           : IsGuest();
+   // While some guest types do not have a guest SiteInstance, the ones that
+   // don't all override WebContents creation above.
+-  CHECK_EQ(source_site_instance->IsGuest(), is_guest);
++  // CHECK_EQ(source_site_instance->IsGuest(), is_guest);
  
    // We usually create the new window in the same BrowsingInstance (group of
+   // script-related windows), by passing in the current SiteInstance.  However,

+ 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 2038d122a4e1f73a1f7cd5acf8625759d7cf5de6..bca8f9cf2a730c41580e84764146b1e771240795 100644
+index 55bcf6db1cac9b1dbcf5adb7d0dc3b92b4d9f446..aa951954c6a97e5055b091ff15a2384f89d485b2 100644
 --- a/content/browser/site_instance_impl.cc
 +++ b/content/browser/site_instance_impl.cc
-@@ -213,7 +213,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);

+ 35 - 35
patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch

@@ -35,7 +35,7 @@ index 2fa0d6e1be27cc429e4a0237b5bfafa7aaa06c56..3decb327b10e3cd3edc1765491a7eb60
        content::RenderFrameHost* requesting_frame,
        const blink::mojom::FullscreenOptions& options) final;
 diff --git a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
-index 28cd699814f32a7a569d63936b9544567a66d9c4..fd461fa448d983481dc4c0c7d03b1945a7a13c46 100644
+index a0c24e09a5dffa8be119309738abe57e82ef76b3..3e362f622b72d7cb97a838e71014b035c47728c0 100644
 --- a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
 +++ b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc
 @@ -79,8 +79,7 @@ class ChromeKeyboardContentsDelegate : public content::WebContentsDelegate,
@@ -49,10 +49,10 @@ index 28cd699814f32a7a569d63936b9544567a66d9c4..fd461fa448d983481dc4c0c7d03b1945
    }
  
 diff --git a/chrome/browser/ui/ash/web_view/ash_web_view_impl.cc b/chrome/browser/ui/ash/web_view/ash_web_view_impl.cc
-index 05fa4a72491658b542804912b0509089b9604e20..1304ed22fe3d1ae080cff3d085567c3d873daf51 100644
+index 44be6359d6a7acf88072569d8d4f85c688f5ed81..ee377313b25e13c011b1ed4aa31ea059f020a5b7 100644
 --- a/chrome/browser/ui/ash/web_view/ash_web_view_impl.cc
 +++ b/chrome/browser/ui/ash/web_view/ash_web_view_impl.cc
-@@ -118,10 +118,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
+@@ -120,10 +120,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -66,7 +66,7 @@ index 05fa4a72491658b542804912b0509089b9604e20..1304ed22fe3d1ae080cff3d085567c3d
                                  /*from_user_gesture=*/true);
      return true;
 diff --git a/chrome/browser/ui/ash/web_view/ash_web_view_impl.h b/chrome/browser/ui/ash/web_view/ash_web_view_impl.h
-index b078a4a06c7b3f767e2e01f0bef2ba440f729620..0459568581a3073333ae6afabd3680f25b9196e4 100644
+index 4fd8dff1089cd6afa6a66dc185734d7671657281..0a1f4268ea771a3d5d4a2668928c6e5d1b618c68 100644
 --- a/chrome/browser/ui/ash/web_view/ash_web_view_impl.h
 +++ b/chrome/browser/ui/ash/web_view/ash_web_view_impl.h
 @@ -59,8 +59,7 @@ class AshWebViewImpl : public ash::AshWebView,
@@ -80,10 +80,10 @@ index b078a4a06c7b3f767e2e01f0bef2ba440f729620..0459568581a3073333ae6afabd3680f2
        content::WebContents* source,
        const content::OpenURLParams& params,
 diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
-index a62c82aab7a350c01c7b4288977895c4f9bb9c56..bc0f6ac675b93992bd017acbd4c9919552cdd401 100644
+index e0582db3e8e88bbafeeb9f1aa9bd0bbbeb265a17..a485afdd0283983b6e9de67ebdcbc0ec321b1146 100644
 --- a/chrome/browser/ui/browser.cc
 +++ b/chrome/browser/ui/browser.cc
-@@ -2176,12 +2176,11 @@ bool Browser::IsWebContentsCreationOverridden(
+@@ -2212,12 +2212,11 @@ bool Browser::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -99,10 +99,10 @@ index a62c82aab7a350c01c7b4288977895c4f9bb9c56..bc0f6ac675b93992bd017acbd4c99195
  
  WebContents* Browser::CreateCustomWebContents(
 diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
-index 1455dcab97edbd2b2b63401643aa288ed08dd52e..20e411aad535f892d903beb022b248b3a0b184e3 100644
+index 0ee8fee2166f023f1fedc5ea9733ed2d37acd8d1..0743620d722d48caba2a1f4ac91d353169049239 100644
 --- a/chrome/browser/ui/browser.h
 +++ b/chrome/browser/ui/browser.h
-@@ -978,8 +978,7 @@ class Browser : public TabStripModelObserver,
+@@ -976,8 +976,7 @@ class Browser : public TabStripModelObserver,
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -113,10 +113,10 @@ index 1455dcab97edbd2b2b63401643aa288ed08dd52e..20e411aad535f892d903beb022b248b3
        content::RenderFrameHost* opener,
        content::SiteInstance* source_site_instance,
 diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
-index 58506f1c2e9e20c77cd26172e6b52e71ffb8e515..052c00d29e3f517440e28f56cf61fd33655e2804 100644
+index 0d2a68ea6b9f08b5c1f1113181b08d55a3265192..0dfa27fa14d1308c059534953e190922ddb3bc0a 100644
 --- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
 +++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.cc
-@@ -203,8 +203,7 @@ bool PresentationReceiverWindowController::IsWebContentsCreationOverridden(
+@@ -205,8 +205,7 @@ bool PresentationReceiverWindowController::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -141,7 +141,7 @@ index ca72b324bf7c3b81ac94b53f0ff454d2df177950..d60ef3075d126e2bbd50c8469f2bf67c
    // The profile used for the presentation.
    raw_ptr<Profile, DanglingUntriaged> otr_profile_;
 diff --git a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
-index 8622cff1530c63414eea23687500b1a61746beb8..9288b232e73f9133004573b0d242872bbe7c4890 100644
+index 6da0f39ea7990ed96e9c8148b034cd591ffdf7f1..4ade4aaa36e4e1b3588bdb146f787dd14d9b9e33 100644
 --- a/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
 +++ b/chrome/browser/ui/views/hats/hats_next_web_dialog.cc
 @@ -96,8 +96,7 @@ class HatsNextWebDialog::HatsWebView : public views::WebView {
@@ -218,11 +218,11 @@ index c6838c83ef971b88769b1f3fba8095025ae25464..2da6a4e08340e72ba7de5d03444c2f17
    content::WebContents* AddNewContents(
        content::WebContents* source,
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 0b70b695a4d3990842f9c5909ef485b540d9be58..f0d92a18c0cdefd437086695e122c81ca9293ce5 100644
+index 5d2cd8a69d78c81b7f1cd34e23e790aff79215a6..63b26168c5fecbd71d11e2fe377bd6a2fa4a7a5e 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -4818,8 +4818,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
- 
+@@ -4829,8 +4829,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+   // TODO(crbug.com/40202416): Support a way for MPArch guests to support this.
    if (delegate_ && delegate_->IsWebContentsCreationOverridden(
                         source_site_instance, params.window_container_type,
 -                       opener->GetLastCommittedURL(), params.frame_name,
@@ -232,7 +232,7 @@ index 0b70b695a4d3990842f9c5909ef485b540d9be58..f0d92a18c0cdefd437086695e122c81c
          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 d5a7a639089ad37cb611c2ae253675b119ac357b..fca239fa24512aed69c420dcdc99be9b161f54d9 100644
+index 4d2c03d7102d1217d1b436bf17fa9f293239b049..a9849b1b799d0d017050ce56ee9bdbd239324c0b 100644
 --- a/content/public/browser/web_contents_delegate.cc
 +++ b/content/public/browser/web_contents_delegate.cc
 @@ -152,8 +152,7 @@ bool WebContentsDelegate::IsWebContentsCreationOverridden(
@@ -246,10 +246,10 @@ index d5a7a639089ad37cb611c2ae253675b119ac357b..fca239fa24512aed69c420dcdc99be9b
  }
  
 diff --git a/content/public/browser/web_contents_delegate.h b/content/public/browser/web_contents_delegate.h
-index 7413c1bef86f5e4633db7220c5de4de7fbdcc654..0d649bcd408eb02968acd9e479b4d3e78ad639b4 100644
+index d17b95b6b0c9842b6db3d4696525984fbbcc8ddd..344d6d20dfbbe90c128885c701274b1c3cfd3ac0 100644
 --- a/content/public/browser/web_contents_delegate.h
 +++ b/content/public/browser/web_contents_delegate.h
-@@ -344,8 +344,7 @@ class CONTENT_EXPORT WebContentsDelegate {
+@@ -345,8 +345,7 @@ class CONTENT_EXPORT WebContentsDelegate {
        SiteInstance* source_site_instance,
        mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -260,7 +260,7 @@ index 7413c1bef86f5e4633db7220c5de4de7fbdcc654..0d649bcd408eb02968acd9e479b4d3e7
    // Allow delegate to creates a custom WebContents when
    // WebContents::CreateNewWindow() is called. This function is only called
 diff --git a/extensions/browser/guest_view/app_view/app_view_guest.cc b/extensions/browser/guest_view/app_view/app_view_guest.cc
-index 05441db095b801f0dc625d16f901c8ea8306c7ba..d0bb3a13b8d3ac7e032c721aed92129081e6c165 100644
+index f8b00fec3f2786822b22c052051c524f766c059d..85a535d0b1e49619fec8c9f5c67896204c9fb164 100644
 --- a/extensions/browser/guest_view/app_view/app_view_guest.cc
 +++ b/extensions/browser/guest_view/app_view/app_view_guest.cc
 @@ -153,8 +153,7 @@ bool AppViewGuest::IsWebContentsCreationOverridden(
@@ -274,7 +274,7 @@ index 05441db095b801f0dc625d16f901c8ea8306c7ba..d0bb3a13b8d3ac7e032c721aed921290
  
    return true;
 diff --git a/extensions/browser/guest_view/app_view/app_view_guest.h b/extensions/browser/guest_view/app_view/app_view_guest.h
-index 78dcd52ef5f26094af8619d4a3a5776fab2b6a8f..a7b76de2a2d9445e8e05ee6050a6960ef6db183d 100644
+index 136448c9df06b9704e95d2797a60907d7ec5170a..21cc7b08dd8f9e4a32d29dd35c42ec2ce9f6cd53 100644
 --- a/extensions/browser/guest_view/app_view/app_view_guest.h
 +++ b/extensions/browser/guest_view/app_view/app_view_guest.h
 @@ -10,6 +10,7 @@
@@ -285,7 +285,7 @@ index 78dcd52ef5f26094af8619d4a3a5776fab2b6a8f..a7b76de2a2d9445e8e05ee6050a6960e
  #include "extensions/browser/guest_view/app_view/app_view_guest_delegate.h"
  #include "extensions/browser/lazy_context_task_queue.h"
  
-@@ -77,8 +78,7 @@ class AppViewGuest : public guest_view::GuestView<AppViewGuest> {
+@@ -79,8 +80,7 @@ class AppViewGuest : public guest_view::GuestView<AppViewGuest> {
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -296,10 +296,10 @@ index 78dcd52ef5f26094af8619d4a3a5776fab2b6a8f..a7b76de2a2d9445e8e05ee6050a6960e
        content::RenderFrameHost* opener,
        content::SiteInstance* source_site_instance,
 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 444592ac14ecd84a9408c30bfb967d12c4875b67..1582e8ad928cffbaad9ed6cbd864981d0fc4b606 100644
+index 76061d1c9653f7c910367f11dca0d509503c92d9..f257ff4f7e118de3e798830b64759f4c2b765e7e 100644
 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.cc
 +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.cc
-@@ -249,8 +249,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
+@@ -259,8 +259,7 @@ bool ExtensionOptionsGuest::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -310,10 +310,10 @@ index 444592ac14ecd84a9408c30bfb967d12c4875b67..1582e8ad928cffbaad9ed6cbd864981d
  
    // This method handles opening links from within the guest. Since this guest
 diff --git a/extensions/browser/guest_view/extension_options/extension_options_guest.h b/extensions/browser/guest_view/extension_options/extension_options_guest.h
-index 8df60108aeaabcb5fa6634e6a5e87d67d6b30e90..88a52eae92eb9b105c41b8d467cc7cd0c83a355b 100644
+index 440ffda9213d4bea845f7b48550b34b87ae1ca98..0fc59e6af11c3f0ba425e3df428bf69be1b82992 100644
 --- a/extensions/browser/guest_view/extension_options/extension_options_guest.h
 +++ b/extensions/browser/guest_view/extension_options/extension_options_guest.h
-@@ -70,8 +70,7 @@ class ExtensionOptionsGuest
+@@ -72,8 +72,7 @@ class ExtensionOptionsGuest
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -324,10 +324,10 @@ index 8df60108aeaabcb5fa6634e6a5e87d67d6b30e90..88a52eae92eb9b105c41b8d467cc7cd0
        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 ccaf9eee37f6f663761839111d2233c6c934b84b..2a5459b31d15c14cd329c96679703a8e93102515 100644
+index 4cd72afe01d78f4abb152c1031071e3a08ecc79e..07015078ff94cd799f14a460da25a3e392f02dfd 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
-@@ -449,8 +449,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
+@@ -450,8 +450,7 @@ bool MimeHandlerViewGuest::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -338,10 +338,10 @@ index ccaf9eee37f6f663761839111d2233c6c934b84b..2a5459b31d15c14cd329c96679703a8e
  
    return true;
 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 f08e2017a9737167e149962e13c0e049777b295a..36c962ef5b81e1331c753d7e5a16096695105fc9 100644
+index 2dcf51f335f5dac39f431c3e0f56f8789f33d40b..2b433624d0604e0b9da5117b9e83cc1559b74740 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
-@@ -185,8 +185,7 @@ class MimeHandlerViewGuest
+@@ -186,8 +186,7 @@ class MimeHandlerViewGuest
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -352,7 +352,7 @@ index f08e2017a9737167e149962e13c0e049777b295a..36c962ef5b81e1331c753d7e5a160966
        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 6668c3ec029dcb0d253492780c1cef70ae7f1ab7..80f9b3a55d7456d2f169c416cea4ac28db841ee3 100644
+index 635050eedc20fb89608677bcebeb5f8187bd4b59..1220f377169f8209db39654b7ddbf1da52c017b7 100644
 --- a/fuchsia_web/webengine/browser/frame_impl.cc
 +++ b/fuchsia_web/webengine/browser/frame_impl.cc
 @@ -575,8 +575,7 @@ bool FrameImpl::IsWebContentsCreationOverridden(
@@ -380,10 +380,10 @@ index 1012a909ef1fcae51c218ae519fe7e0db65ab087..127b1ae940bc9313aecb635e2b01bb6f
                            int opener_render_process_id,
                            int opener_render_frame_id,
 diff --git a/headless/lib/browser/headless_web_contents_impl.cc b/headless/lib/browser/headless_web_contents_impl.cc
-index d3623f93527244f6672242eb9b239b827a651035..05ea2df28e5e65937458e4c6cf0a04e16fa2dc80 100644
+index 80eb312c32282da8e2096eab148996545836d442..963726b218209ef5a9f4ad2e77b6ff00bd29c1d5 100644
 --- a/headless/lib/browser/headless_web_contents_impl.cc
 +++ b/headless/lib/browser/headless_web_contents_impl.cc
-@@ -206,8 +206,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
+@@ -207,8 +207,7 @@ class HeadlessWebContentsImpl::Delegate : public content::WebContentsDelegate {
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -394,19 +394,19 @@ index d3623f93527244f6672242eb9b239b827a651035..05ea2df28e5e65937458e4c6cf0a04e1
          ->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 1a3b4a9408d8dd72ae704b3f48924d56132fe173..2a96dec82efbdbe4fb5fcd714b63b4d9baec2c42 100644
+index d51816a633efee5aca5a5b7a0135bd331d604c14..0c0c937020ef486e6bfbeaa52cb2643a093d206a 100644
 --- a/ui/views/controls/webview/web_dialog_view.cc
 +++ b/ui/views/controls/webview/web_dialog_view.cc
-@@ -456,8 +456,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
+@@ -487,8 +487,7 @@ bool WebDialogView::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
 -    const std::string& frame_name,
 -    const GURL& target_url) {
 +    const content::mojom::CreateNewWindowParams& params) {
-   if (delegate_)
+   if (delegate_) {
      return delegate_->HandleShouldOverrideWebContentsCreation();
-   return false;
+   }
 diff --git a/ui/views/controls/webview/web_dialog_view.h b/ui/views/controls/webview/web_dialog_view.h
 index c96aeb2571961fa2ad033ca38600006e0e657699..2c733734103bf2cc0af9bcfb32d753053a287775 100644
 --- a/ui/views/controls/webview/web_dialog_view.h

+ 1 - 1
patches/chromium/chore_remove_check_is_test_on_script_injection_tracker.patch

@@ -9,7 +9,7 @@ Electron when a session is non persistent we do not initialize the
 ExtensionSystem, so this check is not relevant for Electron.
 
 diff --git a/extensions/browser/script_injection_tracker.cc b/extensions/browser/script_injection_tracker.cc
-index 64c8c5c155a640fcd6cc4152f345d12c597226ae..62c210722407948b307db6bee73bb9b03f190195 100644
+index 029db451e142508e00e54e140f20a31b473a8972..26dd090e5266611ced7c97ba85d7f4f8045b5184 100644
 --- a/extensions/browser/script_injection_tracker.cc
 +++ b/extensions/browser/script_injection_tracker.cc
 @@ -174,7 +174,6 @@ std::vector<const UserScript*> GetLoadedDynamicScripts(

+ 55 - 55
patches/chromium/command-ismediakey.patch

@@ -10,11 +10,39 @@ Also apply electron/electron@0f67b1866a9f00b852370e721affa4efda623f3a
 and electron/electron@d2368d2d3b3de9eec4cc32b6aaf035cc89921bf1 as
 patches.
 
-diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.cc b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
-index b1c2751f6a6074f8876303a24fb716280cd794bb..37c86f81985a5522399e27d93f9b970b248cb082 100644
---- a/chrome/browser/extensions/global_shortcut_listener_ozone.cc
-+++ b/chrome/browser/extensions/global_shortcut_listener_ozone.cc
-@@ -97,7 +97,8 @@ bool GlobalShortcutListenerOzone::RegisterAcceleratorImpl(
+diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
+index e87c180342b967756efeb701c73207fcee8754f1..42e37564e585987d367921568f0f1d2b7507f953 100644
+--- a/content/browser/media/media_keys_listener_manager_impl.cc
++++ b/content/browser/media/media_keys_listener_manager_impl.cc
+@@ -412,6 +412,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
+         case ui::VKEY_MEDIA_STOP:
+           browser_system_media_controls_->SetIsStopEnabled(should_enable);
+           break;
++        case ui::VKEY_VOLUME_DOWN:
++        case ui::VKEY_VOLUME_UP:
++        case ui::VKEY_VOLUME_MUTE:
++          // Do nothing.
++          break;
+         default:
+           NOTREACHED();
+       }
+@@ -454,6 +459,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
+         case ui::VKEY_MEDIA_STOP:
+           smc->SetIsStopEnabled(should_enable);
+           break;
++        case ui::VKEY_VOLUME_DOWN:
++        case ui::VKEY_VOLUME_UP:
++        case ui::VKEY_VOLUME_MUTE:
++          // Do nothing.
++          break;
+         default:
+           NOTREACHED();
+       }
+diff --git a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc
+index 443649912a86377d2dbe8d09cd651cb2b5a9a134..444794822b466fd99b4e55b4d022ab9d05e42f05 100644
+--- a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc
++++ b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.cc
+@@ -86,7 +86,8 @@ bool GlobalAcceleratorListenerOzone::StartListeningForAccelerator(
    const bool registered =
        platform_global_shortcut_listener_->RegisterAccelerator(
            accelerator.key_code(), accelerator.IsAltDown(),
@@ -24,7 +52,7 @@ index b1c2751f6a6074f8876303a24fb716280cd794bb..37c86f81985a5522399e27d93f9b970b
    if (registered) {
      registered_hot_keys_.insert(accelerator);
    }
-@@ -112,14 +113,15 @@ void GlobalShortcutListenerOzone::UnregisterAcceleratorImpl(
+@@ -101,14 +102,15 @@ void GlobalAcceleratorListenerOzone::StopListeningForAccelerator(
  
    platform_global_shortcut_listener_->UnregisterAccelerator(
        accelerator.key_code(), accelerator.IsAltDown(), accelerator.IsCtrlDown(),
@@ -33,16 +61,16 @@ index b1c2751f6a6074f8876303a24fb716280cd794bb..37c86f81985a5522399e27d93f9b970b
    registered_hot_keys_.erase(accelerator);
  }
  
- void GlobalShortcutListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
-                                                bool is_alt_down,
-                                                bool is_ctrl_down,
--                                               bool is_shift_down) {
-+                                               bool is_shift_down,
-+                                               bool is_cmd_down) {
+ void GlobalAcceleratorListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
+                                                   bool is_alt_down,
+                                                   bool is_ctrl_down,
+-                                                  bool is_shift_down) {
++                                                  bool is_shift_down,
++                                                  bool is_cmd_down) {
    int modifiers = 0;
    if (is_alt_down) {
      modifiers |= ui::EF_ALT_DOWN;
-@@ -130,6 +132,9 @@ void GlobalShortcutListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
+@@ -119,6 +121,9 @@ void GlobalAcceleratorListenerOzone::OnKeyPressed(ui::KeyboardCode key_code,
    if (is_shift_down) {
      modifiers |= ui::EF_SHIFT_DOWN;
    }
@@ -52,11 +80,11 @@ index b1c2751f6a6074f8876303a24fb716280cd794bb..37c86f81985a5522399e27d93f9b970b
  
    NotifyKeyPressed(ui::Accelerator(key_code, modifiers));
  }
-diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.h b/chrome/browser/extensions/global_shortcut_listener_ozone.h
-index 90abe5d0bfa1ca0f541e42cb281b7b6385fc098e..4f3fa5107534cdeff2b416f9c2f833db97912b72 100644
---- a/chrome/browser/extensions/global_shortcut_listener_ozone.h
-+++ b/chrome/browser/extensions/global_shortcut_listener_ozone.h
-@@ -52,7 +52,8 @@ class GlobalShortcutListenerOzone
+diff --git a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.h b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.h
+index 9e63dd9d33abc89a7bbef75992925356470ebb26..9071afc9bb01db832164909a202effafff15a1db 100644
+--- a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.h
++++ b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_ozone.h
+@@ -54,7 +54,8 @@ class GlobalAcceleratorListenerOzone
    void OnKeyPressed(ui::KeyboardCode key_code,
                      bool is_alt_down,
                      bool is_ctrl_down,
@@ -66,55 +94,27 @@ index 90abe5d0bfa1ca0f541e42cb281b7b6385fc098e..4f3fa5107534cdeff2b416f9c2f833db
    void OnPlatformListenerDestroyed() override;
  
    bool is_listening_ = false;
-diff --git a/chrome/browser/extensions/global_shortcut_listener_win.cc b/chrome/browser/extensions/global_shortcut_listener_win.cc
-index 687727ed2ddaf09a0d401706d214ebcf096998ea..8e52938dcc6d5f5c4d521e3e6b7d3addc40ac993 100644
---- a/chrome/browser/extensions/global_shortcut_listener_win.cc
-+++ b/chrome/browser/extensions/global_shortcut_listener_win.cc
-@@ -63,6 +63,8 @@ void GlobalShortcutListenerWin::OnWndProc(HWND hwnd,
+diff --git a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_win.cc b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_win.cc
+index 034ccea0cda4265abbfc889178f4cba4f3bd7eb8..384f0968aca07cde1fe6434a318e5334f6ecbe9e 100644
+--- a/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_win.cc
++++ b/ui/base/accelerators/global_accelerator_listener/global_accelerator_listener_win.cc
+@@ -67,6 +67,8 @@ void GlobalAcceleratorListenerWin::OnWndProc(HWND hwnd,
    modifiers |= (LOWORD(lparam) & MOD_SHIFT) ? ui::EF_SHIFT_DOWN : 0;
    modifiers |= (LOWORD(lparam) & MOD_ALT) ? ui::EF_ALT_DOWN : 0;
    modifiers |= (LOWORD(lparam) & MOD_CONTROL) ? ui::EF_CONTROL_DOWN : 0;
 +  modifiers |= (LOWORD(lparam) & MOD_WIN) ? ui::EF_COMMAND_DOWN : 0;
 +
-   ui::Accelerator accelerator(
-       ui::KeyboardCodeForWindowsKeyCode(key_code), modifiers);
+   ui::Accelerator accelerator(ui::KeyboardCodeForWindowsKeyCode(key_code),
+                               modifiers);
  
-@@ -93,6 +95,7 @@ bool GlobalShortcutListenerWin::RegisterAcceleratorImpl(
+@@ -97,6 +99,7 @@ bool GlobalAcceleratorListenerWin::StartListeningForAccelerator(
    modifiers |= accelerator.IsShiftDown() ? MOD_SHIFT : 0;
    modifiers |= accelerator.IsCtrlDown() ? MOD_CONTROL : 0;
    modifiers |= accelerator.IsAltDown() ? MOD_ALT : 0;
 +  modifiers |= accelerator.IsCmdDown() ? MOD_WIN : 0;
  
-   // Create an observer that registers a hot key for |accelerator|.
+   // Create an observer that registers a hot key for `accelerator`.
    std::unique_ptr<gfx::SingletonHwndHotKeyObserver> observer =
-diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
-index 0f09c6de2a74d4b603862f0962c03dbe6903ea20..b329df28207430ccdaf889b672bcd3d875faad18 100644
---- a/content/browser/media/media_keys_listener_manager_impl.cc
-+++ b/content/browser/media/media_keys_listener_manager_impl.cc
-@@ -413,6 +413,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
-         case ui::VKEY_MEDIA_STOP:
-           browser_system_media_controls_->SetIsStopEnabled(should_enable);
-           break;
-+        case ui::VKEY_VOLUME_DOWN:
-+        case ui::VKEY_VOLUME_UP:
-+        case ui::VKEY_VOLUME_MUTE:
-+          // Do nothing.
-+          break;
-         default:
-           NOTREACHED();
-       }
-@@ -455,6 +460,11 @@ void MediaKeysListenerManagerImpl::UpdateSystemMediaControlsEnabledControls() {
-         case ui::VKEY_MEDIA_STOP:
-           smc->SetIsStopEnabled(should_enable);
-           break;
-+        case ui::VKEY_VOLUME_DOWN:
-+        case ui::VKEY_VOLUME_UP:
-+        case ui::VKEY_VOLUME_MUTE:
-+          // Do nothing.
-+          break;
-         default:
-           NOTREACHED();
-       }
 diff --git a/ui/base/accelerators/media_keys_listener.cc b/ui/base/accelerators/media_keys_listener.cc
 index db596585cbb44b3710636e3fc013f288966f604f..6d5557ee1a2c35ee15e695e024834184a525e2a7 100644
 --- a/ui/base/accelerators/media_keys_listener.cc

+ 3 - 3
patches/chromium/crash_allow_setting_more_options.patch

@@ -63,10 +63,10 @@ index 7c890b331be4aaaf20c7efe8a4bcc2f6e9012b7a..c573524d05c07ec67d35046bc8548cc1
    // Used by WebView to sample crashes without generating the unwanted dumps. If
    // the returned value is less than 100, crash dumping will be sampled to that
 diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc
-index aff834c0a93716f769c24bcea7d9f6ed15761040..c29311266678522cfb992cc2b3fa0a0158731a36 100644
+index 5d9b3bd5386ecbdb74cc470dbe65308c3afa0a61..dc29a4bedc0533e27affb26367cfcc2c3f9544f3 100644
 --- a/components/crash/core/app/crashpad_linux.cc
 +++ b/components/crash/core/app/crashpad_linux.cc
-@@ -230,6 +230,7 @@ bool PlatformCrashpadInitialization(
+@@ -218,6 +218,7 @@ bool PlatformCrashpadInitialization(
      // where crash_reporter provides it's own values for lsb-release.
      annotations["lsb-release"] = base::GetLinuxDistro();
  #endif
@@ -74,7 +74,7 @@ index aff834c0a93716f769c24bcea7d9f6ed15761040..c29311266678522cfb992cc2b3fa0a01
  
      std::vector<std::string> arguments;
      if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) {
-@@ -251,6 +252,13 @@ bool PlatformCrashpadInitialization(
+@@ -239,6 +240,13 @@ bool PlatformCrashpadInitialization(
      }
  #endif
  

+ 7 - 7
patches/chromium/create_browser_v8_snapshot_file_name_fuse.patch

@@ -7,10 +7,10 @@ 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 2ea73bf0f0e16ad01e547bb0ec8082ddd02286c2..1ce0ff532976d5d2ac61d6ae14699d5c12c8d490 100644
+index 9078848b53976b7f63bb08140da942d66bd424ca..e86fd93edb33194836253d5b147ed863bfd660bc 100644
 --- a/content/app/content_main_runner_impl.cc
 +++ b/content/app/content_main_runner_impl.cc
-@@ -280,8 +280,13 @@ void AsanProcessInfoCB(const char*, bool*) {
+@@ -273,8 +273,13 @@ void AsanProcessInfoCB(const char*, bool*) {
  }
  #endif  // defined(ADDRESS_SANITIZER)
  
@@ -25,7 +25,7 @@ index 2ea73bf0f0e16ad01e547bb0ec8082ddd02286c2..1ce0ff532976d5d2ac61d6ae14699d5c
  #if BUILDFLAG(IS_POSIX) && !BUILDFLAG(IS_MAC)
    base::FileDescriptorStore& file_descriptor_store =
        base::FileDescriptorStore::GetInstance();
-@@ -310,11 +315,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
+@@ -303,11 +308,12 @@ bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
  
  #endif  // V8_USE_EXTERNAL_STARTUP_DATA
  
@@ -40,7 +40,7 @@ index 2ea73bf0f0e16ad01e547bb0ec8082ddd02286c2..1ce0ff532976d5d2ac61d6ae14699d5c
  #endif  // V8_USE_EXTERNAL_STARTUP_DATA
  }
  
-@@ -990,7 +996,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
+@@ -973,7 +979,7 @@ int ContentMainRunnerImpl::Initialize(ContentMainParams params) {
      return TerminateForFatalInitializationError();
  #endif  // BUILDFLAG(IS_ANDROID) && (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE)
  
@@ -50,7 +50,7 @@ index 2ea73bf0f0e16ad01e547bb0ec8082ddd02286c2..1ce0ff532976d5d2ac61d6ae14699d5c
    blink::TrialTokenValidator::SetOriginTrialPolicyGetter(
        base::BindRepeating([]() -> blink::OriginTrialPolicy* {
 diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
-index b97149f792666bc5b4f180a1d544f4455e44456f..4dfdff22ec6f74b9ac034beac2fada861de9c8b3 100644
+index 8194fc8b036482eedb162ff92bb82165cdf3c8d0..f038620516d7783170bc82b3b14dde4e01f3975d 100644
 --- a/content/public/app/content_main_delegate.cc
 +++ b/content/public/app/content_main_delegate.cc
 @@ -4,6 +4,8 @@
@@ -62,7 +62,7 @@ index b97149f792666bc5b4f180a1d544f4455e44456f..4dfdff22ec6f74b9ac034beac2fada86
  #include "base/check.h"
  #include "base/notreached.h"
  #include "build/build_config.h"
-@@ -91,6 +93,10 @@ std::optional<int> ContentMainDelegate::PostEarlyInitialization(
+@@ -72,6 +74,10 @@ std::optional<int> ContentMainDelegate::PostEarlyInitialization(
    return std::nullopt;
  }
  
@@ -95,7 +95,7 @@ index 801bfd401ea4a8e72417d88efaa718cc6fb60883..663fec68d0c2855cdf83bb259b85c229
    friend class ContentClientCreator;
    friend class ContentClientInitializer;
 diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
-index ea22d21b80de2ffb99809df3abd7c0fa1a098481..4b3699bce4afc49acbdc2749aa70e69bf54d97b6 100644
+index 587dcfb97712aa6422ac01625a81e6c59c84ac2f..4382dbab379f2cf9207b0372c7253da972924553 100644
 --- a/gin/v8_initializer.cc
 +++ b/gin/v8_initializer.cc
 @@ -653,8 +653,7 @@ void V8Initializer::GetV8ExternalSnapshotData(const char** snapshot_data_out,

+ 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 8127b7951b2070d49ee99cd93199454355ab925d..2056a3408e6449920d77a9c1659d2732e736e429 100644
+index 978bf926bdd1241181bd7c037bff633be4a311c9..447f0598cd443510af44f64208449e6088bb1118 100644
 --- a/content/browser/service_worker/service_worker_context_wrapper.cc
 +++ b/content/browser/service_worker/service_worker_context_wrapper.cc
-@@ -1959,6 +1959,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
+@@ -1964,6 +1964,26 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
        loader_factory_bundle_info =
            context()->loader_factory_bundle_for_update_check()->Clone();
  
@@ -38,7 +38,7 @@ index 8127b7951b2070d49ee99cd93199454355ab925d..2056a3408e6449920d77a9c1659d2732
    if (auto* config = content::WebUIConfigMap::GetInstance().GetConfig(
            browser_context(), scope)) {
      // If this is a Service Worker for a WebUI, the WebUI's URLDataSource
-@@ -1978,9 +1998,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
+@@ -1983,9 +2003,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
              features::kEnableServiceWorkersForChromeScheme) &&
          scope.scheme_piece() == kChromeUIScheme) {
        config->RegisterURLDataSource(browser_context());
@@ -49,7 +49,7 @@ index 8127b7951b2070d49ee99cd93199454355ab925d..2056a3408e6449920d77a9c1659d2732
            .emplace(kChromeUIScheme, CreateWebUIServiceWorkerLoaderFactory(
                                          browser_context(), kChromeUIScheme,
                                          base::flat_set<std::string>()));
-@@ -1988,9 +2006,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
+@@ -1993,9 +2011,7 @@ ServiceWorkerContextWrapper::GetLoaderFactoryForBrowserInitiatedRequest(
                     features::kEnableServiceWorkersForChromeUntrusted) &&
                 scope.scheme_piece() == kChromeUIUntrustedScheme) {
        config->RegisterURLDataSource(browser_context());

+ 1 - 1
patches/chromium/disable_compositor_recycling.patch

@@ -6,7 +6,7 @@ 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 e305d25a8f2a34ac90f4d503a9c74dcc6c553cdf..17625e389a23b8620853e66b8e0edd69d561d9a2 100644
+index 2d06056f1e51ce76398168254152ccc04e596192..a04743ae7626d332b5cf21adad96b4f7e88ab5d3 100644
 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
 +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
 @@ -559,7 +559,11 @@

+ 6 - 6
patches/chromium/disable_hidden.patch

@@ -6,10 +6,10 @@ 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 74f2e51c7fa802e7afb30f4de8489efd7f081709..9af5efcacb38453d3f92a3c2d9a42ad8817ef6d5 100644
+index 7ba8c01db7e9383c27c37cd130f094a0ccab6f9a..6dac8bda9b799b2d20f7fa45d7323204b28631e1 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
-@@ -793,6 +793,10 @@ void RenderWidgetHostImpl::WasHidden() {
+@@ -816,6 +816,10 @@ void RenderWidgetHostImpl::WasHidden() {
      return;
    }
  
@@ -21,10 +21,10 @@ index 74f2e51c7fa802e7afb30f4de8489efd7f081709..9af5efcacb38453d3f92a3c2d9a42ad8
    // Prompts should remain open and functional across tab switches.
    if (!delegate_->IsWaitingForPointerLockPrompt(this)) {
 diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
-index ddfae2b85cb8823eeba88050d5378bfbbe133ab3..fa0a2cfe2cfeceab692bfe9d94d80192115dd8f8 100644
+index 56670ed68f85f671c7eeedbc8ba2367f07163733..51cc0c83c48425f3cb49e44df4bd318f1767d03f 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.h
 +++ b/content/browser/renderer_host/render_widget_host_impl.h
-@@ -1024,6 +1024,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
+@@ -1026,6 +1026,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
    // Requests a commit and forced redraw in the renderer compositor.
    void ForceRedrawForTesting();
  
@@ -35,10 +35,10 @@ index ddfae2b85cb8823eeba88050d5378bfbbe133ab3..fa0a2cfe2cfeceab692bfe9d94d80192
    // |routing_id| must not be MSG_ROUTING_NONE.
    // If this object outlives |delegate|, DetachDelegate() must be called when
 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 9b258cb5dcbd07828722700f0c1cd9cbe0679056..0686fa205c43b70e6125502f8a9e76492ddafb5e 100644
+index 06686841d7394d68ff5b4845ace2c2c4d689df4b..e65c2b9ed1d6d3cc53ee5ba145aa22cb149d9dde 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
-@@ -650,7 +650,7 @@ void RenderWidgetHostViewAura::HideImpl() {
+@@ -643,7 +643,7 @@ void RenderWidgetHostViewAura::HideImpl() {
    CHECK(visibility_ == Visibility::HIDDEN ||
          visibility_ == Visibility::OCCLUDED);
  

+ 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 1dc14ea5d899cc17756911820ede80a4fa22df1d..f6160979def6f553e0e601e14830c498f05e52b1 100644
+index bc6d0baeba151467d0cb24df1df818ac53d4f8f4..f8f6fe3488e6d1fe4ca97b8aed13e5e5c70ebb3d 100644
 --- a/content/browser/renderer_host/navigator.cc
 +++ b/content/browser/renderer_host/navigator.cc
-@@ -1448,6 +1448,7 @@ void Navigator::RecordNavigationMetrics(
+@@ -1449,6 +1449,7 @@ void Navigator::RecordNavigationMetrics(
              .InMilliseconds());
    }
  
@@ -35,7 +35,7 @@ index 1dc14ea5d899cc17756911820ede80a4fa22df1d..f6160979def6f553e0e601e14830c498
    // 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 &&
-@@ -1497,6 +1498,7 @@ void Navigator::RecordNavigationMetrics(
+@@ -1498,6 +1499,7 @@ void Navigator::RecordNavigationMetrics(
           first_before_unload_start_time)
              .InMilliseconds());
    }

+ 4 - 4
patches/chromium/enable_reset_aspect_ratio.patch

@@ -6,10 +6,10 @@ 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 8a37f2e19d2c8c2c4cbd7f4475c16e41671fe7b4..21df259c3e596cecda15cff2c7a290e75a50d2b3 100644
+index f144ed979f2de1754e95407f908e2aa53c8c8328..b001362220febea5641615b4afa7174bccac50ed 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
-@@ -584,7 +584,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
+@@ -594,7 +594,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) {
  void DesktopWindowTreeHostWin::SetAspectRatio(
      const gfx::SizeF& aspect_ratio,
      const gfx::Size& excluded_margin) {
@@ -19,10 +19,10 @@ index 8a37f2e19d2c8c2c4cbd7f4475c16e41671fe7b4..21df259c3e596cecda15cff2c7a290e7
                                     excluded_margin);
  }
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 509bbf34ed99b5743564c2683f24d0bb2a6757bb..4957a1aba28263313ec072e8b4e71d14c66bf73e 100644
+index 20349af9aaa39cf8ca683462dc6772cf75112ae2..af7124ca3b93e85dfb1dddd9a7e8adf3c80d363f 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -961,8 +961,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
+@@ -993,8 +993,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen,
  
  void HWNDMessageHandler::SetAspectRatio(float aspect_ratio,
                                          const gfx::Size& excluded_margin) {

+ 8 - 8
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 4dbe98cdc788442944fbee805720832e6121c9de..7ba2100fea37514297b55e9424a8a449545adab6 100644
+index 999c1daf2d4743cd9c67d716fbae762e76075d73..dadfa43453c38ef5c09ffd161988ccdce3f5664a 100644
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
-@@ -1792,6 +1792,13 @@ void NetworkContext::SetNetworkConditions(
+@@ -1791,6 +1791,13 @@ void NetworkContext::SetNetworkConditions(
                                        std::move(network_conditions));
  }
  
@@ -51,10 +51,10 @@ index 4dbe98cdc788442944fbee805720832e6121c9de..7ba2100fea37514297b55e9424a8a449
    // 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 01b673a5d0796e15f63953455215dd0a1c306ff1..dcb142bf4daac90e2925386ffc18089262c01951 100644
+index 15065587ab034faf47f6b31482a8eb52ba8de633..72c6260c33424a4779613fc04cc3ad9edba69423 100644
 --- a/services/network/network_context.h
 +++ b/services/network/network_context.h
-@@ -317,6 +317,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -316,6 +316,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
    void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
                              mojom::NetworkConditionsPtr conditions) override;
@@ -63,10 +63,10 @@ index 01b673a5d0796e15f63953455215dd0a1c306ff1..dcb142bf4daac90e2925386ffc180892
    void SetEnableReferrers(bool enable_referrers) override;
  #if BUILDFLAG(IS_CT_SUPPORTED)
 diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
-index 6d7df96ea41ce10019285c927246208cb3001f8b..8b6fd3726add58937df6a4d91640a8b36f106c52 100644
+index 9bea63a5d08d80911385282a57f59f0322273d73..d5257a5a3c154ad712bb911370e232e7e3a36642 100644
 --- a/services/network/public/mojom/network_context.mojom
 +++ b/services/network/public/mojom/network_context.mojom
-@@ -1241,6 +1241,9 @@ interface NetworkContext {
+@@ -1251,6 +1251,9 @@ interface NetworkContext {
    SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
                         NetworkConditions? conditions);
  
@@ -77,10 +77,10 @@ index 6d7df96ea41ce10019285c927246208cb3001f8b..8b6fd3726add58937df6a4d91640a8b3
    SetAcceptLanguage(string new_accept_language);
  
 diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
-index 86430711eac5304c96486b0786b6ec3a26ce752b..16800dc67e932f53d679af051fbdd9871f531269 100644
+index 35076a426189b34f9d45bee37f7335815cab353b..db22a5f80d29133a8b13d3ec1e1a92ff3b0984f5 100644
 --- a/services/network/test/test_network_context.h
 +++ b/services/network/test/test_network_context.h
-@@ -156,6 +156,7 @@ class TestNetworkContext : public mojom::NetworkContext {
+@@ -155,6 +155,7 @@ class TestNetworkContext : public mojom::NetworkContext {
    void CloseIdleConnections(CloseIdleConnectionsCallback callback) override {}
    void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
                              mojom::NetworkConditionsPtr conditions) override {}

+ 1 - 1
patches/chromium/extend_apply_webpreferences.patch

@@ -12,7 +12,7 @@ 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 77f2b8a03f92062fc9c07b04adb22d421127b73a..ed07b4cee033ced8eee6aca4472cd1e2599e1956 100644
+index aa786f1b88186bea18bccb2a99c9d393df7c684c..9afdc8df7d36802f43ff4579240d92997949f03a 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
 @@ -169,6 +169,7 @@

+ 8 - 8
patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch

@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
 We can remove this patch once it has in some shape been upstreamed.
 
 diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
-index 728069cfdba9abd10bee1af9a195d1883ff91b6b..fc4f6e75b08bae70209ec28a033f8ed7b9b51a71 100644
+index 04e3441cdc0b3c01187e95900e7a805a65c2231e..1f2bded9105248b7cc06a97d75ca57b6838da355 100644
 --- a/ui/native_theme/native_theme.cc
 +++ b/ui/native_theme/native_theme.cc
 @@ -211,6 +211,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors,
@@ -26,10 +26,10 @@ index 728069cfdba9abd10bee1af9a195d1883ff91b6b..fc4f6e75b08bae70209ec28a033f8ed7
  }
  
 diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
-index b2a7455c7e005e628bee656991e8017814e0a583..4a825f250bf444f20a392cc6599fc52eb95e5d31 100644
+index 8489d256dd898c92bc77210f4a6239f5eb93b8e0..8d3eb64742948a3f8d04cfa7a585df35a84c8961 100644
 --- a/ui/native_theme/native_theme.h
 +++ b/ui/native_theme/native_theme.h
-@@ -443,6 +443,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
+@@ -447,6 +447,23 @@ class NATIVE_THEME_EXPORT NativeTheme {
        scoped_refptr<ColorProviderKey::ThemeInitializerSupplier> custom_theme,
        bool use_custom_frame = true) const;
  
@@ -53,7 +53,7 @@ index b2a7455c7e005e628bee656991e8017814e0a583..4a825f250bf444f20a392cc6599fc52e
    // 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
-@@ -680,6 +697,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
+@@ -684,6 +701,7 @@ class NATIVE_THEME_EXPORT NativeTheme {
    PreferredContrast preferred_contrast_ = PreferredContrast::kNoPreference;
    std::optional<base::TimeDelta> caret_blink_interval_;
    bool use_overlay_scrollbars_ = false;
@@ -62,13 +62,13 @@ index b2a7455c7e005e628bee656991e8017814e0a583..4a825f250bf444f20a392cc6599fc52e
    SEQUENCE_CHECKER(sequence_checker_);
  };
 diff --git a/ui/native_theme/native_theme_win.cc b/ui/native_theme/native_theme_win.cc
-index 1b098cbb291fe904f34d59ce5aaab7a0e48b28ea..9d27e7b3dc503a3f25d71f0342a3fd4f17a42ea0 100644
+index d34f90e8a6b9304798e73349aa73963dfc45bad6..99513deae31d7e4a37acbc16a35c42a4360960c2 100644
 --- a/ui/native_theme/native_theme_win.cc
 +++ b/ui/native_theme/native_theme_win.cc
-@@ -678,6 +678,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
-   // ...unless --force-dark-mode was specified in which case caveat emptor.
-   if (InForcedColorsMode() && !IsForcedDarkMode())
+@@ -688,6 +688,8 @@ bool NativeThemeWin::ShouldUseDarkColors() const {
+   if (InForcedColorsMode() && !IsForcedDarkMode()) {
      return false;
+   }
 +  if (theme_source() == ThemeSource::kForcedLight) return false;
 +  if (theme_source() == ThemeSource::kForcedDark) return true;
    return NativeTheme::ShouldUseDarkColors();

+ 2 - 2
patches/chromium/feat_allow_code_cache_in_custom_schemes.patch

@@ -140,7 +140,7 @@ index e0cdc785d2557bc79bde98728c23c239ed8d0961..74e0acbea1e0c18a6ac8971170efc945
  
      // JavaScript from chrome and chrome-untrusted pages. The resource URLs are
 diff --git a/content/browser/code_cache/generated_code_cache_browsertest.cc b/content/browser/code_cache/generated_code_cache_browsertest.cc
-index 61c8b54bc5a9ea59c90e8627ab01745e0c328382..f9521b7aac19bf3994517906b85fc92800b18003 100644
+index be7a332d8c071f09a2a09c382e7c6c906008c9ec..8227df3c7faa07552c7ce5cc88941285dfa9ca9c 100644
 --- a/content/browser/code_cache/generated_code_cache_browsertest.cc
 +++ b/content/browser/code_cache/generated_code_cache_browsertest.cc
 @@ -11,17 +11,22 @@
@@ -175,7 +175,7 @@ index 61c8b54bc5a9ea59c90e8627ab01745e0c328382..f9521b7aac19bf3994517906b85fc928
  bool SupportsSharedWorker() {
  #if BUILDFLAG(IS_ANDROID)
    // SharedWorkers are not enabled on Android. https://crbug.com/154571
-@@ -875,4 +882,82 @@ IN_PROC_BROWSER_TEST_F(LocalCompileHintsBrowserTest, LocalCompileHints) {
+@@ -874,4 +881,82 @@ IN_PROC_BROWSER_TEST_F(LocalCompileHintsBrowserTest, LocalCompileHints) {
    }
  }
  

+ 3 - 3
patches/chromium/feat_allow_usage_of_sccontentsharingpicker_on_supported_platforms.patch

@@ -311,10 +311,10 @@ index d85a71dde16218bc942245c895666ecf038bcef7..ebfc2bb1006950dcff8e8f8792779c41
  
  // Although ScreenCaptureKit is available in 12.3 there were some bugs that
 diff --git a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
-index e7db48a793d59272906eed8b1a7c2932a3822a9f..bc5aa4f37da5fe950847a9b9f26c2fdfb212a417 100644
+index 68f0d2c6a097fb6bf30c5303ed14b98bc5dde1d8..ee080009f75a0b9e07a12f929086008454ef8621 100644
 --- a/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
 +++ b/content/browser/renderer_host/media/in_process_video_capture_device_launcher.cc
-@@ -329,8 +329,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
+@@ -328,8 +328,16 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
          break;
        }
  
@@ -332,7 +332,7 @@ index e7db48a793d59272906eed8b1a7c2932a3822a9f..bc5aa4f37da5fe950847a9b9f26c2fdf
          // For the other capturers, when a bug reports the type of capture it's
          // easy enough to determine which capturer was used, but it's a little
          // fuzzier with window capture.
-@@ -346,13 +354,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
+@@ -345,13 +353,15 @@ void InProcessVideoCaptureDeviceLauncher::LaunchDeviceAsync(
        }
  #endif  // defined(USE_AURA) || BUILDFLAG(IS_MAC)
  

+ 13 - 13
patches/chromium/feat_configure_launch_options_for_service_process.patch

@@ -347,10 +347,10 @@ index 26de6bd23cb05ed3789727add5e246806aa56a08..66cbabae31236758eef35bab211d4874
    // launch failed.
    enum class LaunchState {
 diff --git a/content/browser/utility_sandbox_delegate.cc b/content/browser/utility_sandbox_delegate.cc
-index d8ef1517dd75ada318e2f1dcbbedd89b54db6989..b5b895503fb9dafa956425bb242b137d880e37ee 100644
+index ab7c6eec5e852b9f6257db60e38c4943ddbda13b..0216c44fe97ee2409c10acb4e585eef5467945e5 100644
 --- a/content/browser/utility_sandbox_delegate.cc
 +++ b/content/browser/utility_sandbox_delegate.cc
-@@ -39,17 +39,19 @@ UtilitySandboxedProcessLauncherDelegate::
+@@ -38,17 +38,19 @@ UtilitySandboxedProcessLauncherDelegate::
      UtilitySandboxedProcessLauncherDelegate(
          sandbox::mojom::Sandbox sandbox_type,
          const base::EnvironmentMap& env,
@@ -374,7 +374,7 @@ index d8ef1517dd75ada318e2f1dcbbedd89b54db6989..b5b895503fb9dafa956425bb242b137d
  #if DCHECK_IS_ON()
    bool supported_sandbox_type =
        sandbox_type_ == sandbox::mojom::Sandbox::kNoSandbox ||
-@@ -117,11 +119,28 @@ UtilitySandboxedProcessLauncherDelegate::GetSandboxType() {
+@@ -114,11 +116,28 @@ UtilitySandboxedProcessLauncherDelegate::GetSandboxType() {
    return sandbox_type_;
  }
  
@@ -466,7 +466,7 @@ index f3167c642c1f594c29ef7aa2a92a246f1d045344..f1f1dc8082b6039bf119ce10e7e4ca0e
  }  // namespace content
  
 diff --git a/content/common/sandbox_init_win.cc b/content/common/sandbox_init_win.cc
-index 38733269e53b9874305942809373004f305ffdec..9f4f5f7dd7f2704e363f43c31ac930aeaabc2b45 100644
+index 39c96d4423b24695eee86353057cfeed19318b57..31b343d97b7672294644041c9bb1a4cd0a869cca 100644
 --- a/content/common/sandbox_init_win.cc
 +++ b/content/common/sandbox_init_win.cc
 @@ -23,7 +23,7 @@ namespace content {
@@ -478,7 +478,7 @@ index 38733269e53b9874305942809373004f305ffdec..9f4f5f7dd7f2704e363f43c31ac930ae
      sandbox::StartSandboxedProcessCallback result_callback) {
    std::string type_str =
        target_command_line.GetSwitchValueASCII(switches::kProcessType);
-@@ -45,7 +45,7 @@ sandbox::ResultCode StartSandboxedProcess(
+@@ -46,7 +46,7 @@ sandbox::ResultCode StartSandboxedProcess(
    }
  
    return sandbox::policy::SandboxWin::StartSandboxedProcess(
@@ -706,10 +706,10 @@ index b67f4f87d588386409a90cd49e8338272c6e0d51..c34a80ec8db1b868a7f387ea4a11d71d
  #if BUILDFLAG(IS_MAC)
    // Whether or not to disclaim TCC responsibility for the process, defaults to
 diff --git a/sandbox/policy/win/sandbox_win.cc b/sandbox/policy/win/sandbox_win.cc
-index 617103850407d1affa2649a79f92aa26213f5496..8a029328e972262045f4069fb2edb67e20867d71 100644
+index 1c3ead160e2aa84b41eb9474f103c7c0dd54ac87..ef534a5cde6cfaf610dbdde27e73b113d399d384 100644
 --- a/sandbox/policy/win/sandbox_win.cc
 +++ b/sandbox/policy/win/sandbox_win.cc
-@@ -594,11 +594,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() {
+@@ -589,11 +589,9 @@ base::win::ScopedHandle CreateUnsandboxedJob() {
  // command line flag.
  ResultCode LaunchWithoutSandbox(
      const base::CommandLine& cmd_line,
@@ -722,7 +722,7 @@ index 617103850407d1affa2649a79f92aa26213f5496..8a029328e972262045f4069fb2edb67e
    // Network process runs in a job even when unsandboxed. This is to ensure it
    // does not outlive the browser, which could happen if there is a lot of I/O
    // on process shutdown, in which case TerminateProcess can fail. See
-@@ -890,7 +888,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) {
+@@ -885,7 +883,7 @@ bool SandboxWin::InitTargetServices(TargetServices* target_services) {
  // static
  ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
      const base::CommandLine& cmd_line,
@@ -731,7 +731,7 @@ index 617103850407d1affa2649a79f92aa26213f5496..8a029328e972262045f4069fb2edb67e
      SandboxDelegate* delegate,
      TargetPolicy* policy) {
    const base::CommandLine& launcher_process_command_line =
-@@ -904,7 +902,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
+@@ -899,7 +897,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
    }
  
    // Add any handles to be inherited to the policy.
@@ -740,7 +740,7 @@ index 617103850407d1affa2649a79f92aa26213f5496..8a029328e972262045f4069fb2edb67e
      policy->AddHandleToShare(handle);
  
    if (!policy->GetConfig()->IsConfigured()) {
-@@ -919,6 +917,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
+@@ -914,6 +912,13 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
    // have no effect. These calls can fail with SBOX_ERROR_BAD_PARAMS.
    policy->SetStdoutHandle(GetStdHandle(STD_OUTPUT_HANDLE));
    policy->SetStderrHandle(GetStdHandle(STD_ERROR_HANDLE));
@@ -754,7 +754,7 @@ index 617103850407d1affa2649a79f92aa26213f5496..8a029328e972262045f4069fb2edb67e
  #endif
  
    if (!delegate->PreSpawnTarget(policy))
-@@ -930,7 +935,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
+@@ -925,7 +930,7 @@ ResultCode SandboxWin::GeneratePolicyForSandboxedProcess(
  // static
  ResultCode SandboxWin::StartSandboxedProcess(
      const base::CommandLine& cmd_line,
@@ -763,7 +763,7 @@ index 617103850407d1affa2649a79f92aa26213f5496..8a029328e972262045f4069fb2edb67e
      SandboxDelegate* delegate,
      StartSandboxedProcessCallback result_callback) {
    SandboxLaunchTimer timer;
-@@ -940,7 +945,7 @@ ResultCode SandboxWin::StartSandboxedProcess(
+@@ -935,7 +940,7 @@ ResultCode SandboxWin::StartSandboxedProcess(
                             *base::CommandLine::ForCurrentProcess())) {
      base::Process process;
      ResultCode result =
@@ -772,7 +772,7 @@ index 617103850407d1affa2649a79f92aa26213f5496..8a029328e972262045f4069fb2edb67e
      DWORD last_error = GetLastError();
      std::move(result_callback).Run(std::move(process), last_error, result);
      return SBOX_ALL_OK;
-@@ -950,7 +955,7 @@ ResultCode SandboxWin::StartSandboxedProcess(
+@@ -945,7 +950,7 @@ ResultCode SandboxWin::StartSandboxedProcess(
    timer.OnPolicyCreated();
  
    ResultCode result = GeneratePolicyForSandboxedProcess(

+ 1 - 1
patches/chromium/feat_enable_customizing_symbol_color_in_framecaptionbutton.patch

@@ -11,7 +11,7 @@ ensure it has minimum contrast required to be accessible.
 This should be upstreamed to Chromium if possible.
 
 diff --git a/ui/views/window/frame_caption_button.cc b/ui/views/window/frame_caption_button.cc
-index f16354ec177171263cdd356e2ffbd5ca5c61b89d..bd1ff8d720e2323596976ebf36acdd85142c17b5 100644
+index 9f2f19eca80d420e10e5269fb24d4ca52f234ae9..ec54aaa17054468a21af4a1a9736da9134dfe4e6 100644
 --- a/ui/views/window/frame_caption_button.cc
 +++ b/ui/views/window/frame_caption_button.cc
 @@ -107,7 +107,7 @@ FrameCaptionButton::FrameCaptionButton(PressedCallback callback,

+ 4 - 4
patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch

@@ -90,7 +90,7 @@ index 8af69cac78b7488d28f1f05ccb174793fe5148cd..9f74e511c263d147b5fbe81fe100d217
   private:
    const HWND hwnd_;
 diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
-index 6c661c1766f987297ef1fd5c45069a63209826a3..8f121847abac0005eb3d2137fa48591bec57f637 100644
+index 664df443242ae9af565cc83786398d68e6d655c4..70d59ca1d1d53f992c7f96a81d440e723dbc7656 100644
 --- a/components/viz/service/BUILD.gn
 +++ b/components/viz/service/BUILD.gn
 @@ -171,6 +171,8 @@ viz_component("service") {
@@ -563,10 +563,10 @@ index 399fba1a3d4e601dc2cdd5f1f4def8b7fd7a3011..8bcbe0d26c80323155d536c0d3a177a1
    gpu::SyncPointManager* GetSyncPointManager() override;
    gpu::Scheduler* GetGpuScheduler() override;
 diff --git a/content/browser/compositor/viz_process_transport_factory.cc b/content/browser/compositor/viz_process_transport_factory.cc
-index 6ad03ff41c8ae01ed2b48025e82f522f3d509caf..0cc490be82aa051602010001131d040a6b94ccc3 100644
+index c8986a3972555fffd8c5bb617d9d9cdc5e4f8ec8..0307e1618351dd5be51e29b309cb89f9b0a5c765 100644
 --- a/content/browser/compositor/viz_process_transport_factory.cc
 +++ b/content/browser/compositor/viz_process_transport_factory.cc
-@@ -387,8 +387,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
+@@ -386,8 +386,14 @@ void VizProcessTransportFactory::OnEstablishedGpuChannel(
    mojo::AssociatedRemote<viz::mojom::DisplayPrivate> display_private;
    root_params->display_private =
        display_private.BindNewEndpointAndPassReceiver();
@@ -596,7 +596,7 @@ index 7d19b6be8bb0e0269c381cf6efdf79eaeff1e935..b8ec06ade095df99c024396a601dbf1a
  
    // Sends the created child window to the browser process so that it can be
 diff --git a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
-index be84767530d3deba6555b0b9589037365114c449..89283b0999e34c662bf968eaf5e51c8463cd8a23 100644
+index 29dd2361ecbce33ca720ea655b81516a1d213595..83becdd42e6948c3c7ba69327addd195e4d27cad 100644
 --- a/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
 +++ b/services/viz/privileged/mojom/compositing/frame_sink_manager.mojom
 @@ -39,6 +39,7 @@ struct RootCompositorFrameSinkParams {

+ 4 - 4
patches/chromium/feat_ensure_mas_builds_of_the_same_application_can_use_safestorage.patch

@@ -12,10 +12,10 @@ We attempt to migrate the safe storage key from the old account, if that migrati
 Existing apps that aren't built for the app store should be unimpacted, there is one edge case where a user uses BOTH an AppStore and a darwin build of the same app only one will keep it's access to the safestorage key as during the migration we delete the old account.  This is an acceptable edge case as no one should be actively using two versions of the same app.
 
 diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm
-index bb1fc0c99164ae4bdaaaa78e87c30e88932a928c..82d235709b79b1b3689b28ec8bfa02663ba219d6 100644
+index a7fa25575be84d1dabb04bdc458e2a6d4358ddc1..c2a5f12fc49c96fee57ad46e28e606d7adf20673 100644
 --- a/components/os_crypt/sync/keychain_password_mac.mm
 +++ b/components/os_crypt/sync/keychain_password_mac.mm
-@@ -23,6 +23,12 @@
+@@ -25,6 +25,12 @@
  using KeychainNameContainerType = const base::NoDestructor<std::string>;
  #endif
  
@@ -28,7 +28,7 @@ index bb1fc0c99164ae4bdaaaa78e87c30e88932a928c..82d235709b79b1b3689b28ec8bfa0266
  namespace {
  
  // These two strings ARE indeed user facing.  But they are used to access
-@@ -82,11 +88,18 @@
+@@ -84,11 +90,18 @@
  std::string KeychainPassword::GetPassword() const {
    UInt32 password_length = 0;
    void* password_data = nullptr;
@@ -49,7 +49,7 @@ index bb1fc0c99164ae4bdaaaa78e87c30e88932a928c..82d235709b79b1b3689b28ec8bfa0266
    if (error == noErr) {
      std::string password =
          std::string(static_cast<char*>(password_data), password_length);
-@@ -94,6 +107,49 @@
+@@ -96,6 +109,49 @@
      return password;
    }
  

+ 2 - 2
patches/chromium/feat_expose_documentloader_setdefersloading_on_webdocumentloader.patch

@@ -28,10 +28,10 @@ index 23b29fe25bc463ff1d36aa502a27c4222595e7c5..c1ac6172c4cee72f64f42ca64d2db9c0
  
    // Returns the http referrer of original request which initited this load.
 diff --git a/third_party/blink/renderer/core/loader/document_loader.h b/third_party/blink/renderer/core/loader/document_loader.h
-index 92ab7845b6e3f060de76fa023ec472c056e69d4b..aafd123ccd8faf630dffa304ec7825088155a15b 100644
+index 845b0cc7a208374a14e76e1e92f783636a1288c9..33d7a584b2f71f480325be6e96d3465104d3815f 100644
 --- a/third_party/blink/renderer/core/loader/document_loader.h
 +++ b/third_party/blink/renderer/core/loader/document_loader.h
-@@ -326,7 +326,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected<DocumentLoader>,
+@@ -327,7 +327,7 @@ class CORE_EXPORT DocumentLoader : public GarbageCollected<DocumentLoader>,
        std::optional<scheduler::TaskAttributionId>
            soft_navigation_heuristics_task_id);
  

+ 11 - 11
patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch

@@ -17,7 +17,7 @@ headers, moving forward we should find a way in upstream to provide
 access to these headers for loader clients created on the browser process.
 
 diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc
-index 38882b4053305f305aaad933af9c43f2964b3df3..13bce78bf95effa461e709080703d231f91bc096 100644
+index 677e8db2114350e5368b56bd8857957a5d99b419..9b5a1b7b66542aca6cace76d40cd8a3409d11f23 100644
 --- a/services/network/public/cpp/resource_request.cc
 +++ b/services/network/public/cpp/resource_request.cc
 @@ -170,6 +170,7 @@ ResourceRequest::TrustedParams& ResourceRequest::TrustedParams::operator=(
@@ -37,7 +37,7 @@ index 38882b4053305f305aaad933af9c43f2964b3df3..13bce78bf95effa461e709080703d231
           allow_cookies_from_browser == other.allow_cookies_from_browser &&
           include_request_cookies_with_response ==
 diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h
-index 176db1e8c4b4deafa1b741255474cf6d903d69cd..4ed734888dbeba3099f41767c481da68f5cd0bc3 100644
+index 51cd9e4f833d077a68948c1800f006ddf72cf246..db1a111006a233ab77057c5eb1703d075e491f0c 100644
 --- a/services/network/public/cpp/resource_request.h
 +++ b/services/network/public/cpp/resource_request.h
 @@ -75,6 +75,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest {
@@ -49,7 +49,7 @@ index 176db1e8c4b4deafa1b741255474cf6d903d69cd..4ed734888dbeba3099f41767c481da68
      mojo::PendingRemote<mojom::TrustTokenAccessObserver> trust_token_observer;
      mojo::PendingRemote<mojom::URLLoaderNetworkServiceObserver>
 diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc
-index 59a180c4aa3dc1ee424b6c4944bab46b7b259a53..9e3ddf00b824408d4eee70e8eadd1d07e42c3730 100644
+index 237c97c0e9ec40f16894808ca3243fbba181c37c..bcb808b3ede3fe6473c58166903703dbffc8a3ba 100644
 --- a/services/network/public/cpp/url_request_mojom_traits.cc
 +++ b/services/network/public/cpp/url_request_mojom_traits.cc
 @@ -95,6 +95,7 @@ bool StructTraits<network::mojom::TrustedUrlRequestParamsDataView,
@@ -61,7 +61,7 @@ index 59a180c4aa3dc1ee424b6c4944bab46b7b259a53..9e3ddf00b824408d4eee70e8eadd1d07
        mojo::PendingRemote<network::mojom::CookieAccessObserver>>();
    out->trust_token_observer = data.TakeTrustTokenObserver<
 diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h
-index 5a017a816858ff9748e6eb0fa0dac5a64dd8f2ae..22025bedb1e307fd02314ac0a4250ca90ee3e5bf 100644
+index 46e36ea59abe3efdd24c56093f4161d6bc57c882..5f6a283272f0d153d2f4b78b9f6dac410b0ebcd8 100644
 --- a/services/network/public/cpp/url_request_mojom_traits.h
 +++ b/services/network/public/cpp/url_request_mojom_traits.h
 @@ -77,6 +77,10 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE)
@@ -76,7 +76,7 @@ index 5a017a816858ff9748e6eb0fa0dac5a64dd8f2ae..22025bedb1e307fd02314ac0a4250ca9
    cookie_observer(
        const network::ResourceRequest::TrustedParams& trusted_params) {
 diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom
-index 0e9546fbcaa0b2999f5e9d163550ef152b21adcc..1608b5662ddbb12cf022f043b699983bc814771a 100644
+index e0a7a63532eeab0601198f84b7105a87eae43345..d18646c78c730ae3e17b2c6a09d8ef3bf55140b0 100644
 --- a/services/network/public/mojom/url_request.mojom
 +++ b/services/network/public/mojom/url_request.mojom
 @@ -82,6 +82,9 @@ struct TrustedUrlRequestParams {
@@ -112,10 +112,10 @@ index 5c4b8a05034f8defacbc13671fe9bc92f76ade5a..e7390e01f113755613f42d592b36108b
    string mime_type;
  
 diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
-index e73516e9f8716d2865ae6606a26fdd47f2aba00d..c6fa2051124fd3d11ab04fe5f2c35033fcf09f56 100644
+index 4db6317eac52144e6325b3b497280c40d70f640e..2558f5f073a2a3f7b0e63979685d38be23b20709 100644
 --- a/services/network/url_loader.cc
 +++ b/services/network/url_loader.cc
-@@ -634,6 +634,9 @@ URLLoader::URLLoader(
+@@ -629,6 +629,9 @@ URLLoader::URLLoader(
            mojo::SimpleWatcher::ArmingPolicy::MANUAL,
            base::SequencedTaskRunner::GetCurrentDefault()),
        per_factory_orb_state_(context.GetMutableOrbState()),
@@ -125,7 +125,7 @@ index e73516e9f8716d2865ae6606a26fdd47f2aba00d..c6fa2051124fd3d11ab04fe5f2c35033
        devtools_request_id_(request.devtools_request_id),
        request_mode_(request.mode),
        request_credentials_mode_(request.credentials_mode),
-@@ -913,7 +916,7 @@ void URLLoader::ConfigureRequest(
+@@ -910,7 +913,7 @@ void URLLoader::ConfigureRequest(
          &URLLoader::IsSharedDictionaryReadAllowed, base::Unretained(this)));
    }
  
@@ -134,7 +134,7 @@ index e73516e9f8716d2865ae6606a26fdd47f2aba00d..c6fa2051124fd3d11ab04fe5f2c35033
      url_request_->SetResponseHeadersCallback(base::BindRepeating(
          &URLLoader::SetRawResponseHeaders, base::Unretained(this)));
    }
-@@ -1923,6 +1926,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
+@@ -1920,6 +1923,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
    }
  
    response_ = BuildResponseHead();
@@ -155,10 +155,10 @@ index e73516e9f8716d2865ae6606a26fdd47f2aba00d..c6fa2051124fd3d11ab04fe5f2c35033
  
    // Parse and remove the Trust Tokens response headers, if any are expected,
 diff --git a/services/network/url_loader.h b/services/network/url_loader.h
-index b350754a1425f2b5b7bf2f204848f17bd3ff4ff4..754fcd499179eacdf913fcffc5564565c4ff7ff3 100644
+index a9ce96e27330ca21cb7f43f9d06115428176e31e..04897d7b6af19faab435cfca9e926142bdbb8ed6 100644
 --- a/services/network/url_loader.h
 +++ b/services/network/url_loader.h
-@@ -715,6 +715,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
+@@ -689,6 +689,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader
    std::unique_ptr<ResourceScheduler::ScheduledResourceRequest>
        resource_scheduler_request_handle_;
  

+ 4 - 4
patches/chromium/fix_activate_background_material_on_windows.patch

@@ -14,10 +14,10 @@ This patch likely can't be upstreamed as-is, as Chromium doesn't have
 this use case in mind currently.
 
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index fda18ecab7e982b3087c7667d36578177d370066..a949e73dabad71d2550e38b09dbcf45160b3a853 100644
+index ae0189bd5fb9a91f4c76081cd3eed94f79d567dd..d03bea613d7b85567c968f758fa8d64d3dc6f263 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -908,13 +908,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
+@@ -937,13 +937,13 @@ void HWNDMessageHandler::FrameTypeChanged() {
  
  void HWNDMessageHandler::PaintAsActiveChanged() {
    if (!delegate_->HasNonClientView() || !delegate_->CanActivate() ||
@@ -33,9 +33,9 @@ index fda18ecab7e982b3087c7667d36578177d370066..a949e73dabad71d2550e38b09dbcf451
  }
  
  void HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia& window_icon,
-@@ -2256,17 +2256,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
-   if (IsVisible())
+@@ -2332,17 +2332,18 @@ LRESULT HWNDMessageHandler::OnNCActivate(UINT message,
      delegate_->SchedulePaint();
+   }
  
 -  // Calling DefWindowProc is only necessary if there's a system frame being
 -  // drawn. Otherwise it can draw an incorrect title bar and cause visual

+ 14 - 13
patches/chromium/fix_adapt_exclusive_access_for_electron_needs.patch

@@ -16,7 +16,7 @@ Linux or Windows to un-fullscreen in some circumstances without this
 change.
 
 diff --git a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
-index 9e6611a53f8430f86ba4e6439e9a21446ce3332e..7d85ea70870c5064f6c0a6abd3ef091a0da75dd0 100644
+index 5ad01788be680f005f3179141995aef72e36bd0c..da05b9ee80d537cfa5e039f1e1a46696e823771c 100644
 --- a/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
 +++ b/chrome/browser/ui/exclusive_access/fullscreen_controller.cc
 @@ -20,12 +20,16 @@
@@ -36,20 +36,21 @@ index 9e6611a53f8430f86ba4e6439e9a21446ce3332e..7d85ea70870c5064f6c0a6abd3ef091a
  #include "chrome/common/chrome_switches.h"
  #include "components/history/core/browser/history_service.h"
  #include "components/history/core/browser/history_types.h"
-@@ -262,10 +266,12 @@ void FullscreenController::EnterFullscreenModeForTab(
+@@ -263,11 +267,13 @@ void FullscreenController::EnterFullscreenModeForTab(
      return;
    }
  
 +#if 0
-   if (!popunder_preventer_)
+   if (!popunder_preventer_) {
      popunder_preventer_ = std::make_unique<PopunderPreventer>(web_contents);
-   else
+   } else {
      popunder_preventer_->WillActivateWebContents(web_contents);
+   }
 +#endif
  
    // Keep the current state. |SetTabWithExclusiveAccess| may change the return
    // value of |IsWindowFullscreenForTabOrPending|.
-@@ -377,12 +383,14 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
+@@ -381,12 +387,14 @@ void FullscreenController::ExitFullscreenModeForTab(WebContents* web_contents) {
  void FullscreenController::FullscreenTabOpeningPopup(
      content::WebContents* opener,
      content::WebContents* popup) {
@@ -64,7 +65,7 @@ index 9e6611a53f8430f86ba4e6439e9a21446ce3332e..7d85ea70870c5064f6c0a6abd3ef091a
  }
  
  void FullscreenController::OnTabDeactivated(
-@@ -468,10 +476,12 @@ void FullscreenController::FullscreenTransitionCompleted() {
+@@ -476,10 +484,12 @@ void FullscreenController::FullscreenTransitionCompleted() {
  #endif  // DCHECK_IS_ON()
    tab_fullscreen_target_display_id_ = display::kInvalidDisplayId;
    started_fullscreen_transition_ = false;
@@ -77,7 +78,7 @@ index 9e6611a53f8430f86ba4e6439e9a21446ce3332e..7d85ea70870c5064f6c0a6abd3ef091a
  }
  
  void FullscreenController::RunOrDeferUntilTransitionIsComplete(
-@@ -590,18 +600,17 @@ void FullscreenController::EnterFullscreenModeInternal(
+@@ -604,18 +614,17 @@ void FullscreenController::EnterFullscreenModeInternal(
    // Do not enter fullscreen mode if disallowed by pref. This prevents the user
    // from manually entering fullscreen mode and also disables kiosk mode on
    // desktop platforms.
@@ -101,15 +102,15 @@ index 9e6611a53f8430f86ba4e6439e9a21446ce3332e..7d85ea70870c5064f6c0a6abd3ef091a
    if (option == TAB) {
      url = GetRequestingOrigin();
      tab_fullscreen_ = true;
-@@ -634,6 +643,7 @@ void FullscreenController::EnterFullscreenModeInternal(
-     if (!extension_caused_fullscreen_.is_empty())
+@@ -650,6 +659,7 @@ void FullscreenController::EnterFullscreenModeInternal(
        url = extension_caused_fullscreen_;
+     }
    }
 +#endif
  
    fullscreen_start_time_ = base::TimeTicks::Now();
-   if (option == BROWSER)
-@@ -654,6 +664,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
+   if (option == BROWSER) {
+@@ -671,6 +681,7 @@ void FullscreenController::ExitFullscreenModeInternal() {
      return;
    }
  
@@ -117,7 +118,7 @@ index 9e6611a53f8430f86ba4e6439e9a21446ce3332e..7d85ea70870c5064f6c0a6abd3ef091a
    // `fullscreen_start_time_` is null if a fullscreen tab moves to a new window.
    if (fullscreen_start_time_ && exclusive_access_tab()) {
      ukm::SourceId source_id =
-@@ -665,15 +676,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
+@@ -682,15 +693,16 @@ void FullscreenController::ExitFullscreenModeInternal() {
          .Record(ukm::UkmRecorder::Get());
      fullscreen_start_time_.reset();
    }
@@ -137,7 +138,7 @@ index 9e6611a53f8430f86ba4e6439e9a21446ce3332e..7d85ea70870c5064f6c0a6abd3ef091a
    exclusive_access_manager()->context()->ExitFullscreen();
    extension_caused_fullscreen_ = GURL();
    exclusive_access_manager()->UpdateBubble(base::NullCallback());
-@@ -735,8 +747,12 @@ GURL FullscreenController::GetEmbeddingOrigin() const {
+@@ -754,8 +766,12 @@ GURL FullscreenController::GetEmbeddingOrigin() const {
  void FullscreenController::RecordMetricsOnFullscreenApiRequested(
      content::RenderFrameHost* requesting_frame) {
    history::HistoryService* service =

+ 4 - 3
patches/chromium/fix_aspect_ratio_with_max_size.patch

@@ -11,10 +11,10 @@ enlarge window above dimensions set during creation of the
 BrowserWindow.
 
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 4957a1aba28263313ec072e8b4e71d14c66bf73e..9ac53e223aa095acdf90b68bc1e6bc81e3021ab9 100644
+index af7124ca3b93e85dfb1dddd9a7e8adf3c80d363f..3e7066bcdc551f1c798c75f279b57318b4bf18e4 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -3596,14 +3596,29 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
+@@ -3717,15 +3717,30 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
    delegate_->GetMinMaxSize(&min_window_size, &max_window_size);
    min_window_size = delegate_->DIPToScreenSize(min_window_size);
    max_window_size = delegate_->DIPToScreenSize(max_window_size);
@@ -35,8 +35,9 @@ index 4957a1aba28263313ec072e8b4e71d14c66bf73e..9ac53e223aa095acdf90b68bc1e6bc81
 +  }
  
    std::optional<gfx::Size> max_size_param;
-   if (!max_window_size.IsEmpty())
+   if (!max_window_size.IsEmpty()) {
      max_size_param = max_window_size;
+   }
  
 -  gfx::SizeRectToAspectRatioWithExcludedMargin(
 +  gfx::SizeRectToAspectRatio(

+ 5 - 5
patches/chromium/fix_crash_loading_non-standard_schemes_in_iframes.patch

@@ -28,10 +28,10 @@ The patch should be removed in favor of either:
 Upstream bug https://bugs.chromium.org/p/chromium/issues/detail?id=1081397.
 
 diff --git a/content/browser/renderer_host/navigation_request.cc b/content/browser/renderer_host/navigation_request.cc
-index e919dcd7acf870e39709d7ac5afd356a8a2b94fa..ceed8afc60dd3d38ca722b79b93c6b1c1ee7fb76 100644
+index cc3a15808ad7c0f0764944f145499f9bc462c787..49f43795209fe3cbf12a949312c3edbbfb5aa255 100644
 --- a/content/browser/renderer_host/navigation_request.cc
 +++ b/content/browser/renderer_host/navigation_request.cc
-@@ -10867,6 +10867,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
+@@ -10817,6 +10817,12 @@ NavigationRequest::GetOriginForURLLoaderFactoryUncheckedWithDebugInfo() {
          "blob");
    }
  
@@ -45,10 +45,10 @@ index e919dcd7acf870e39709d7ac5afd356a8a2b94fa..ceed8afc60dd3d38ca722b79b93c6b1c
    // origin of |common_params.url| and/or |common_params.initiator_origin|.
    url::Origin resolved_origin = url::Origin::Resolve(
 diff --git a/third_party/blink/renderer/core/loader/document_loader.cc b/third_party/blink/renderer/core/loader/document_loader.cc
-index ccc8243d90000c8da65486a00c4800ede3de66fe..8355f72ec1e2d3a50c21761e764ad6c0233a3b81 100644
+index f4d01820da41368f872e1f04a4736946eb304a93..8fd4b90f490d6b063ab780caf301bed68f36737e 100644
 --- a/third_party/blink/renderer/core/loader/document_loader.cc
 +++ b/third_party/blink/renderer/core/loader/document_loader.cc
-@@ -2309,6 +2309,10 @@ Frame* DocumentLoader::CalculateOwnerFrame() {
+@@ -2317,6 +2317,10 @@ Frame* DocumentLoader::CalculateOwnerFrame() {
  scoped_refptr<SecurityOrigin> DocumentLoader::CalculateOrigin(
      Document* owner_document) {
    scoped_refptr<SecurityOrigin> origin;
@@ -59,7 +59,7 @@ index ccc8243d90000c8da65486a00c4800ede3de66fe..8355f72ec1e2d3a50c21761e764ad6c0
    StringBuilder debug_info_builder;
    // Whether the origin is newly created within this call, instead of copied
    // from an existing document's origin or from `origin_to_commit_`. If this is
-@@ -2362,6 +2366,10 @@ scoped_refptr<SecurityOrigin> DocumentLoader::CalculateOrigin(
+@@ -2370,6 +2374,10 @@ scoped_refptr<SecurityOrigin> DocumentLoader::CalculateOrigin(
      // the end of this function.
      origin = origin_to_commit_;
      debug_info_builder.Append("use_origin_to_commit");

+ 6 - 70
patches/chromium/fix_crash_when_saving_edited_pdf_files.patch

@@ -13,15 +13,16 @@ This patch can be removed should we choose to support chrome.fileSystem
 or support it enough to fix the crash.
 
 diff --git a/chrome/browser/resources/pdf/pdf_viewer.ts b/chrome/browser/resources/pdf/pdf_viewer.ts
-index 25f2145d4202af9c386780366f726fbf6dcf558f..860d19e5ba1aa4dd027f3f5e5f2ccd37f54a99ad 100644
+index 62354223a767c9d83e81ec6cc0245545a3106c00..0254aa9033cf3986120f8fc4e965b339f00b3ee7 100644
 --- a/chrome/browser/resources/pdf/pdf_viewer.ts
 +++ b/chrome/browser/resources/pdf/pdf_viewer.ts
-@@ -1089,28 +1089,27 @@ export class PdfViewerElement extends PdfViewerBaseElement {
+@@ -1093,29 +1093,27 @@ export class PdfViewerElement extends PdfViewerBaseElement {
        dataArray = [result.dataToSave];
      }
  
 -    const blob = new Blob(dataArray);
      const fileName = this.attachments_[index].name;
+-    // TODO(crbug.com/373852607): Update to `showSaveFilePicker`.
 -    chrome.fileSystem.chooseEntry(
 -        {type: 'saveFile', suggestedName: fileName},
 -        (entry?: FileSystemFileEntry) => {
@@ -65,76 +66,11 @@ index 25f2145d4202af9c386780366f726fbf6dcf558f..860d19e5ba1aa4dd027f3f5e5f2ccd37
    }
  
    /**
-@@ -1301,36 +1300,33 @@ export class PdfViewerElement extends PdfViewerBaseElement {
+@@ -1306,7 +1304,6 @@ export class PdfViewerElement extends PdfViewerBaseElement {
        fileName = fileName + '.pdf';
      }
  
 -    // Create blob before callback to avoid race condition.
      const blob = new Blob([result.dataToSave], {type: 'application/pdf'});
--    chrome.fileSystem.chooseEntry(
--        {
--          type: 'saveFile',
--          accepts: [{description: '*.pdf', extensions: ['pdf']}],
--          suggestedName: fileName,
--        },
--        (entry?: FileSystemFileEntry) => {
--          if (chrome.runtime.lastError) {
--            if (chrome.runtime.lastError.message !== 'User cancelled') {
--              console.error(
--                  'chrome.fileSystem.chooseEntry failed: ' +
--                  chrome.runtime.lastError.message);
--            }
--            return;
--          }
--          entry!.createWriter((writer: FileWriter) => {
--            writer.write(blob);
--            // <if expr="enable_ink or enable_pdf_ink2">
--            // Unblock closing the window now that the user has saved
--            // successfully.
--            this.setShowBeforeUnloadDialog_(false);
--            // </if>
--            // <if expr="enable_pdf_ink2">
--            this.hasSavedEdits_ =
--                this.hasSavedEdits_ || requestType === SaveRequestType.EDITED;
--            // </if>
--          });
--        });
-+    try {
-+      const fileHandle = await window.showSaveFilePicker({
-+        suggestedName: fileName,
-+        types: [{
-+          description: 'PDF Files',
-+          accept: { 'application/pdf': ['.pdf'] },
-+        }],
-+      });
-+
-+      const writable = await fileHandle.createWritable();
-+      await writable.write(blob);
-+      await writable.close();
-+      // <if expr="enable_ink or enable_pdf_ink2">
-+      // Unblock closing the window now that the user has saved
-+      // successfully.
-+      this.setShowBeforeUnloadDialog_(false);
-+      // </if>
-+      // <if expr="enable_pdf_ink2">
-+      this.hasSavedEdits_ =
-+        this.hasSavedEdits_ || requestType === SaveRequestType.EDITED;
-+      // </if>
-+    } catch (error: any) {
-+      if (error.name !== 'AbortError') {
-+        console.error('window.showSaveFilePicker failed: ' + error);
-+      }
-+    }
- 
-     // <if expr="enable_pdf_ink2">
-     // Ink2 doesn't need to exit annotation mode after save.
-@@ -1476,6 +1472,9 @@ declare global {
-   interface HTMLElementTagNameMap {
-     'pdf-viewer': PdfViewerElement;
-   }
-+  interface Window {
-+    showSaveFilePicker(opts: unknown): Promise<FileSystemFileHandle>;
-+  }
- }
- 
- customElements.define(PdfViewerElement.is, PdfViewerElement);
+     // TODO(crbug.com/373852607): When  OOPIF PDF is enabled, cross origin
+     // checks block the request for `showSaveFilePicker`. Fix the issue by

+ 14 - 14
patches/chromium/fix_media_key_usage_with_globalshortcuts.patch

@@ -11,19 +11,19 @@ counter to the design of globalShortcuts, and so we need to instead
 use `ui::MediaKeysListener`.
 
 diff --git a/chrome/browser/extensions/global_shortcut_listener.cc b/chrome/browser/extensions/global_shortcut_listener.cc
-index f5495cf896329e00ddd74f364f9f19b5c0321af2..9695f2f2f92e65d9500c53ca74f58d19003422e4 100644
+index 7a5635aa2beec3f46fde571f68adf5ae6c20ea11..897d1dc7c5896edde32f0dc5a46143ed2e8ea03c 100644
 --- a/chrome/browser/extensions/global_shortcut_listener.cc
 +++ b/chrome/browser/extensions/global_shortcut_listener.cc
-@@ -8,6 +8,7 @@
- #include "base/not_fatal_until.h"
+@@ -14,6 +14,7 @@
  #include "base/notreached.h"
+ #include "build/config/linux/dbus/buildflags.h"
  #include "content/public/browser/browser_thread.h"
 +#include "content/public/browser/media_keys_listener_manager.h"
  #include "ui/base/accelerators/accelerator.h"
- 
- using content::BrowserThread;
-@@ -67,6 +68,22 @@ void GlobalShortcutListener::UnregisterAccelerator(
-     StopListening();
+ #include "ui/base/accelerators/command.h"
+ #include "ui/base/accelerators/global_accelerator_listener/global_accelerator_listener.h"
+@@ -91,6 +92,22 @@ void GlobalShortcutListener::UnregisterAccelerator(
+   RemoveAccelerator(accelerator);
  }
  
 +// static
@@ -43,13 +43,13 @@ index f5495cf896329e00ddd74f364f9f19b5c0321af2..9695f2f2f92e65d9500c53ca74f58d19
 +}
 +
  void GlobalShortcutListener::UnregisterAccelerators(Observer* observer) {
-   CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-   if (IsShortcutHandlingSuspended())
+   CHECK(global_accelerator_listener_);
+ 
 diff --git a/chrome/browser/extensions/global_shortcut_listener.h b/chrome/browser/extensions/global_shortcut_listener.h
-index d2a3a6ddf10e646ea66dfc67c09ee949c1d2f171..de2df2f688ee8e06c2cf0ae46bcd718b5f9c5da4 100644
+index ec203528129a3d13753d6ce477dd5796e80ddf71..2dd2403e0ae57dd8162fbcc8c8d3ebdd6e57c95c 100644
 --- a/chrome/browser/extensions/global_shortcut_listener.h
 +++ b/chrome/browser/extensions/global_shortcut_listener.h
-@@ -40,6 +40,8 @@ class GlobalShortcutListener {
+@@ -41,6 +41,8 @@ class GlobalShortcutListener {
    // The instance may be nullptr.
    static GlobalShortcutListener* GetInstance();
  
@@ -59,10 +59,10 @@ index d2a3a6ddf10e646ea66dfc67c09ee949c1d2f171..de2df2f688ee8e06c2cf0ae46bcd718b
    // true if register successfully, or false if 1) the specificied |accelerator|
    // has been registered by another caller or other native applications, or
 diff --git a/content/browser/media/media_keys_listener_manager_impl.cc b/content/browser/media/media_keys_listener_manager_impl.cc
-index b329df28207430ccdaf889b672bcd3d875faad18..51effd950173e2893ff8dfbd7db10abff6b75923 100644
+index 42e37564e585987d367921568f0f1d2b7507f953..9baf89efbade01e8b60c579255f10799914e144f 100644
 --- a/content/browser/media/media_keys_listener_manager_impl.cc
 +++ b/content/browser/media/media_keys_listener_manager_impl.cc
-@@ -88,7 +88,11 @@ bool MediaKeysListenerManagerImpl::StartWatchingMediaKey(
+@@ -87,7 +87,11 @@ bool MediaKeysListenerManagerImpl::StartWatchingMediaKey(
        CanActiveMediaSessionControllerReceiveEvents();
  
    // Tell the underlying MediaKeysListener to listen for the key.
@@ -75,7 +75,7 @@ index b329df28207430ccdaf889b672bcd3d875faad18..51effd950173e2893ff8dfbd7db10abf
        !media_keys_listener_->StartWatchingMediaKey(key_code)) {
      return false;
    }
-@@ -362,6 +366,20 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
+@@ -361,6 +365,20 @@ void MediaKeysListenerManagerImpl::StartListeningForMediaKeysIfNecessary() {
          this, ui::MediaKeysListener::Scope::kGlobal);
      DCHECK(media_keys_listener_);
    }

+ 2 - 2
patches/chromium/fix_move_autopipsettingshelper_behind_branding_buildflag.patch

@@ -75,10 +75,10 @@ index 50f1b8711f7e9bd0aa31ba29f7e7be45eed2647c..869f36e70c48e80a0606d156f33fe05c
  
  PictureInPictureOcclusionTracker*
 diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
-index 1b0ea294197c6ceb4f260041aa7e5ca818bff84a..97d3431199911b2e9ac09295700959dfe8b29571 100644
+index c42e2b6a1e83e2d0036f3e7d30a79be7bea544c7..ca4423835a2689e3265777ccc7013991e7d6dc85 100644
 --- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
 +++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
-@@ -428,11 +428,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
+@@ -430,11 +430,13 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
  
  #endif  // BUILDFLAG(IS_WIN)
  

+ 6 - 6
patches/chromium/fix_on-screen-keyboard_hides_on_input_blur_in_webview.patch

@@ -9,10 +9,10 @@ focus node change via TextInputManager.
 chromium-bug: https://crbug.com/1369605
 
 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 fb551f7bebc3b8d1d0c3679e060d0f103e3f7a73..3d9792a30bee04ad1a1492d6aa319b52d89443f9 100644
+index 50cac7b36d6e83dea6686636b5e7a2943c44ceac..8eb27f147c5dae05375c6cf8e1d5d2a79eac911c 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
-@@ -3212,6 +3212,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
+@@ -3204,6 +3204,12 @@ void RenderWidgetHostViewAura::OnTextSelectionChanged(
    }
  }
  
@@ -26,10 +26,10 @@ index fb551f7bebc3b8d1d0c3679e060d0f103e3f7a73..3d9792a30bee04ad1a1492d6aa319b52
      RenderWidgetHostViewAura* popup_child_host_view) {
    popup_child_host_view_ = popup_child_host_view;
 diff --git a/content/browser/renderer_host/render_widget_host_view_aura.h b/content/browser/renderer_host/render_widget_host_view_aura.h
-index 2042f979ed1cb34252bfca1b9f871f7cb4730ce6..cd94b45a84e77cd236301cc08659e63fac3a16d9 100644
+index 564a8708abecbbe122016bd8b46bf2957d5f9107..f3636d6fd36420832c4bcbe20e5eab1a2a104136 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.h
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.h
-@@ -652,6 +652,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
+@@ -651,6 +651,8 @@ class CONTENT_EXPORT RenderWidgetHostViewAura
        RenderWidgetHostViewBase* updated_view) override;
    void OnTextSelectionChanged(TextInputManager* text_input_mangager,
                                RenderWidgetHostViewBase* updated_view) override;
@@ -87,10 +87,10 @@ index 51522e60d6dc14f1113cc438558b6b393c3fe73a..153ed02f493a83ef9ca354cc18736f93
    // The view with active text input state, i.e., a focused <input> element.
    // It will be nullptr if no such view exists. Note that the active view
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 750a5c74404d7d96e65fce1d91d1e38d8621c1f2..e878d103eb79cbb67878e7c6da369d355b45ac40 100644
+index deb9bedb4a7a699807f2c5fabae6c4b90a141a4f..a81cb902e77e1246b7a1d190e89b2da02952abf9 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -9501,7 +9501,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
+@@ -9547,7 +9547,7 @@ void WebContentsImpl::OnFocusedElementChangedInFrame(
                          "WebContentsImpl::OnFocusedElementChangedInFrame",
                          "render_frame_host", frame);
    RenderWidgetHostViewBase* root_view =

+ 9 - 7
patches/chromium/fix_properly_honor_printing_page_ranges.patch

@@ -62,10 +62,10 @@ index f39f8b2dd3aa2b89498ed5331aa9b9ba6a02abf5..c0e155c14b2b4e81cde35cea1db284bc
    PMPrintSettings print_settings =
        static_cast<PMPrintSettings>([print_info_ PMPrintSettings]);
 diff --git a/printing/printing_context_system_dialog_win.cc b/printing/printing_context_system_dialog_win.cc
-index c6a080107949c435565d6e57646f36fd5e3b912d..e37331436cf5d4bca41bb39a288d395e820736fd 100644
+index 858e1bb00390b6097a27ffe20997672914e8f28f..953f203d21b4da559791efe228f27b56c2f85263 100644
 --- a/printing/printing_context_system_dialog_win.cc
 +++ b/printing/printing_context_system_dialog_win.cc
-@@ -77,14 +77,28 @@ void PrintingContextSystemDialogWin::AskUserForSettings(
+@@ -73,14 +73,30 @@ void PrintingContextSystemDialogWin::AskUserForSettings(
    PRINTPAGERANGE ranges[32];
    dialog_options.nStartPage = START_PAGE_GENERAL;
    if (max_pages) {
@@ -78,11 +78,13 @@ index c6a080107949c435565d6e57646f36fd5e3b912d..e37331436cf5d4bca41bb39a288d395e
 +
 +    auto page_ranges = settings_->ranges();
 +    if (!page_ranges.empty()) {
-+      for (size_t i = 0; i < page_ranges.size(); i++) {
-+        auto range = page_ranges[i];
-+        ranges[i].nFromPage = range.from + 1;
-+        ranges[i].nToPage = range.to + 1;
-+      }
++      UNSAFE_TODO({
++        for (size_t i = 0; i < page_ranges.size(); i++) {
++          auto range = page_ranges[i];
++          ranges[i].nFromPage = range.from + 1;
++          ranges[i].nToPage = range.to + 1;
++        }
++      });
 +      dialog_options.nPageRanges = page_ranges.size();
 +
 +      // Ensure the Pages radio button is selected.

+ 2 - 2
patches/chromium/fix_remove_caption-removing_style_call.patch

@@ -18,10 +18,10 @@ or resizing, but Electron does not seem to run into that issue
 for opaque frameless windows even with that block commented out.
 
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 026b0f9b404267b17e1ea6b61b5ebb188b9b0bed..fda18ecab7e982b3087c7667d36578177d370066 100644
+index 7e8c077edaa6b55011b0f3a3df382e2b71566bf1..ae0189bd5fb9a91f4c76081cd3eed94f79d567dd 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -1736,7 +1736,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
+@@ -1791,7 +1791,23 @@ LRESULT HWNDMessageHandler::OnCreate(CREATESTRUCT* create_struct) {
    SendMessage(hwnd(), WM_CHANGEUISTATE, MAKELPARAM(UIS_CLEAR, UISF_HIDEFOCUS),
                0);
  

+ 2 - 2
patches/chromium/fix_restore_original_resize_performance_on_macos.patch

@@ -11,10 +11,10 @@ This patch should be upstreamed as a conditional revert of the logic in desktop
 vs mobile runtimes.  i.e. restore the old logic only on desktop platforms
 
 diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
-index c877e1aff3216aaf881e35e704745be442c5ca69..9ac652e9b232fe2b2122da5db113bf67274c959b 100644
+index 99cbf072fda079c440114f0b58080f50698538f3..377cd5cca2a95f1f3cc1197ba891795d6e588811 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
-@@ -2052,9 +2052,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
+@@ -2079,9 +2079,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() {
  void RenderWidgetHostImpl::NotifyScreenInfoChanged() {
    // The resize message (which may not happen immediately) will carry with it
    // the screen info as well as the new size (if the screen has changed scale

+ 5 - 5
patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch

@@ -64,10 +64,10 @@ index cba373664bec3a32abad6fe0396bd67b53b7e67f..7a985067b1371604644d48159f2f5aa7
  
  #endif  // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
 diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
-index 91d67a69cddcb7ae4425b893f625e40975e665cc..712f72bddbd7bae782b468659bc7e2b022f04281 100644
+index d43ee5ce7695a7c41cc4f8dc96e066422553b1dd..513d09d8e3a8adca46d30db68ff33e380f7987e8 100644
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
-@@ -3134,6 +3134,7 @@ void LocalFrame::RequestExecuteScript(
+@@ -3138,6 +3138,7 @@ void LocalFrame::RequestExecuteScript(
      mojom::blink::EvaluationTiming evaluation_timing,
      mojom::blink::LoadEventBlockingOption blocking_option,
      WebScriptExecutionCallback callback,
@@ -75,7 +75,7 @@ index 91d67a69cddcb7ae4425b893f625e40975e665cc..712f72bddbd7bae782b468659bc7e2b0
      BackForwardCacheAware back_forward_cache_aware,
      mojom::blink::WantResultOption want_result_option,
      mojom::blink::PromiseResultOption promise_behavior) {
-@@ -3166,7 +3167,7 @@ void LocalFrame::RequestExecuteScript(
+@@ -3170,7 +3171,7 @@ void LocalFrame::RequestExecuteScript(
    PausableScriptExecutor::CreateAndRun(
        script_state, std::move(script_sources), execute_script_policy,
        user_gesture, evaluation_timing, blocking_option, want_result_option,
@@ -85,10 +85,10 @@ index 91d67a69cddcb7ae4425b893f625e40975e665cc..712f72bddbd7bae782b468659bc7e2b0
  
  void LocalFrame::SetEvictCachedSessionStorageOnFreezeOrUnload() {
 diff --git a/third_party/blink/renderer/core/frame/local_frame.h b/third_party/blink/renderer/core/frame/local_frame.h
-index fb7996c44af6d56c76293e839b887a5ebdb5b6b6..a916747d3ab4a329d4f4138db4543ddf6cc7e21d 100644
+index af3627cbc41dec055033dc433a68959483306bb6..ce55bb0104b264409dc4d402681718c3c5750b47 100644
 --- a/third_party/blink/renderer/core/frame/local_frame.h
 +++ b/third_party/blink/renderer/core/frame/local_frame.h
-@@ -824,6 +824,7 @@ class CORE_EXPORT LocalFrame final
+@@ -825,6 +825,7 @@ class CORE_EXPORT LocalFrame final
                              mojom::blink::EvaluationTiming,
                              mojom::blink::LoadEventBlockingOption,
                              WebScriptExecutionCallback,

+ 5 - 5
patches/chromium/fix_select_the_first_menu_item_when_opened_via_keyboard.patch

@@ -6,12 +6,12 @@ Subject: fix: select the first menu item when opened via keyboard
 This fixes an accessibility issue where the root view is 'focused' to the screen reader instead of the first menu item as with all other native menus. This patch will be upstreamed.
 
 diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
-index 3a406a6489f4254ba364f165c5a636dbb4f1dad6..4180518615b0dfa49ce0998c1ea52e81ec451ede 100644
+index 68d61ad5c27a84e6fcb5b8eabf332eca924b89c1..6c76aa9634024f9d5e63ac0a9ac359cfc5da59ed 100644
 --- a/ui/views/controls/menu/menu_controller.cc
 +++ b/ui/views/controls/menu/menu_controller.cc
-@@ -648,6 +648,14 @@ void MenuController::Run(Widget* parent,
-   // Set the selection, which opens the initial menu.
-   SetSelection(root, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
+@@ -699,6 +699,14 @@ void MenuController::Run(Widget* parent,
+     SetSelection(root, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
+   }
  
 +  if (source_type == ui::mojom::MenuSourceType::kKeyboard && context_menu && root->HasSubmenu()) {
 +    // For context menus opened via the keyboard we select the first item by default
@@ -24,7 +24,7 @@ index 3a406a6489f4254ba364f165c5a636dbb4f1dad6..4180518615b0dfa49ce0998c1ea52e81
    if (button_controller) {
      pressed_lock_ = button_controller->TakeLock(
          false, ui::LocatedEvent::FromIfValid(event));
-@@ -2299,19 +2307,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
+@@ -2405,19 +2413,15 @@ void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
      }
      item->GetSubmenu()->ShowAt(params);
  

+ 1 - 1
patches/chromium/fix_software_compositing_infinite_loop.patch

@@ -10,7 +10,7 @@ process CompositingModeFallbackToSoftware IPC to disable GPU compositing.
 https://issues.chromium.org/345275130
 
 diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc
-index 8867d474051064a8010a284adfd8205d3b9b0035..ebb7d366d1cfd3fb798127d5e22843056154c3d7 100644
+index 7253162094080c992bbb9f58dd9856d75a1f7476..14b74a675f7363b7aa3449459e0034f21d31dd87 100644
 --- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc
 +++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_view.cc
 @@ -387,9 +387,13 @@ void LayerTreeView::DidFailToInitializeLayerTreeFrameSink() {

+ 3 - 3
patches/chromium/fix_use_delegated_generic_capturer_when_available.patch

@@ -15,10 +15,10 @@ capturer was window or screen-specific, as the IDs remain valid for
 generic capturer as well.
 
 diff --git a/content/browser/media/capture/desktop_capture_device.cc b/content/browser/media/capture/desktop_capture_device.cc
-index fba9bdf62541ddd7f81eb32cfc5fb8565a5b325f..43b17972602a14e7db0de229958448a6badc75a4 100644
+index 3ba87e581e39253b483c977367eaba05c866ad55..835c1e860501bcc8cb7c7dfe192c113de3d623ff 100644
 --- a/content/browser/media/capture/desktop_capture_device.cc
 +++ b/content/browser/media/capture/desktop_capture_device.cc
-@@ -812,8 +812,14 @@ std::unique_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create(
+@@ -811,8 +811,14 @@ std::unique_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create(
  
    switch (source.type) {
      case DesktopMediaID::TYPE_SCREEN: {
@@ -35,7 +35,7 @@ index fba9bdf62541ddd7f81eb32cfc5fb8565a5b325f..43b17972602a14e7db0de229958448a6
        if (screen_capturer && screen_capturer->SelectSource(source.id)) {
          capturer = std::make_unique<webrtc::DesktopAndCursorComposer>(
              std::move(screen_capturer), options);
-@@ -826,8 +832,14 @@ std::unique_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create(
+@@ -825,8 +831,14 @@ std::unique_ptr<media::VideoCaptureDevice> DesktopCaptureDevice::Create(
      }
  
      case DesktopMediaID::TYPE_WINDOW: {

+ 4 - 4
patches/chromium/frame_host_manager.patch

@@ -6,10 +6,10 @@ Subject: frame_host_manager.patch
 Allows embedder to intercept site instances created by chromium.
 
 diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc
-index a0da3098c6391a9b07f40275cb09fb351fde9f7f..d5846a800b9a9097a6fa7cd097646ef357331870 100644
+index d010f86a3304b950e456cf83bdd6c281e3311a88..a92056e3e5588f4d57358cdee2ac6341e97ff691 100644
 --- a/content/browser/renderer_host/render_frame_host_manager.cc
 +++ b/content/browser/renderer_host/render_frame_host_manager.cc
-@@ -4676,6 +4676,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
+@@ -4690,6 +4690,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
      request->ResetStateForSiteInstanceChange();
    }
  
@@ -20,10 +20,10 @@ index a0da3098c6391a9b07f40275cb09fb351fde9f7f..d5846a800b9a9097a6fa7cd097646ef3
  }
  
 diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
-index f2f7571b76542bd4c0d44750639e36b191cd5bd7..44309e7bad6a23a3ceb28e3acf974edcf1b1a51d 100644
+index 87388bf398413d963a4902bfbd43e6509982fb33..8b2eb6d12c9d7d03169a96f32a60214bcfbc25e0 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -343,6 +343,11 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -340,6 +340,11 @@ class CONTENT_EXPORT ContentBrowserClient {
  
    virtual ~ContentBrowserClient() = default;
  

+ 1 - 1
patches/chromium/gin_enable_disable_v8_platform.patch

@@ -38,7 +38,7 @@ index 7053a5619c6ff6bced75572d7a3336f532b8bb81..89bbc161b99846c1f9e9585e98dd9056
    // Returns whether `Initialize` has already been invoked in the process.
    // Initialization is a one-way operation (i.e., this method cannot return
 diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc
-index c6664dd605587bb1d20f3f2c492999386c5d5446..ea22d21b80de2ffb99809df3abd7c0fa1a098481 100644
+index 39c71434bbb82d20e53acd041d289a845bf2ac3e..587dcfb97712aa6422ac01625a81e6c59c84ac2f 100644
 --- a/gin/v8_initializer.cc
 +++ b/gin/v8_initializer.cc
 @@ -541,7 +541,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,

+ 2 - 2
patches/chromium/gritsettings_resource_ids.patch

@@ -6,10 +6,10 @@ Subject: gritsettings_resource_ids.patch
 Add electron resources file to the list of resource ids generation.
 
 diff --git a/tools/gritsettings/resource_ids.spec b/tools/gritsettings/resource_ids.spec
-index 8cc75da1353df9bbfdd79274a46a2b7d8c195f80..17f57d0f9260536a8eafed228a2bb3cbb021fcf4 100644
+index c460dc28021e84cc84309b5973c41bd6f362f319..c5d9c5e1d4985f94e5b503c29e2c820a6b67150d 100644
 --- a/tools/gritsettings/resource_ids.spec
 +++ b/tools/gritsettings/resource_ids.spec
-@@ -1403,6 +1403,11 @@
+@@ -1415,6 +1415,11 @@
    "<(SHARED_INTERMEDIATE_DIR)/third_party/blink/public/strings/permission_element_generated_strings.grd": {
      "META": {"sizes": {"messages": [2000],}},
      "messages": [10080],

+ 1 - 1
patches/chromium/gtk_visibility.patch

@@ -6,7 +6,7 @@ Subject: gtk_visibility.patch
 Allow electron to depend on GTK in the GN build.
 
 diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn
-index 1ea983ca1f613a9a5b12375196fbf6a61960c90f..38d7d54ce7715ebe4e3b25e08c57d29f3be2cba8 100644
+index 4498487579ba5f4c7d8292f65c1afed16e41bb03..4ea4f38a91f02700373cb97e39125dcb0469b70b 100644
 --- a/build/config/linux/gtk/BUILD.gn
 +++ b/build/config/linux/gtk/BUILD.gn
 @@ -27,6 +27,7 @@ pkg_config("gtk_internal_config") {

+ 2 - 2
patches/chromium/load_v8_snapshot_in_browser_process.patch

@@ -9,10 +9,10 @@ but due to the nature of electron, we need to load the v8 snapshot
 in the browser process.
 
 diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
-index 74d648de9172e8610d1c665cb5dfd6c8da69e96d..2ea73bf0f0e16ad01e547bb0ec8082ddd02286c2 100644
+index 8c20f50669a20dd7e3c0592bce3f5bfd2a29e960..9078848b53976b7f63bb08140da942d66bd424ca 100644
 --- a/content/app/content_main_runner_impl.cc
 +++ b/content/app/content_main_runner_impl.cc
-@@ -301,11 +301,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
+@@ -294,11 +294,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
  
  bool ShouldLoadV8Snapshot(const base::CommandLine& command_line,
                            const std::string& process_type) {

+ 2 - 2
patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch

@@ -9,10 +9,10 @@ be created for each child process, despite logs being redirected to a
 file.
 
 diff --git a/content/app/content_main.cc b/content/app/content_main.cc
-index c37f18d794ae279eb52c55a62fcc36bcfa55042b..e8dc3a1ae470d77cdfeb4bb6e027dc32400540cc 100644
+index 6cb1ea690dce955bf460b08071338e248c147c76..e3649d3340d69690edb43509616a52acbaeb401a 100644
 --- a/content/app/content_main.cc
 +++ b/content/app/content_main.cc
-@@ -326,16 +326,14 @@ NO_STACK_PROTECTOR int RunContentProcess(
+@@ -319,16 +319,14 @@ NO_STACK_PROTECTOR int RunContentProcess(
  
  #if BUILDFLAG(IS_WIN)
      base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();

+ 58 - 57
patches/chromium/mas_avoid_private_macos_api_usage.patch.patch

@@ -35,10 +35,10 @@ system font by checking if it's kCTFontPriorityAttribute is set to
 system priority.
 
 diff --git a/base/BUILD.gn b/base/BUILD.gn
-index 123b5d982c3bca4ebd22b5e0e17b9d903969d7e1..0cacd08e17f8ab8c0e4951bcc4645cd7a3d2fea8 100644
+index a3adebbb867322d4f9371e55c3ee6e080fb2228c..0df9633a837c2353fc6e481e47b342432a019850 100644
 --- a/base/BUILD.gn
 +++ b/base/BUILD.gn
-@@ -1027,6 +1027,7 @@ component("base") {
+@@ -1028,6 +1028,7 @@ component("base") {
      "//build:ios_buildflags",
      "//build/config/compiler:compiler_buildflags",
      "//third_party/modp_b64",
@@ -174,10 +174,10 @@ index 94a028be3c315edc0056408ab9ab41b6b001a1c1..abf9003bc71506d389ff77dc708c8971
  
  }  // namespace base
 diff --git a/components/os_crypt/sync/BUILD.gn b/components/os_crypt/sync/BUILD.gn
-index c4df04713a7f76c2ff50c1d2bc750e18bb1865e0..0392602987d99b4e5d776408e75ea605fe6550c4 100644
+index c85da95a847384311429febab48fd10c8f8e68f4..d3b18d08a74e88929066fc5156bbf72b3b443950 100644
 --- a/components/os_crypt/sync/BUILD.gn
 +++ b/components/os_crypt/sync/BUILD.gn
-@@ -48,6 +48,7 @@ component("os_crypt") {
+@@ -47,6 +47,7 @@ component("os_crypt") {
        "os_crypt_mac.mm",
      ]
      deps += [ "//crypto:mock_apple_keychain" ]
@@ -186,10 +186,10 @@ index c4df04713a7f76c2ff50c1d2bc750e18bb1865e0..0392602987d99b4e5d776408e75ea605
  
    if (is_win) {
 diff --git a/components/os_crypt/sync/keychain_password_mac.mm b/components/os_crypt/sync/keychain_password_mac.mm
-index e7a65e97b51d93bff864889813317fb7c6ffc846..bb1fc0c99164ae4bdaaaa78e87c30e88932a928c 100644
+index ad374646d1a78f61d3924d6d9bb1144c57b7be98..a7fa25575be84d1dabb04bdc458e2a6d4358ddc1 100644
 --- a/components/os_crypt/sync/keychain_password_mac.mm
 +++ b/components/os_crypt/sync/keychain_password_mac.mm
-@@ -13,6 +13,7 @@
+@@ -15,6 +15,7 @@
  #include "base/rand_util.h"
  #include "build/branding_buildflags.h"
  #include "crypto/apple_keychain.h"
@@ -430,7 +430,7 @@ index 4f875587289f19b06041c5e8a7f76ab9cba169c9..952febab99656f59efee8c0d267d8f76
    bool shouldShowWindowTitle = YES;
    if (_bridge)
 diff --git a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
-index 97f489043beb4260b1a3ca1781ce7ef67ec8c88a..569859297618cac39aa36655b9e301224ed11f71 100644
+index 84fb8324e4d573528f675a1cc0f8b72596e7f02f..07c3997e6565cf77362ee73959c4d21da4fefe96 100644
 --- a/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
 +++ b/components/remote_cocoa/app_shim/native_widget_ns_window_bridge.mm
 @@ -41,6 +41,7 @@
@@ -441,7 +441,7 @@ index 97f489043beb4260b1a3ca1781ce7ef67ec8c88a..569859297618cac39aa36655b9e30122
  #include "mojo/public/cpp/bindings/self_owned_receiver.h"
  #include "net/cert/x509_util_apple.h"
  #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
-@@ -654,10 +655,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
+@@ -655,10 +656,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
    // this should be treated as an error and caught early.
    CHECK(bridged_view_);
  
@@ -455,7 +455,7 @@ index 97f489043beb4260b1a3ca1781ce7ef67ec8c88a..569859297618cac39aa36655b9e30122
    // Beware: This view was briefly removed (in favor of a bare CALayer) in
    // https://crrev.com/c/1236675. The ordering of unassociated layers relative
 diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
-index 2fa9063bb7c2ffff4fec6cf91aa7b6bf1d9ea875..6c661c1766f987297ef1fd5c45069a63209826a3 100644
+index 51ef96b33691fc642037ca951eb345200fff36e2..664df443242ae9af565cc83786398d68e6d655c4 100644
 --- a/components/viz/service/BUILD.gn
 +++ b/components/viz/service/BUILD.gn
 @@ -381,6 +381,7 @@ viz_component("service") {
@@ -466,7 +466,7 @@ index 2fa9063bb7c2ffff4fec6cf91aa7b6bf1d9ea875..6c661c1766f987297ef1fd5c45069a63
    }
  
    if (is_android || use_ozone) {
-@@ -660,6 +661,7 @@ viz_source_set("unit_tests") {
+@@ -662,6 +663,7 @@ viz_source_set("unit_tests") {
        "display_embedder/software_output_device_mac_unittest.mm",
      ]
      frameworks = [ "IOSurface.framework" ]
@@ -560,12 +560,12 @@ index faddee802d6538c092ba96914184663ee57751c8..49238975848d58cd30727ec818bbac52
    return kAttributes;
  }
 diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
-index f22893989f09e40a8eb6a3df1d48d5438426c727..1212cd37acff7847ec4a7d3fb841426d5a77576d 100644
+index fdf953e7e2e8e37658b9e780982d3b63c87dd206..80aa68aef42c4a8511824f30f641689636acf446 100644
 --- a/content/browser/BUILD.gn
 +++ b/content/browser/BUILD.gn
-@@ -328,6 +328,7 @@ source_set("browser") {
-     "//ui/strings:ax_strings",
+@@ -327,6 +327,7 @@ source_set("browser") {
      "//ui/touch_selection",
+     "//ui/webui/resources",
      "//v8:v8_version",
 +    "//electron/build/config:generate_mas_config",
    ]
@@ -606,7 +606,7 @@ index 2285564db47ef15eb9a83affd1e481b5671c3940..cf5e79a5540d8208c34579d7e8b5a571
    // Used to force the NSApplication's focused accessibility element to be the
    // content::BrowserAccessibilityCocoa accessibility tree when the NSView for
 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 34fb29866785ef07c6dca4cfc85966df1c479b5f..e305d25a8f2a34ac90f4d503a9c74dcc6c553cdf 100644
+index 8f1cdd296e5477ddd8a176d5aad7d05888729a45..2d06056f1e51ce76398168254152ccc04e596192 100644
 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
 +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
 @@ -48,6 +48,7 @@
@@ -651,7 +651,7 @@ index 34fb29866785ef07c6dca4cfc85966df1c479b5f..e305d25a8f2a34ac90f4d503a9c74dcc
  }
  
  bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
-@@ -2212,20 +2219,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
+@@ -2215,20 +2222,26 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
  void RenderWidgetHostViewMac::GetRenderWidgetAccessibilityToken(
      GetRenderWidgetAccessibilityTokenCallback callback) {
    base::ProcessId pid = getpid();
@@ -679,10 +679,10 @@ index 34fb29866785ef07c6dca4cfc85966df1c479b5f..e305d25a8f2a34ac90f4d503a9c74dcc
  
  ///////////////////////////////////////////////////////////////////////////////
 diff --git a/content/common/BUILD.gn b/content/common/BUILD.gn
-index d8243ca31b40940f79892cf74a0d9dbbec7d8272..df320813ebc67ea16d6c93c7f2905196be5ef44f 100644
+index 059a2c0b563ed90f11b5ff8ab02324bdb836007e..da0ef200767b4839c583c684d02e1d25905597cd 100644
 --- a/content/common/BUILD.gn
 +++ b/content/common/BUILD.gn
-@@ -286,6 +286,7 @@ source_set("common") {
+@@ -285,6 +285,7 @@ source_set("common") {
      "//ui/shell_dialogs",
      "//url",
      "//url/ipc:url_ipc",
@@ -691,10 +691,10 @@ index d8243ca31b40940f79892cf74a0d9dbbec7d8272..df320813ebc67ea16d6c93c7f2905196
  
    defines = []
 diff --git a/content/renderer/BUILD.gn b/content/renderer/BUILD.gn
-index 55a3baeeec34e9e89b75e93cd17486baef6e550e..cdd5750c7a84e38501e4b6d24e6a2c365b9ce5f1 100644
+index 4e886e0444991ae26163d53ebc1a0b9c18b7e496..9dcda56933881bcfc3f088e0606fadf9f83c2714 100644
 --- a/content/renderer/BUILD.gn
 +++ b/content/renderer/BUILD.gn
-@@ -334,6 +334,7 @@ target(link_target_type, "renderer") {
+@@ -327,6 +327,7 @@ target(link_target_type, "renderer") {
      "//ui/surface",
      "//url",
      "//v8",
@@ -773,10 +773,10 @@ index a1068589ad844518038ee7bc15a3de9bc5cba525..1ff781c49f086ec8015c7d3c44567dbe
  
  }  // namespace content
 diff --git a/content/test/BUILD.gn b/content/test/BUILD.gn
-index 817e8ecdc6b15177d4cfa5cf44ad5fb1a5346393..106977501728d3216ec6f0a47005bc86c156f605 100644
+index 691f31285c50b9d4a1f1d4a13e8bd7fe4c22d439..55ec43993e3ee2e962901c671b3ea74657422bff 100644
 --- a/content/test/BUILD.gn
 +++ b/content/test/BUILD.gn
-@@ -643,6 +643,7 @@ static_library("test_support") {
+@@ -642,6 +642,7 @@ static_library("test_support") {
      "//url",
      "//url/mojom:url_mojom_gurl",
      "//v8",
@@ -784,7 +784,7 @@ index 817e8ecdc6b15177d4cfa5cf44ad5fb1a5346393..106977501728d3216ec6f0a47005bc86
    ]
  
    data_deps = [
-@@ -1118,6 +1119,7 @@ static_library("browsertest_support") {
+@@ -1102,6 +1103,7 @@ static_library("browsertest_support") {
    }
  
    configs += [ "//v8:external_startup_data" ]
@@ -792,15 +792,15 @@ index 817e8ecdc6b15177d4cfa5cf44ad5fb1a5346393..106977501728d3216ec6f0a47005bc86
  }
  
  mojom("content_test_mojo_bindings") {
-@@ -1952,6 +1954,7 @@ test("content_browsertests") {
+@@ -1936,6 +1938,7 @@ test("content_browsertests") {
      "//ui/shell_dialogs",
      "//ui/snapshot",
      "//ui/webui:test_support",
 +    "//electron/build/config:generate_mas_config"
    ]
  
-   if (!(is_chromeos_ash && target_cpu == "arm64" && current_cpu == "arm")) {
-@@ -3245,6 +3248,7 @@ test("content_unittests") {
+   if (!(is_chromeos && target_cpu == "arm64" && current_cpu == "arm")) {
+@@ -3231,6 +3234,7 @@ test("content_unittests") {
      "//ui/latency:test_support",
      "//ui/shell_dialogs:shell_dialogs",
      "//ui/webui:test_support",
@@ -809,10 +809,10 @@ index 817e8ecdc6b15177d4cfa5cf44ad5fb1a5346393..106977501728d3216ec6f0a47005bc86
  
    if (enable_nocompile_tests) {
 diff --git a/content/web_test/BUILD.gn b/content/web_test/BUILD.gn
-index 99e612f705c5dff041454802033564085718260a..aa37555d9a9c0fda19d0096d035c245eca5ca0c6 100644
+index 8779cf7cbbe2a583fda51867eaebc627f00bd4cd..98da1587fdc8cc8358a69db2b51d39820a0b15f3 100644
 --- a/content/web_test/BUILD.gn
 +++ b/content/web_test/BUILD.gn
-@@ -228,6 +228,7 @@ static_library("web_test_browser") {
+@@ -227,6 +227,7 @@ static_library("web_test_browser") {
      "//ui/gl",
      "//ui/shell_dialogs:shell_dialogs",
      "//url",
@@ -821,7 +821,7 @@ index 99e612f705c5dff041454802033564085718260a..aa37555d9a9c0fda19d0096d035c245e
  
    # TODO(crbug.com/40139469): Blink test plugin must be migrated from PPAPI.
 diff --git a/device/bluetooth/BUILD.gn b/device/bluetooth/BUILD.gn
-index 1fb121f31d7a4817a7934d75972a527adecdc91e..35703443b285256286276744e1f6c9f40ed8d595 100644
+index f2164b5fcc5282820b343df8bde70700374b81be..2a04f4f7f0f9203ebf57c8d1e12d127c8bf35527 100644
 --- a/device/bluetooth/BUILD.gn
 +++ b/device/bluetooth/BUILD.gn
 @@ -258,6 +258,7 @@ component("bluetooth") {
@@ -1373,7 +1373,7 @@ index eb81a70e4d5d5cd3e6ae9b45f8cd1c795ea76c51..9921ccb10d3455600eddd85f77f10228
  
  }  // namespace sandbox
 diff --git a/third_party/blink/renderer/core/BUILD.gn b/third_party/blink/renderer/core/BUILD.gn
-index 407169fd5aab525cb249890d49a23ac301ab61d8..19ca594bf376344bcf27a17dab276271379a30e5 100644
+index 2bb0f07955ab848241d03551d218b7d667cd960f..d5e2856bda37bb6cb1f958fadee41047888c20d8 100644
 --- a/third_party/blink/renderer/core/BUILD.gn
 +++ b/third_party/blink/renderer/core/BUILD.gn
 @@ -409,6 +409,7 @@ component("core") {
@@ -1449,7 +1449,7 @@ index b11c365f42dd1ddc363de0d94c387b13ac65bef3..5da42beb20b514396287cc6dc5cba608
    // The root CALayer to display the current frame. This does not change
    // over the lifetime of the object.
 diff --git a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
-index b99461d52e3a62b58330691e65f9956748cfbf02..f0c3bb1b809a29eee3d990b0a8bbffddb7500895 100644
+index fd4356bd9a81b01de51c59dcd6637be2b2d8b6ee..ffc0b4e8aaa186840905cfc8b9efcd77e31d7617 100644
 --- a/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
 +++ b/ui/accelerated_widget_mac/ca_layer_tree_coordinator.mm
 @@ -10,6 +10,7 @@
@@ -1533,17 +1533,18 @@ index 2f7f2a8f81ec0e033cb83f82daac4835a2863cbc..21388d7de99fbb97c79eecbab658934d
  
      if (is_ios) {
 diff --git a/ui/accessibility/platform/browser_accessibility_manager_mac.mm b/ui/accessibility/platform/browser_accessibility_manager_mac.mm
-index be442f6a2a67d07ec78fe00a3e864bf0088fe504..2332199d02b98f53375b4e3e40e25018cb584228 100644
+index 302e40d573b0a102019cb15c0c615f99c7765b1a..a671a0a3de1794ad9a81ddc0f01e615804a6b28b 100644
 --- a/ui/accessibility/platform/browser_accessibility_manager_mac.mm
 +++ b/ui/accessibility/platform/browser_accessibility_manager_mac.mm
-@@ -13,13 +13,16 @@
+@@ -13,6 +13,7 @@
  #include "base/task/single_thread_task_runner.h"
  #include "base/task/task_traits.h"
  #include "base/time/time.h"
 +#include "electron/mas.h"
  #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
+ #include "ui/accessibility/accessibility_features.h"
  #include "ui/accessibility/ax_role_properties.h"
- #include "ui/accessibility/platform/ax_platform_tree_manager_delegate.h"
+@@ -20,7 +21,9 @@
  #include "ui/accessibility/platform/ax_private_webkit_constants_mac.h"
  #import "ui/accessibility/platform/browser_accessibility_cocoa.h"
  #import "ui/accessibility/platform/browser_accessibility_mac.h"
@@ -1553,7 +1554,7 @@ index be442f6a2a67d07ec78fe00a3e864bf0088fe504..2332199d02b98f53375b4e3e40e25018
  
  namespace {
  
-@@ -227,6 +230,7 @@ void PostAnnouncementNotification(NSString* announcement,
+@@ -228,6 +231,7 @@ void PostAnnouncementNotification(NSString* announcement,
          return;
        }
  
@@ -1561,7 +1562,7 @@ index be442f6a2a67d07ec78fe00a3e864bf0088fe504..2332199d02b98f53375b4e3e40e25018
        BrowserAccessibilityManager* root_manager = GetManagerForRootFrame();
        if (root_manager) {
          BrowserAccessibilityManagerMac* root_manager_mac =
-@@ -249,6 +253,7 @@ void PostAnnouncementNotification(NSString* announcement,
+@@ -250,6 +254,7 @@ void PostAnnouncementNotification(NSString* announcement,
            return;
          }
        }
@@ -1569,7 +1570,7 @@ index be442f6a2a67d07ec78fe00a3e864bf0088fe504..2332199d02b98f53375b4e3e40e25018
  
        // Use native VoiceOver support for live regions.
        BrowserAccessibilityCocoa* retained_node = native_node;
-@@ -645,6 +650,7 @@ void PostAnnouncementNotification(NSString* announcement,
+@@ -662,6 +667,7 @@ void PostAnnouncementNotification(NSString* announcement,
      return window == [NSApp accessibilityFocusedWindow];
    }
  
@@ -1577,7 +1578,7 @@ index be442f6a2a67d07ec78fe00a3e864bf0088fe504..2332199d02b98f53375b4e3e40e25018
    // TODO(accessibility): We need a solution to the problem described below.
    // If the window is NSAccessibilityRemoteUIElement, there are some challenges:
    // 1. NSApp is the browser which spawned the PWA, and what it considers the
-@@ -673,6 +679,7 @@ void PostAnnouncementNotification(NSString* announcement,
+@@ -690,6 +696,7 @@ void PostAnnouncementNotification(NSString* announcement,
    if ([window isKindOfClass:[NSAccessibilityRemoteUIElement class]]) {
      return true;
    }
@@ -1614,10 +1615,10 @@ index c8171f0527fe5194f0ea73b57c4444d4c630fbc4..c2ac4da580e3e7f749a0a4de1e859af6
    // Accessible object
    if (AXElementWrapper::IsValidElement(value)) {
 diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
-index 7ef725523fa1b660d589f20cc338052f82a9baf7..61a712df5c7829c320f0f80d859fcf9c840e8022 100644
+index 9e7e6095f30b12dde1a89b153a355225f1dd8d97..0c6da25be3c18c142027aa48cea4d5caed69a322 100644
 --- a/ui/base/BUILD.gn
 +++ b/ui/base/BUILD.gn
-@@ -358,6 +358,13 @@ component("base") {
+@@ -362,6 +362,13 @@ component("base") {
      ]
    }
  
@@ -1631,7 +1632,7 @@ index 7ef725523fa1b660d589f20cc338052f82a9baf7..61a712df5c7829c320f0f80d859fcf9c
    if (is_ios) {
      sources += [
        "device_form_factor_ios.mm",
-@@ -508,6 +515,12 @@ component("base") {
+@@ -512,6 +519,12 @@ component("base") {
      "//url",
    ]
  
@@ -1737,7 +1738,7 @@ index fc25ba79d2b0e1acdb7ba54b89e7d6e16f94771b..de771ef414b9a69e331261524f08e9a1
  
  }  // namespace
 diff --git a/ui/display/BUILD.gn b/ui/display/BUILD.gn
-index fe7a2787f8b5d25a0c11f7ccc3cf00fa9038231a..d62e60c93b9725b625e7f5d0c011c7363d739917 100644
+index eea9eb92fadfcb72adfffffb0e43082a79bcf3a7..dd2110c1e9393f7ad33a0e64c09ef732b3292a54 100644
 --- a/ui/display/BUILD.gn
 +++ b/ui/display/BUILD.gn
 @@ -125,6 +125,12 @@ component("display") {
@@ -1784,7 +1785,7 @@ index 29ae2da6a8a2c2a612dfb92f7f9c03ca5fa306b1..440c139a32a0c205e77b657d4aab6468
    // Query the display's refresh rate.
    if (@available(macos 12.0, *)) {
 diff --git a/ui/gfx/BUILD.gn b/ui/gfx/BUILD.gn
-index 7cd8da2e1a8caf38348d2f56799979a4f1809e7b..d6cbea3a4768ad0e884257fce8db004b1d3b0d72 100644
+index e912566bc5216474b9bdec4b5bcc8c15fb868346..f333ab59936359e84b361d3ee928a25ae37d59d1 100644
 --- a/ui/gfx/BUILD.gn
 +++ b/ui/gfx/BUILD.gn
 @@ -329,6 +329,12 @@ component("gfx") {
@@ -1839,10 +1840,10 @@ index fe3f85073e31de487a08e57d7f9b07aa4eccf8f3..cf5b07203c8bd559a404600cc98cc8ec
      // enough.
      return PlatformFontMac::SystemFontType::kGeneral;
 diff --git a/ui/views/BUILD.gn b/ui/views/BUILD.gn
-index 0d4a2d809d3fa731af0bad5a9d5f50f5b0a838f4..059a995648ec07960ab3a3cd15cbcc7952ec472d 100644
+index 469c6beaa15995c4832d4f54c333cb4de6450b27..8b262cccfc27ac4b91d27a200191f65cf24c380b 100644
 --- a/ui/views/BUILD.gn
 +++ b/ui/views/BUILD.gn
-@@ -713,6 +713,8 @@ component("views") {
+@@ -715,6 +715,8 @@ component("views") {
        "IOSurface.framework",
        "QuartzCore.framework",
      ]
@@ -1851,7 +1852,7 @@ index 0d4a2d809d3fa731af0bad5a9d5f50f5b0a838f4..059a995648ec07960ab3a3cd15cbcc79
    }
  
    if (is_win) {
-@@ -1130,6 +1132,8 @@ source_set("test_support") {
+@@ -1132,6 +1134,8 @@ source_set("test_support") {
      "//ui/base/mojom:ui_base_types",
    ]
  
@@ -1861,7 +1862,7 @@ index 0d4a2d809d3fa731af0bad5a9d5f50f5b0a838f4..059a995648ec07960ab3a3cd15cbcc79
      sources += [
        "test/desktop_window_tree_host_win_test_api.cc",
 diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h
-index 81979cdb6c5dbad84ea67ef9014ce4027bcdc161..daeda64747dcbcd05f34e77079be701c5b281e7d 100644
+index 6a18c94e8c9d531ab3a59faf6027848caed8de57..63aa6b3ba824a3fa71c5a3db94b9ac5e8d0ea7c0 100644
 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
 +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
 @@ -18,6 +18,7 @@
@@ -1872,7 +1873,7 @@ index 81979cdb6c5dbad84ea67ef9014ce4027bcdc161..daeda64747dcbcd05f34e77079be701c
  #include "mojo/public/cpp/bindings/associated_receiver.h"
  #include "mojo/public/cpp/bindings/associated_remote.h"
  #include "ui/accelerated_widget_mac/accelerated_widget_mac.h"
-@@ -32,7 +33,9 @@
+@@ -33,7 +34,9 @@
  #include "ui/views/window/dialog_observer.h"
  
  @class NativeWidgetMacNSWindow;
@@ -1882,7 +1883,7 @@ index 81979cdb6c5dbad84ea67ef9014ce4027bcdc161..daeda64747dcbcd05f34e77079be701c
  @class NSView;
  
  namespace remote_cocoa {
-@@ -483,10 +486,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
+@@ -487,10 +490,12 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
    mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
        remote_ns_window_remote_;
  
@@ -1896,7 +1897,7 @@ index 81979cdb6c5dbad84ea67ef9014ce4027bcdc161..daeda64747dcbcd05f34e77079be701c
    // Used to force the NSApplication's focused accessibility element to be the
    // views::Views accessibility tree when the NSView for this is focused.
 diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.mm b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
-index 9a915cb0c36b224b8b95fa84bc1909de4283776f..e402df17b4e7273c850d0bd822019ee9d0f669a9 100644
+index f7ddd05fd9a8165622ff45e182919a0588c53f80..0de4ff37eab3220a59ad1f90bcdd861170691fb5 100644
 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
 +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
 @@ -21,6 +21,7 @@
@@ -1907,10 +1908,10 @@ index 9a915cb0c36b224b8b95fa84bc1909de4283776f..e402df17b4e7273c850d0bd822019ee9
  #include "mojo/public/cpp/bindings/self_owned_associated_receiver.h"
  #include "ui/accelerated_widget_mac/window_resize_helper_mac.h"
  #include "ui/accessibility/accessibility_features.h"
-@@ -349,7 +350,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
- NativeWidgetMacNSWindowHost::GetNativeViewAccessibleForNSView() const {
-   if (in_process_ns_window_bridge_)
+@@ -352,7 +353,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
+   if (in_process_ns_window_bridge_) {
      return in_process_ns_window_bridge_->ns_view();
+   }
 +#if !IS_MAS_BUILD()
    return remote_view_accessible_;
 +#else
@@ -1919,7 +1920,7 @@ index 9a915cb0c36b224b8b95fa84bc1909de4283776f..e402df17b4e7273c850d0bd822019ee9
  }
  
  gfx::NativeViewAccessible
-@@ -364,7 +369,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
+@@ -367,7 +372,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
      return [in_process_ns_window_bridge_->ns_view() window];
    }
  
@@ -1931,7 +1932,7 @@ index 9a915cb0c36b224b8b95fa84bc1909de4283776f..e402df17b4e7273c850d0bd822019ee9
  }
  
  remote_cocoa::mojom::NativeWidgetNSWindow*
-@@ -1333,9 +1342,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
+@@ -1371,9 +1380,11 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
    // for PWAs. However this breaks accessibility on in-process windows,
    // so set it back to NO when a local window gains focus. See
    // https://crbug.com/41485830.
@@ -1942,8 +1943,8 @@ index 9a915cb0c36b224b8b95fa84bc1909de4283776f..e402df17b4e7273c850d0bd822019ee9
 +#endif
    // Explicitly set the keyboard accessibility state on regaining key
    // window status.
-   if (is_key && is_content_first_responder)
-@@ -1474,17 +1485,20 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
+   if (is_key && is_content_first_responder) {
+@@ -1514,17 +1525,20 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
  void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
      const std::vector<uint8_t>& window_token,
      const std::vector<uint8_t>& view_token) {
@@ -1964,7 +1965,7 @@ index 9a915cb0c36b224b8b95fa84bc1909de4283776f..e402df17b4e7273c850d0bd822019ee9
    *pid = getpid();
    id element_id = GetNativeViewAccessible();
  
-@@ -1497,6 +1511,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
+@@ -1537,6 +1551,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
    }
  
    *token = ui::RemoteAccessibility::GetTokenForLocalElement(element_id);

+ 13 - 13
patches/chromium/network_service_allow_remote_certificate_verification_logic.patch

@@ -7,10 +7,10 @@ This adds a callback from the network service that's used to implement
 session.setCertificateVerifyCallback.
 
 diff --git a/services/network/network_context.cc b/services/network/network_context.cc
-index 285d36e3da4194508bede07975e12f41c483310c..4dbe98cdc788442944fbee805720832e6121c9de 100644
+index 8d2e38ac65ca8f21907021e64701671965bd37fe..999c1daf2d4743cd9c67d716fbae762e76075d73 100644
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
-@@ -159,6 +159,11 @@
+@@ -158,6 +158,11 @@
  #include "services/network/web_transport.h"
  #include "url/gurl.h"
  
@@ -22,7 +22,7 @@ index 285d36e3da4194508bede07975e12f41c483310c..4dbe98cdc788442944fbee805720832e
  #if BUILDFLAG(IS_CT_SUPPORTED)
  // gn check does not account for BUILDFLAG(). So, for iOS builds, it will
  // complain about a missing dependency on the target exposing this header. Add a
-@@ -603,6 +608,99 @@ void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) {
+@@ -602,6 +607,99 @@ void RecordHSTSPreconnectUpgradeReason(HSTSRedirectUpgradeReason reason) {
  
  }  // namespace
  
@@ -122,7 +122,7 @@ index 285d36e3da4194508bede07975e12f41c483310c..4dbe98cdc788442944fbee805720832e
  constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
  
  NetworkContext::NetworkContextHttpAuthPreferences::
-@@ -999,6 +1097,13 @@ void NetworkContext::SetClient(
+@@ -998,6 +1096,13 @@ void NetworkContext::SetClient(
    client_.Bind(std::move(client));
  }
  
@@ -136,7 +136,7 @@ index 285d36e3da4194508bede07975e12f41c483310c..4dbe98cdc788442944fbee805720832e
  void NetworkContext::CreateURLLoaderFactory(
      mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
      mojom::URLLoaderFactoryParamsPtr params) {
-@@ -2568,6 +2673,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
+@@ -2567,6 +2672,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
          std::move(cert_verifier));
      cert_verifier = std::move(cert_verifier_with_trust_anchors);
  #endif  // BUILDFLAG(IS_CHROMEOS)
@@ -147,10 +147,10 @@ index 285d36e3da4194508bede07975e12f41c483310c..4dbe98cdc788442944fbee805720832e
  
    builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
 diff --git a/services/network/network_context.h b/services/network/network_context.h
-index a89e2187c8fb0d90318de19ebbb9dc6b5d407f6d..01b673a5d0796e15f63953455215dd0a1c306ff1 100644
+index 48ca96ecb24ad4eb140b44ce2459f8e0cacfb39f..15065587ab034faf47f6b31482a8eb52ba8de633 100644
 --- a/services/network/network_context.h
 +++ b/services/network/network_context.h
-@@ -114,6 +114,7 @@ class URLMatcher;
+@@ -113,6 +113,7 @@ class URLMatcher;
  }
  
  namespace network {
@@ -158,7 +158,7 @@ index a89e2187c8fb0d90318de19ebbb9dc6b5d407f6d..01b673a5d0796e15f63953455215dd0a
  class CookieManager;
  class HostResolver;
  class MdnsResponderManager;
-@@ -246,6 +247,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -245,6 +246,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    void CreateURLLoaderFactory(
        mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
        mojom::URLLoaderFactoryParamsPtr params) override;
@@ -167,7 +167,7 @@ index a89e2187c8fb0d90318de19ebbb9dc6b5d407f6d..01b673a5d0796e15f63953455215dd0a
    void ResetURLLoaderFactories() override;
    void GetViaObliviousHttp(
        mojom::ObliviousHttpRequestPtr request,
-@@ -937,6 +940,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -936,6 +939,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    std::vector<base::OnceClosure> dismount_closures_;
  #endif  // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
  
@@ -177,7 +177,7 @@ index a89e2187c8fb0d90318de19ebbb9dc6b5d407f6d..01b673a5d0796e15f63953455215dd0a
    std::unique_ptr<HostResolver> internal_host_resolver_;
    std::set<std::unique_ptr<HostResolver>, base::UniquePtrComparator>
 diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
-index 32c82e61a37b49f1177979f6f7d0fca158f836ad..6d7df96ea41ce10019285c927246208cb3001f8b 100644
+index 18a544729bbe5086469bf79b5d90b79ca4ad5c58..9bea63a5d08d80911385282a57f59f0322273d73 100644
 --- a/services/network/public/mojom/network_context.mojom
 +++ b/services/network/public/mojom/network_context.mojom
 @@ -306,6 +306,17 @@ struct SocketBrokerRemotes {
@@ -198,7 +198,7 @@ index 32c82e61a37b49f1177979f6f7d0fca158f836ad..6d7df96ea41ce10019285c927246208c
  // Parameters for constructing a network context.
  struct NetworkContextParams {
    // The user agent string.
-@@ -924,6 +935,9 @@ interface NetworkContext {
+@@ -934,6 +945,9 @@ interface NetworkContext {
    // Sets a client for this network context.
    SetClient(pending_remote<NetworkContextClient> client);
  
@@ -209,10 +209,10 @@ index 32c82e61a37b49f1177979f6f7d0fca158f836ad..6d7df96ea41ce10019285c927246208c
    CreateURLLoaderFactory(
        pending_receiver<URLLoaderFactory> url_loader_factory,
 diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
-index 2bcbb4fda66214ec24a9dacc69cebcdf58bb9f13..86430711eac5304c96486b0786b6ec3a26ce752b 100644
+index a8b1e362a81b678d163e4ed9455ecadec6084a1a..35076a426189b34f9d45bee37f7335815cab353b 100644
 --- a/services/network/test/test_network_context.h
 +++ b/services/network/test/test_network_context.h
-@@ -64,6 +64,8 @@ class TestNetworkContext : public mojom::NetworkContext {
+@@ -63,6 +63,8 @@ class TestNetworkContext : public mojom::NetworkContext {
    void CreateURLLoaderFactory(
        mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
        mojom::URLLoaderFactoryParamsPtr params) override {}

+ 14 - 14
patches/chromium/notification_provenance.patch

@@ -7,7 +7,7 @@ Pass RenderFrameHost through to PlatformNotificationService
 so Electron can identify which renderer a notification came from.
 
 diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
-index 8cf25ad02f187b60c72d3fc82f17ff7076f63fb7..2143ca591f3d1c389a95ae9ed388ff6070b3d557 100644
+index df1fb67901e872feef2602a0d8df5ec2c1984a43..08455c3d811fe1d51e15846dc6a68385f344d5aa 100644
 --- a/chrome/browser/notifications/platform_notification_service_impl.cc
 +++ b/chrome/browser/notifications/platform_notification_service_impl.cc
 @@ -221,6 +221,7 @@ bool PlatformNotificationServiceImpl::WasClosedProgrammatically(
@@ -19,7 +19,7 @@ index 8cf25ad02f187b60c72d3fc82f17ff7076f63fb7..2143ca591f3d1c389a95ae9ed388ff60
      const GURL& origin,
      const GURL& document_url,
 diff --git a/chrome/browser/notifications/platform_notification_service_impl.h b/chrome/browser/notifications/platform_notification_service_impl.h
-index c173f8a6cde9ab519075987fa451afb63c6580a9..4a1f128d9252a4a858d5ba8c6991bb183de7f064 100644
+index e76c702ed12cbc51a418ec8056abbd33b371bfb9..ead485e17a27ec0654cd681b988530286b327938 100644
 --- a/chrome/browser/notifications/platform_notification_service_impl.h
 +++ b/chrome/browser/notifications/platform_notification_service_impl.h
 @@ -57,6 +57,7 @@ class PlatformNotificationServiceImpl
@@ -31,10 +31,10 @@ index c173f8a6cde9ab519075987fa451afb63c6580a9..4a1f128d9252a4a858d5ba8c6991bb18
        const GURL& origin,
        const GURL& document_url,
 diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc
-index 027ba5088355441ed2dd1abe563277df7c1d3737..65837dcf0c2cd0bcc0c000fc3fe5eb2ddd6f7b5f 100644
+index 776c9b4bad591bb0174457caadf5bcab5ffc490b..b5475b328299d823c2cee8cae2fc9111ebc033cb 100644
 --- a/content/browser/notifications/blink_notification_service_impl.cc
 +++ b/content/browser/notifications/blink_notification_service_impl.cc
-@@ -87,12 +87,14 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
+@@ -84,12 +84,14 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl(
      BrowserContext* browser_context,
      scoped_refptr<ServiceWorkerContextWrapper> service_worker_context,
      RenderProcessHost* render_process_host,
@@ -48,8 +48,8 @@ index 027ba5088355441ed2dd1abe563277df7c1d3737..65837dcf0c2cd0bcc0c000fc3fe5eb2d
 +      render_frame_host_(render_frame_host),
        browser_context_(browser_context),
        service_worker_context_(std::move(service_worker_context)),
-       render_process_host_id_(render_process_host->GetID()),
-@@ -184,7 +186,7 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
+       render_process_host_id_(render_process_host->GetDeprecatedID()),
+@@ -181,7 +183,7 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification(
        creator_type_);
  
    browser_context_->GetPlatformNotificationService()->DisplayNotification(
@@ -79,10 +79,10 @@ index e7cc73f375ada7ee8715d331c3d372e0f59a0cdf..c0a142bea4a9a30c10dbb30c72fedce9
  
    scoped_refptr<ServiceWorkerContextWrapper> service_worker_context_;
 diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc
-index fe56b0bde4480765e5dffe5afb6ddf73ca8d63c8..93de0ace3dabf526d737897d42df35a5c2accab2 100644
+index 07e06ac6a3f14081f61f44620b537e5442419660..f2b8a977277c1f1ab014edd007d5df766b70f328 100644
 --- a/content/browser/notifications/blink_notification_service_impl_unittest.cc
 +++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc
-@@ -132,7 +132,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
+@@ -129,7 +129,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test {
      notification_service_ = std::make_unique<BlinkNotificationServiceImpl>(
          notification_context_.get(), &browser_context_,
          embedded_worker_helper_->context_wrapper(), &render_process_host_,
@@ -92,10 +92,10 @@ index fe56b0bde4480765e5dffe5afb6ddf73ca8d63c8..93de0ace3dabf526d737897d42df35a5
          contents_.get()->GetPrimaryMainFrame()->GetWeakDocumentPtr(),
          RenderProcessHost::NotificationServiceCreatorType::kDocument,
 diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
-index a5db92c83aa43375d4b1cdae77c2d5a78f13be29..a8c39d1153bae98259039cebfc1817436f951423 100644
+index 09ddcfdcf1bbdc35f8e2ad9c89e05f76a6231f68..e3e87a7d08cb2f55706d7d4f06245817811bc83b 100644
 --- a/content/browser/notifications/platform_notification_context_impl.cc
 +++ b/content/browser/notifications/platform_notification_context_impl.cc
-@@ -282,6 +282,7 @@ void PlatformNotificationContextImpl::Shutdown() {
+@@ -280,6 +280,7 @@ void PlatformNotificationContextImpl::Shutdown() {
  
  void PlatformNotificationContextImpl::CreateService(
      RenderProcessHost* render_process_host,
@@ -103,7 +103,7 @@ index a5db92c83aa43375d4b1cdae77c2d5a78f13be29..a8c39d1153bae98259039cebfc181743
      const blink::StorageKey& storage_key,
      const GURL& document_url,
      const WeakDocumentPtr& weak_document_ptr,
-@@ -290,7 +291,7 @@ void PlatformNotificationContextImpl::CreateService(
+@@ -288,7 +289,7 @@ void PlatformNotificationContextImpl::CreateService(
    DCHECK_CURRENTLY_ON(BrowserThread::UI);
    services_.push_back(std::make_unique<BlinkNotificationServiceImpl>(
        this, browser_context_, service_worker_context_, render_process_host,
@@ -133,10 +133,10 @@ index 05d3a12dd84c7005d46cc73b312f97ef418d96f5..4765de982802541b3efc7211d106acc7
        const GURL& document_url,
        const WeakDocumentPtr& weak_document_ptr,
 diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index fa95a56e761c7c0a1bf400392579e1c3f01d48d1..167462f298cafe0400d8326881c61e95ad1769d5 100644
+index bc2e3f9a2823dcce657ad13f09e8421c49fa7960..f2b5a9fbfc2a4bb4f9482fe64bf33fa9a739d5ce 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -2116,7 +2116,7 @@ void RenderProcessHostImpl::CreateNotificationService(
+@@ -2110,7 +2110,7 @@ void RenderProcessHostImpl::CreateNotificationService(
      case RenderProcessHost::NotificationServiceCreatorType::kSharedWorker:
      case RenderProcessHost::NotificationServiceCreatorType::kDedicatedWorker: {
        storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
@@ -145,7 +145,7 @@ index fa95a56e761c7c0a1bf400392579e1c3f01d48d1..167462f298cafe0400d8326881c61e95
            creator_type, std::move(receiver));
        break;
      }
-@@ -2124,7 +2124,7 @@ void RenderProcessHostImpl::CreateNotificationService(
+@@ -2118,7 +2118,7 @@ void RenderProcessHostImpl::CreateNotificationService(
        CHECK(rfh);
  
        storage_partition_impl_->GetPlatformNotificationContext()->CreateService(

+ 2 - 2
patches/chromium/partially_revert_is_newly_created_to_allow_for_browser_initiated.patch

@@ -10,10 +10,10 @@ an about:blank check to this area.
 Ref: https://chromium-review.googlesource.com/c/chromium/src/+/5403876
 
 diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
-index 90ed344e4714ea2f98feab48824e8273ea51d048..e9d0fb7ee9a2dc0241926e6d82bae8d6c11fc4d3 100644
+index 81add87623c24f1be3cbde3dfdf10495c4de228b..4875f2ad33e9d30b39e1adcd2861c409a4e2d9b6 100644
 --- a/content/browser/renderer_host/render_frame_host_impl.cc
 +++ b/content/browser/renderer_host/render_frame_host_impl.cc
-@@ -785,8 +785,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch(
+@@ -783,8 +783,8 @@ void VerifyThatBrowserAndRendererCalculatedOriginsToCommitMatch(
    // TODO(crbug.com/40092527): Consider adding a separate boolean that
    // tracks this instead of piggybacking `origin_calculation_debug_info`.
    if (renderer_side_origin.opaque() &&

+ 2 - 2
patches/chromium/picture-in-picture.patch

@@ -38,7 +38,7 @@ index 8168b4cfbafd42fa93a5aa9a3691c2552fabfb86..ba49212bd76d209f99c1cee649fc1466
                  ui::ImageModel::FromVectorIcon(*icon, kColorPipWindowForeground,
                                                 kCloseButtonIconSize));
 diff --git a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
-index d47fd98031164e316eade9444c3dfa1b209d10ee..1b0ea294197c6ceb4f260041aa7e5ca818bff84a 100644
+index 103e7664e19875f69a16e061b1a0230a519daa86..c42e2b6a1e83e2d0036f3e7d30a79be7bea544c7 100644
 --- a/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
 +++ b/chrome/browser/ui/views/overlay/video_overlay_window_views.cc
 @@ -18,9 +18,11 @@
@@ -62,7 +62,7 @@ index d47fd98031164e316eade9444c3dfa1b209d10ee..1b0ea294197c6ceb4f260041aa7e5ca8
  #include "chrome/browser/shell_integration_win.h"
  #include "content/public/browser/render_widget_host_view.h"
  #include "ui/aura/window.h"
-@@ -393,7 +395,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
+@@ -395,7 +397,7 @@ std::unique_ptr<VideoOverlayWindowViews> VideoOverlayWindowViews::Create(
    overlay_window->Init(std::move(params));
    overlay_window->OnRootViewReady();
  

+ 4 - 4
patches/chromium/port_autofill_colors_to_the_color_pipeline.patch

@@ -8,7 +8,7 @@ needed in chromium but our autofill implementation uses them.  This patch can be
 our autofill implementation to work like Chromium's.
 
 diff --git a/ui/color/color_id.h b/ui/color/color_id.h
-index c98a2d313f3d38290a561e46ae78c57b17b2e2e9..507df603b69796bf3bd5ecf231a64f9175cfeeec 100644
+index 0826e03e5601e64368b7ea3b15f9f7aeb14d10be..b05f8d05bfa9fe4b3df55811644984aa09f0bf9b 100644
 --- a/ui/color/color_id.h
 +++ b/ui/color/color_id.h
 @@ -405,6 +405,10 @@
@@ -22,7 +22,7 @@ index c98a2d313f3d38290a561e46ae78c57b17b2e2e9..507df603b69796bf3bd5ecf231a64f91
    E_CPONLY(kColorSegmentedButtonBorder) \
    E_CPONLY(kColorSegmentedButtonFocus) \
    E_CPONLY(kColorSegmentedButtonForegroundChecked) \
-@@ -510,6 +514,7 @@
+@@ -511,6 +515,7 @@
    E_CPONLY(kColorTreeNodeForeground) \
    E_CPONLY(kColorTreeNodeForegroundSelectedFocused) \
    E_CPONLY(kColorTreeNodeForegroundSelectedUnfocused) \
@@ -31,7 +31,7 @@ index c98a2d313f3d38290a561e46ae78c57b17b2e2e9..507df603b69796bf3bd5ecf231a64f91
    /* ui::NativeThemeBase::ControlColorId. */ \
    E_CPONLY(kColorWebNativeControlAccent) \
 diff --git a/ui/color/ui_color_mixer.cc b/ui/color/ui_color_mixer.cc
-index 4e5eeb0dd92829bc58576b4d4d216fb0700fd2ca..1c5b929b97a97b97b9787e54ca35d2da96abd11b 100644
+index b563810bfe57739d2e574d7126927ed7921f8481..044c92a747e20a598c9de84ac93f143324f1dfb0 100644
 --- a/ui/color/ui_color_mixer.cc
 +++ b/ui/color/ui_color_mixer.cc
 @@ -181,6 +181,17 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) {
@@ -52,7 +52,7 @@ index 4e5eeb0dd92829bc58576b4d4d216fb0700fd2ca..1c5b929b97a97b97b9787e54ca35d2da
    mixer[kColorSeparator] = {kColorMidground};
    mixer[kColorShadowBase] = {dark_mode ? SK_ColorBLACK : gfx::kGoogleGrey800};
    mixer[kColorShadowValueAmbientShadowElevationThree] =
-@@ -276,6 +287,7 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) {
+@@ -277,6 +288,7 @@ void AddUiColorMixer(ColorProvider* provider, const ColorProviderKey& key) {
    mixer[kColorTreeNodeForegroundSelectedFocused] = {kColorTreeNodeForeground};
    mixer[kColorTreeNodeForegroundSelectedUnfocused] = {
        kColorTreeNodeForegroundSelectedFocused};

+ 12 - 12
patches/chromium/printing.patch

@@ -68,7 +68,7 @@ index 6f35d5ab358627ff8b1cbf09f5643f0f484e027a..5e736b846880a7d4a1e1611a0f70feca
                 : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
    }
 diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
-index 05d05dd3d2902947e2ddf9a3f9379abe0008d74e..8a65ef057271bbef16f1d596229a5976997aaa4b 100644
+index ff2fbe115134adedf7179502053a699a7594ea05..f934f190ac4fe56a20e2147e53a8edcc44191198 100644
 --- a/chrome/browser/printing/print_view_manager_base.cc
 +++ b/chrome/browser/printing/print_view_manager_base.cc
 @@ -83,6 +83,20 @@ namespace printing {
@@ -477,7 +477,7 @@ index 05d05dd3d2902947e2ddf9a3f9379abe0008d74e..8a65ef057271bbef16f1d596229a5976
 @@ -1310,6 +1371,8 @@ void PrintViewManagerBase::CompleteScriptedPrint(
    auto callback_wrapper = base::BindOnce(
        &PrintViewManagerBase::ScriptedPrintReply, weak_ptr_factory_.GetWeakPtr(),
-       std::move(callback), render_process_host->GetID());
+       std::move(callback), render_process_host->GetDeprecatedID());
 +  auto cancel_job_wrapper = base::BindOnce(
 +      &PrintViewManagerBase::UserInitCanceled, weak_ptr_factory_.GetWeakPtr());
  #if BUILDFLAG(IS_WIN) && BUILDFLAG(GOOGLE_CHROME_BRANDING)
@@ -630,7 +630,7 @@ index ca71560874a0189068dd11fbc039f5673bf6bd96..a8551d95e64da2afbc1685b2df8f1fc3
                        mojom::PrintFailureReason reason) override;
  
 diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
-index 3c2fdc9f9a6c60efc4b0afacbfb83eef55917791..8fd9aff538fa03da6c171927c316d4f611c46da1 100644
+index 6809c4576c71bc1e1a6ad4e0a37707272a9a10f4..3aad10424a6a31dab2ca393d00149ec6ec1ca646 100644
 --- a/components/printing/common/print.mojom
 +++ b/components/printing/common/print.mojom
 @@ -303,7 +303,7 @@ union PrintWithParamsResult {
@@ -653,7 +653,7 @@ index 3c2fdc9f9a6c60efc4b0afacbfb83eef55917791..8fd9aff538fa03da6c171927c316d4f6
    PrintingFailed(int32 cookie, PrintFailureReason reason);
  
 diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
-index e1e7623427eccb5f7e4d0caf4394b6ee01357049..a8ace3f66e5961a14726faf537ba428f45939f9b 100644
+index 18a8d64167b66d0de67c0c89779af90814b827c6..33079deee8720a447e2b4e1f3601542b59e1cf16 100644
 --- a/components/printing/renderer/print_render_frame_helper.cc
 +++ b/components/printing/renderer/print_render_frame_helper.cc
 @@ -52,6 +52,7 @@
@@ -730,7 +730,7 @@ index e1e7623427eccb5f7e4d0caf4394b6ee01357049..a8ace3f66e5961a14726faf537ba428f
 +  print_preview_context_.InitWithFrame(frame);
    print_preview_context_.OnPrintPreview();
  
- #if BUILDFLAG(IS_CHROMEOS_ASH)
+ #if BUILDFLAG(IS_CHROMEOS)
 @@ -2062,17 +2068,19 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
  
  void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
@@ -817,10 +817,10 @@ index e1e7623427eccb5f7e4d0caf4394b6ee01357049..a8ace3f66e5961a14726faf537ba428f
  }
  
 diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
-index b8c803184f267d87696c4e72c3d993ff3b69d95b..7278dfae56305cc8669fc2240563450f96bb6f52 100644
+index ce8ac0a7098c8cd6bc03738d03dffef6b5a34141..93fe9da2e5943876c22801e3934d695ee88c3ba3 100644
 --- a/components/printing/renderer/print_render_frame_helper.h
 +++ b/components/printing/renderer/print_render_frame_helper.h
-@@ -259,7 +259,7 @@ class PrintRenderFrameHelper
+@@ -258,7 +258,7 @@ class PrintRenderFrameHelper
        mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
  
    // printing::mojom::PrintRenderFrame:
@@ -829,7 +829,7 @@ index b8c803184f267d87696c4e72c3d993ff3b69d95b..7278dfae56305cc8669fc2240563450f
    void PrintWithParams(mojom::PrintPagesParamsPtr params,
                         PrintWithParamsCallback callback) override;
  #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
-@@ -326,7 +326,8 @@ class PrintRenderFrameHelper
+@@ -325,7 +325,8 @@ class PrintRenderFrameHelper
    // WARNING: |this| may be gone after this method returns.
    void Print(blink::WebLocalFrame* frame,
               const blink::WebNode& node,
@@ -839,7 +839,7 @@ index b8c803184f267d87696c4e72c3d993ff3b69d95b..7278dfae56305cc8669fc2240563450f
  
    // Notification when printing is done - signal tear-down/free resources.
    void DidFinishPrinting(PrintingResult result);
-@@ -336,7 +337,8 @@ class PrintRenderFrameHelper
+@@ -335,7 +336,8 @@ class PrintRenderFrameHelper
    // Initialize print page settings with default settings.
    // Used only for native printing workflow.
    bool InitPrintSettings(blink::WebLocalFrame* frame,
@@ -849,7 +849,7 @@ index b8c803184f267d87696c4e72c3d993ff3b69d95b..7278dfae56305cc8669fc2240563450f
  
    // Calculate number of pages in source document.
    uint32_t CalculateNumberOfPages(blink::WebLocalFrame* frame,
-@@ -634,7 +636,8 @@ class PrintRenderFrameHelper
+@@ -633,7 +635,8 @@ class PrintRenderFrameHelper
    };
  
    void SetupOnStopLoadingTimeout();
@@ -860,10 +860,10 @@ index b8c803184f267d87696c4e72c3d993ff3b69d95b..7278dfae56305cc8669fc2240563450f
    ScriptingThrottler scripting_throttler_;
  
 diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
-index 1212cd37acff7847ec4a7d3fb841426d5a77576d..a6fbe92d06d373ff9794035de88553b36f837e30 100644
+index 80aa68aef42c4a8511824f30f641689636acf446..80f8ec88683569ff7fd6a51b11e1a9de15527397 100644
 --- a/content/browser/BUILD.gn
 +++ b/content/browser/BUILD.gn
-@@ -3044,8 +3044,9 @@ source_set("browser") {
+@@ -3039,8 +3039,9 @@ source_set("browser") {
        "//ppapi/shared_impl",
      ]
  

+ 9 - 9
patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch

@@ -8,10 +8,10 @@ Chrome moved the SetCursor IPC message to mojo, which we use to tell OSR about `
 Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779
 
 diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h
-index dea7ba2237cea261fe0b526753e1a9c4e355e484..9e3bf5eca5e9ad99112069a28b7fb8c1dd41aed1 100644
+index 6469dd594bb984ba4cd8c1464e7891396a35d8b3..6af0932ff13b2223d2177a4f13bf4e4165a05080 100644
 --- a/content/browser/renderer_host/render_widget_host_delegate.h
 +++ b/content/browser/renderer_host/render_widget_host_delegate.h
-@@ -27,6 +27,7 @@
+@@ -28,6 +28,7 @@
  #include "ui/base/mojom/window_show_state.mojom-forward.h"
  #include "ui/base/ui_base_types.h"
  #include "ui/gfx/mojom/delegated_ink_point_renderer.mojom.h"
@@ -19,7 +19,7 @@ index dea7ba2237cea261fe0b526753e1a9c4e355e484..9e3bf5eca5e9ad99112069a28b7fb8c1
  #include "ui/gfx/native_widget_types.h"
  
  namespace blink {
-@@ -293,6 +294,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
+@@ -294,6 +295,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate {
    // Returns the associated RenderViewHostDelegateView*, if possible.
    virtual RenderViewHostDelegateView* GetDelegateView();
  
@@ -30,10 +30,10 @@ index dea7ba2237cea261fe0b526753e1a9c4e355e484..9e3bf5eca5e9ad99112069a28b7fb8c1
    // RenderWidgetHost on the primary main frame, and false otherwise.
    virtual bool IsWidgetForPrimaryMainFrame(RenderWidgetHostImpl*);
 diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
-index 9af5efcacb38453d3f92a3c2d9a42ad8817ef6d5..c877e1aff3216aaf881e35e704745be442c5ca69 100644
+index 6dac8bda9b799b2d20f7fa45d7323204b28631e1..99cbf072fda079c440114f0b58080f50698538f3 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
-@@ -1986,6 +1986,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
+@@ -2013,6 +2013,9 @@ void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
    if (view_) {
      view_->UpdateCursor(cursor);
    }
@@ -44,10 +44,10 @@ index 9af5efcacb38453d3f92a3c2d9a42ad8817ef6d5..c877e1aff3216aaf881e35e704745be4
  
  void RenderWidgetHostImpl::ShowContextMenuAtPoint(
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index b056a3dad69316b919c058458ee9de3ad4a88147..0b70b695a4d3990842f9c5909ef485b540d9be58 100644
+index 9175a4958c80451dc80205d10856cac40785140e..5d2cd8a69d78c81b7f1cd34e23e790aff79215a6 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -5647,6 +5647,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
+@@ -5678,6 +5678,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
    return text_input_manager_.get();
  }
  
@@ -60,10 +60,10 @@ index b056a3dad69316b919c058458ee9de3ad4a88147..0b70b695a4d3990842f9c5909ef485b5
      RenderWidgetHostImpl* render_widget_host) {
    return render_widget_host == GetPrimaryMainFrame()->GetRenderWidgetHost();
 diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
-index 670b1413075a265dc0892ab8213cd06e35bfe736..ce1f1f8c0f3c21bff8c3d1aa7a7eb2a8a569fc53 100644
+index 22d9e6831439563320bc6f8d924afcc208273557..545a18592d53e53240cc9b6729a8db530c3ea064 100644
 --- a/content/browser/web_contents/web_contents_impl.h
 +++ b/content/browser/web_contents/web_contents_impl.h
-@@ -1141,6 +1141,7 @@ class CONTENT_EXPORT WebContentsImpl
+@@ -1143,6 +1143,7 @@ class CONTENT_EXPORT WebContentsImpl
    void SendScreenRects() override;
    void SendActiveState(bool active) override;
    TextInputManager* GetTextInputManager() override;

+ 4 - 4
patches/chromium/refactor_expose_hostimportmoduledynamically_and.patch

@@ -7,7 +7,7 @@ Subject: refactor: expose HostImportModuleDynamically and
 This is so that Electron can blend Blink's and Node's implementations of these isolate handlers.
 
 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 98da84ea08da05a486651d188c3eb8d14a2002cf..4ce1c044cf70525bd9ab4fee5a94e55017313910 100644
+index 464528ea26471e5e0d834055b2119f9718f2f644..eb8c67dd8e65ca4a15eb5acdfa155d430555d360 100644
 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
 +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
 @@ -637,7 +637,9 @@ bool WasmJSPromiseIntegrationEnabledCallback(v8::Local<v8::Context> context) {
@@ -30,7 +30,7 @@ index 98da84ea08da05a486651d188c3eb8d14a2002cf..4ce1c044cf70525bd9ab4fee5a94e550
                                   v8::Local<v8::Module> module,
                                   v8::Local<v8::Object> meta) {
    v8::Isolate* isolate = context->GetIsolate();
-@@ -758,9 +760,6 @@ std::ostream& operator<<(std::ostream& os, const PrintV8OOM& oom_details) {
+@@ -762,9 +764,6 @@ std::ostream& operator<<(std::ostream& os, const PrintV8OOM& oom_details) {
    return os;
  }
  
@@ -40,7 +40,7 @@ index 98da84ea08da05a486651d188c3eb8d14a2002cf..4ce1c044cf70525bd9ab4fee5a94e550
  void V8Initializer::InitializeV8Common(v8::Isolate* isolate) {
    // Set up garbage collection before setting up anything else as V8 may trigger
    // GCs during Blink setup.
-@@ -780,9 +779,9 @@ void V8Initializer::InitializeV8Common(v8::Isolate* isolate) {
+@@ -784,9 +783,9 @@ void V8Initializer::InitializeV8Common(v8::Isolate* isolate) {
    isolate->SetWasmJSPIEnabledCallback(WasmJSPromiseIntegrationEnabledCallback);
    isolate->SetSharedArrayBufferConstructorEnabledCallback(
        SharedArrayBufferConstructorEnabledCallback);
@@ -49,9 +49,9 @@ index 98da84ea08da05a486651d188c3eb8d14a2002cf..4ce1c044cf70525bd9ab4fee5a94e550
    isolate->SetHostInitializeImportMetaObjectCallback(
 -      HostGetImportMetaProperties);
 +      V8Initializer::HostGetImportMetaProperties);
+   isolate->SetIsJSApiWrapperNativeErrorCallback(IsDOMExceptionWrapper);
    isolate->SetMetricsRecorder(std::make_shared<V8MetricsRecorder>(isolate));
  
- #if BUILDFLAG(IS_WIN)
 diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h b/third_party/blink/renderer/bindings/core/v8/v8_initializer.h
 index be5df8f98c3f7e308d79d43c1811a16c644b6158..5c25a3bb7f04ea74ee8587b158e125f4aa651912 100644
 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.h

+ 2 - 2
patches/chromium/refactor_restore_base_adaptcallbackforrepeating.patch

@@ -12,10 +12,10 @@ should be removed as soon as those have been updated. Patching because
 every instance is a FTBFS that prevents testing any one instance's fix.
 
 diff --git a/base/functional/callback_helpers.h b/base/functional/callback_helpers.h
-index 9b484a05b2fe317168d512d013c51d52259517b4..e73a46cd6b616e92be341a0a34450bee92ef5a53 100644
+index f1aa11fec7c0994ac19a26a02800f25de8f2f519..bbfdb3e4839ed96e4c6238235458a421c917411f 100644
 --- a/base/functional/callback_helpers.h
 +++ b/base/functional/callback_helpers.h
-@@ -100,6 +100,22 @@ RepeatingCallback<void(Args...)> ForwardRepeatingCallbacks(
+@@ -99,6 +99,22 @@ RepeatingCallback<void(Args...)> ForwardRepeatingCallbacks(
                         std::move(v));
  }
  

+ 2 - 2
patches/chromium/refactor_unfilter_unresponsive_events.patch

@@ -15,10 +15,10 @@ This CL removes these filters so the unresponsive event can still be
 accessed from our JS event. The filtering is moved into Electron's code.
 
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index e49fd4b3278b4a25af30ecc522794847440d4c50..6e38f593dfc53387e1bf12606314e0cd31918962 100644
+index 042f69afa3192e9161264c244499b76184f53e70..4b92604378e30c93b438e0b474b47d6cea2ec7a4 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -9635,25 +9635,13 @@ void WebContentsImpl::RendererUnresponsive(
+@@ -9684,25 +9684,13 @@ void WebContentsImpl::RendererUnresponsive(
      base::RepeatingClosure hang_monitor_restarter) {
    OPTIONAL_TRACE_EVENT1("content", "WebContentsImpl::RendererUnresponsive",
                          "render_widget_host", render_widget_host);

+ 0 - 80
patches/chromium/reland_set_app_container_acls_reliably_on_out_directory.patch

@@ -1,80 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Stefan Smolen <[email protected]>
-Date: Tue, 10 Dec 2024 19:38:18 +0000
-Subject: [reland] Set app container ACLs reliably on out directory
-
-This is a reland of:
-https://chromium-review.googlesource.com/c/chromium/src/+/6068009
-
-Reverted due to cross-compile failures. This cl adds host_os checks.
-
-Original description:
-> Sandbox on Windows relies on AppContainer sandbox for certain sandboxes.
-> The AppContainer sandbox requires that files loaded in those processes
-> have the right security attributes (ACLs), or they will not be allowed
-> to load. We can set the security attributes for a local build using the
-> icacls tool, which currently runs when //sandbox/win:sandbox target is
-> built, ensuring it happens as part of building chrome.dll.
->
-> The APIs used for ACL-ing by icacls are subject to race conditions when
-> files are generated in the folder while it's running, as is the case
-> with a chromium build for binaries such as component build dlls and
-> chrome_elf.dll.
->
-> This change resolves the race condition by ensuring the ACL-ing step
-> will happen via a DEPS of each executable target by default, which
-> should guarantee that icacls finishes running before we link any
-> binaries which require it.
-
-Bug: 379656387
-Change-Id: I45ee0d42934ab5cac4a24498f1f4ca9d0b3fb551
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6081378
-Reviewed-by: Dirk Pranke <[email protected]>
-Commit-Queue: Stefan Smolen <[email protected]>
-Reviewed-by: Will Harris <[email protected]>
-Cr-Commit-Position: refs/heads/main@{#1394456}
-
-diff --git a/build/config/BUILD.gn b/build/config/BUILD.gn
-index 6f8cb29dbb18a144f572f4fb32633d7bec080eb7..d32152894f3483fe8e7cecc74e9b302f5649da2b 100644
---- a/build/config/BUILD.gn
-+++ b/build/config/BUILD.gn
-@@ -272,12 +272,14 @@ group("common_deps_without_libcxx") {
-     # debugging DLLs in all builds.
-     data_deps = [ "//build/win:runtime_libs" ]
- 
--    # In order to ensure the ACLing is applied to every binary loaded in an
--    # app container sandbox, run the ACL step before any binary is built. We
--    # do this because the tool is subject to race conditions if a binary is
--    # placed in the out folder while it is running.
--    public_deps +=
--        [ "//build/config/win:maybe_set_appcontainer_acls($host_toolchain)" ]
-+    if (host_os == "win") {
-+      # In order to ensure the ACLing is applied to every binary loaded in an
-+      # app container sandbox, run the ACL step before any binary is built. We
-+      # do this because the tool is subject to race conditions if a binary is
-+      # placed in the out folder while it is running.
-+      public_deps +=
-+          [ "//build/config/win:maybe_set_appcontainer_acls($host_toolchain)" ]
-+    }
-   }
- }
- 
-diff --git a/build/config/win/BUILD.gn b/build/config/win/BUILD.gn
-index a75b2b09cf708ffb3d60a07cd31f78bc80075913..9928e76832cce20cead2531293d872b8af520336 100644
---- a/build/config/win/BUILD.gn
-+++ b/build/config/win/BUILD.gn
-@@ -483,12 +483,12 @@ config("delayloads_not_for_child_dll") {
- # sandboxed processes in an app container when run from the out directory.
- group("maybe_set_appcontainer_acls") {
-   # Exclude setting ACLs when build is not happening on chromium, or with a different toolchain.
--  if (build_with_chromium && current_cpu == target_cpu) {
-+  if (build_with_chromium && current_cpu == target_cpu && host_os == "win") {
-     deps = [ ":set_appcontainer_acls" ]
-   }
- }
- 
--if (build_with_chromium && current_cpu == target_cpu) {
-+if (build_with_chromium && current_cpu == target_cpu && host_os == "win") {
-   action("set_appcontainer_acls") {
-     script = "//build/win/set_appcontainer_acls.py"
-     stamp_file = "$target_out_dir/acls.stamp"

+ 1 - 1
patches/chromium/resource_file_conflict.patch

@@ -52,7 +52,7 @@ Some alternatives to this patch:
 None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
 
 diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
-index 07e27b38d7b8f9d9b97da052c5c0eb53e47cb077..3ea31014540b5679880a00e1a3ae8674b8858348 100644
+index 7ae2e00c79eb0764289a6666360abc897c531bbf..0a236366b3f5050fa5d07971404afa111e699ce8 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
 @@ -1560,7 +1560,7 @@ if (is_chrome_branded && !is_android) {

+ 143 - 0
patches/chromium/revert_code_health_clean_up_stale_macwebcontentsocclusion.patch

@@ -0,0 +1,143 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: David Sanders <[email protected]>
+Date: Wed, 8 Jan 2025 23:53:27 -0800
+Subject: Revert "Code Health: Clean up stale MacWebContentsOcclusion"
+
+Chrome has removed this WebContentsOcclusion feature flag upstream,
+which is now causing our visibility tests to break. This patch
+restores the legacy occlusion behavior to ensure the roll can continue
+while we debug the issue.
+
+This patch can be removed when the root cause because the visibility
+specs failing on MacOS only is debugged and fixed. It should be removed
+before Electron 35's stable date.
+
+Refs: https://chromium-review.googlesource.com/c/chromium/src/+/6078344
+
+This partially (leaves the removal of the feature flag) reverts
+ef865130abd5539e7bce12308659b19980368f12.
+
+diff --git a/content/app_shim_remote_cocoa/web_contents_view_cocoa.mm b/content/app_shim_remote_cocoa/web_contents_view_cocoa.mm
+index fc4de264da58bcea7329c82409d1087e67b62f25..6ac3d932f4567fabfb2b9fac001aef21db755e01 100644
+--- a/content/app_shim_remote_cocoa/web_contents_view_cocoa.mm
++++ b/content/app_shim_remote_cocoa/web_contents_view_cocoa.mm
+@@ -126,13 +126,11 @@ @implementation WebContentsViewCocoa {
+ 
+   gfx::Rect _windowControlsOverlayRect;
+ 
++  BOOL _inFullScreenTransition;
+   BOOL _willSetWebContentsOccludedAfterDelay;
+ }
+ 
+-+ (void)initialize {
+-  // Create the WebContentsOcclusionCheckerMac shared instance.
+-  [WebContentsOcclusionCheckerMac sharedInstance];
+-}
+++ (void)initialize { }
+ 
+ - (instancetype)initWithViewsHostableView:(ui::ViewsHostableView*)v {
+   self = [super initWithFrame:NSZeroRect tracking:YES];
+@@ -479,6 +477,20 @@ - (void)updateWebContentsVisibility {
+   [self updateWebContentsVisibility:visibility];
+ }
+ 
++- (void)legacyUpdateWebContentsVisibility {
++  using remote_cocoa::mojom::Visibility;
++  if (!_host || _inFullScreenTransition)
++    return;
++  Visibility visibility = Visibility::kVisible;
++  if ([self isHiddenOrHasHiddenAncestor] || ![self window])
++    visibility = Visibility::kHidden;
++  else if ([[self window] occlusionState] & NSWindowOcclusionStateVisible)
++    visibility = Visibility::kVisible;
++  else
++    visibility = Visibility::kOccluded;
++  _host->OnWindowVisibilityChanged(visibility);
++}
++
+ - (void)resizeSubviewsWithOldSize:(NSSize)oldBoundsSize {
+   // Subviews do not participate in auto layout unless the the size this view
+   // changes. This allows RenderWidgetHostViewMac::SetBounds(..) to select a
+@@ -501,11 +513,20 @@ - (void)viewWillMoveToWindow:(NSWindow*)newWindow {
+ 
+   NSWindow* oldWindow = [self window];
+ 
++  _inFullScreenTransition = NO;
+   if (oldWindow) {
+-    [notificationCenter
+-        removeObserver:self
+-                  name:NSWindowDidChangeOcclusionStateNotification
+-                object:oldWindow];
++    NSArray* notificationsToRemove = @[
++      NSWindowDidChangeOcclusionStateNotification,
++      NSWindowWillEnterFullScreenNotification,
++      NSWindowDidEnterFullScreenNotification,
++      NSWindowWillExitFullScreenNotification,
++      NSWindowDidExitFullScreenNotification
++    ];
++    for (NSString* notificationName in notificationsToRemove) {
++      [notificationCenter removeObserver:self
++                                    name:notificationName
++                                  object:oldWindow];
++    }
+   }
+ 
+   if (newWindow) {
+@@ -513,27 +534,49 @@ - (void)viewWillMoveToWindow:(NSWindow*)newWindow {
+                            selector:@selector(windowChangedOcclusionState:)
+                                name:NSWindowDidChangeOcclusionStateNotification
+                              object:newWindow];
++    // The fullscreen transition causes spurious occlusion notifications.
++    // See https://crbug.com/1081229
++    [notificationCenter addObserver:self
++                           selector:@selector(fullscreenTransitionStarted:)
++                               name:NSWindowWillEnterFullScreenNotification
++                             object:newWindow];
++    [notificationCenter addObserver:self
++                           selector:@selector(fullscreenTransitionComplete:)
++                               name:NSWindowDidEnterFullScreenNotification
++                             object:newWindow];
++    [notificationCenter addObserver:self
++                           selector:@selector(fullscreenTransitionStarted:)
++                               name:NSWindowWillExitFullScreenNotification
++                             object:newWindow];
++    [notificationCenter addObserver:self
++                           selector:@selector(fullscreenTransitionComplete:)
++                               name:NSWindowDidExitFullScreenNotification
++                             object:newWindow];
+   }
+ }
+ 
+ - (void)windowChangedOcclusionState:(NSNotification*)aNotification {
+-  // Only respond to occlusion notifications sent by the occlusion checker.
+-  NSDictionary* userInfo = [aNotification userInfo];
+-  NSString* occlusionCheckerKey = [WebContentsOcclusionCheckerMac className];
+-  if (userInfo[occlusionCheckerKey] != nil)
+-    [self updateWebContentsVisibility];
++  [self legacyUpdateWebContentsVisibility];
++}
++
++- (void)fullscreenTransitionStarted:(NSNotification*)notification {
++  _inFullScreenTransition = YES;
++}
++
++- (void)fullscreenTransitionComplete:(NSNotification*)notification {
++  _inFullScreenTransition = NO;
+ }
+ 
+ - (void)viewDidMoveToWindow {
+-  [self updateWebContentsVisibility];
++  [self legacyUpdateWebContentsVisibility];
+ }
+ 
+ - (void)viewDidHide {
+-  [self updateWebContentsVisibility];
++  [self legacyUpdateWebContentsVisibility];
+ }
+ 
+ - (void)viewDidUnhide {
+-  [self updateWebContentsVisibility];
++  [self legacyUpdateWebContentsVisibility];
+ }
+ 
+ // ViewsHostable protocol implementation.

+ 2 - 2
patches/chromium/scroll_bounce_flag.patch

@@ -6,10 +6,10 @@ Subject: scroll_bounce_flag.patch
 Patch to make scrollBounce option work.
 
 diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
-index db991c27ab5d86058ba0d768f0523866231f3f4d..812286d8f020d5952eddd7c6c30de7bd39d8114b 100644
+index e388b778c476fde6294815f86d62e3f843f05e13..d64b538e5755e613fc34ff072cd846b7436430cc 100644
 --- a/content/renderer/render_thread_impl.cc
 +++ b/content/renderer/render_thread_impl.cc
-@@ -1309,7 +1309,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
+@@ -1304,7 +1304,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
  }
  
  bool RenderThreadImpl::IsElasticOverscrollEnabled() {

+ 2 - 2
patches/chromium/support_mixed_sandbox_with_zygote.patch

@@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it
 does touch a security-sensitive class.
 
 diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index 167462f298cafe0400d8326881c61e95ad1769d5..473e4b9ec54cfe6f9c644e7a1edccd54f19b801e 100644
+index f2b5a9fbfc2a4bb4f9482fe64bf33fa9a739d5ce..a9a808f48188416426101013acacf9da7da08d9f 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -1764,6 +1764,10 @@ bool RenderProcessHostImpl::Init() {
+@@ -1758,6 +1758,10 @@ bool RenderProcessHostImpl::Init() {
      std::unique_ptr<SandboxedProcessLauncherDelegate> sandbox_delegate =
          std::make_unique<RendererSandboxedProcessLauncherDelegateWin>(
              *cmd_line, IsPdf(), IsJitDisabled());

+ 6 - 6
patches/chromium/web_contents.patch

@@ -9,10 +9,10 @@ is needed for OSR.
 Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
 
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index f0d92a18c0cdefd437086695e122c81ca9293ce5..7c348b55b7316b8452dfb9fc43846544af9f04ed 100644
+index 63b26168c5fecbd71d11e2fe377bd6a2fa4a7a5e..6b28851234f96c4851b2f19b34a9b8d2c061f347 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -3789,6 +3789,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
+@@ -3797,6 +3797,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
        params.main_frame_name, GetOpener(), primary_main_frame_policy,
        base::UnguessableToken::Create());
  
@@ -26,7 +26,7 @@ index f0d92a18c0cdefd437086695e122c81ca9293ce5..7c348b55b7316b8452dfb9fc43846544
    std::unique_ptr<WebContentsViewDelegate> delegate =
        GetContentClient()->browser()->GetWebContentsViewDelegate(this);
  
-@@ -3799,6 +3806,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
+@@ -3807,6 +3814,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
      view_ = CreateWebContentsView(this, std::move(delegate),
                                    &render_view_host_delegate_view_);
    }
@@ -35,10 +35,10 @@ index f0d92a18c0cdefd437086695e122c81ca9293ce5..7c348b55b7316b8452dfb9fc43846544
    CHECK(view_.get());
  
 diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
-index c601698c6032d5b147c67b0ff7caf6a8747b3ece..973a3010d4eff81dfded3d5c7bc52a7976f279cf 100644
+index e9c6a19ace43198ca0887b1ac7385aaf5b643e7e..f6aedd442596dfca6e58d7046d1ef609c2794e97 100644
 --- a/content/public/browser/web_contents.h
 +++ b/content/public/browser/web_contents.h
-@@ -113,10 +113,13 @@ class BrowserPluginGuestDelegate;
+@@ -114,10 +114,13 @@ class BrowserPluginGuestDelegate;
  class GuestPageHolder;
  class RenderFrameHost;
  class RenderViewHost;
@@ -52,7 +52,7 @@ index c601698c6032d5b147c67b0ff7caf6a8747b3ece..973a3010d4eff81dfded3d5c7bc52a79
  class WebUI;
  struct DropData;
  struct MHTMLGenerationParams;
-@@ -277,6 +280,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData {
+@@ -278,6 +281,10 @@ class WebContents : public PageNavigator, public base::SupportsUserData {
      network::mojom::WebSandboxFlags starting_sandbox_flags =
          network::mojom::WebSandboxFlags::kNone;
  

+ 5 - 5
patches/chromium/webview_fullscreen.patch

@@ -15,10 +15,10 @@ Note that we also need to manually update embedder's
 `api::WebContents::IsFullscreenForTabOrPending` value.
 
 diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc
-index 7b91ba71aadbf44ba76dd38ea2ca69ef16e48dc8..90ed344e4714ea2f98feab48824e8273ea51d048 100644
+index 88396edf058aaf6f18ae8cf09cb7175de5ae8d1c..81add87623c24f1be3cbde3dfdf10495c4de228b 100644
 --- a/content/browser/renderer_host/render_frame_host_impl.cc
 +++ b/content/browser/renderer_host/render_frame_host_impl.cc
-@@ -8244,6 +8244,17 @@ void RenderFrameHostImpl::EnterFullscreen(
+@@ -8351,6 +8351,17 @@ void RenderFrameHostImpl::EnterFullscreen(
      }
    }
  
@@ -37,10 +37,10 @@ index 7b91ba71aadbf44ba76dd38ea2ca69ef16e48dc8..90ed344e4714ea2f98feab48824e8273
    if (had_fullscreen_token && !GetView()->HasFocus())
      GetView()->Focus();
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 7c348b55b7316b8452dfb9fc43846544af9f04ed..750a5c74404d7d96e65fce1d91d1e38d8621c1f2 100644
+index 6b28851234f96c4851b2f19b34a9b8d2c061f347..deb9bedb4a7a699807f2c5fabae6c4b90a141a4f 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -4047,21 +4047,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
+@@ -4055,21 +4055,25 @@ KeyboardEventProcessingResult WebContentsImpl::PreHandleKeyboardEvent(
      const input::NativeWebKeyboardEvent& event) {
    OPTIONAL_TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("content.verbose"),
                          "WebContentsImpl::PreHandleKeyboardEvent");
@@ -78,7 +78,7 @@ index 7c348b55b7316b8452dfb9fc43846544af9f04ed..750a5c74404d7d96e65fce1d91d1e38d
  }
  
  bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
-@@ -4220,7 +4224,7 @@ void WebContentsImpl::EnterFullscreenMode(
+@@ -4228,7 +4232,7 @@ void WebContentsImpl::EnterFullscreenMode(
    OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
    DCHECK(CanEnterFullscreenMode(requesting_frame));
    DCHECK(requesting_frame->IsActive());

+ 6 - 6
patches/chromium/worker_context_will_destroy.patch

@@ -26,10 +26,10 @@ index 42c94f71f09cf9067bac9fd9004dda36708ec441..07c014a28ed1ef5878a50fbb194e38fe
    // An empty URL is returned if the URL is not overriden.
    virtual GURL OverrideFlashEmbedWithHTML(const GURL& url);
 diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
-index e4b0cdb22340cf3ad368de9bde61c85f6b97fa74..0883af83028e8fc10b38ec59257f75e64e66c6e1 100644
+index 24ed2d721fa6b261cc817c82ddf1d1ae0b5e82ed..86684e38d8cb84889c090576ab7f0f0e05b5c2b6 100644
 --- a/content/renderer/renderer_blink_platform_impl.cc
 +++ b/content/renderer/renderer_blink_platform_impl.cc
-@@ -875,6 +875,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
+@@ -887,6 +887,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
    WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
  }
  
@@ -43,10 +43,10 @@ index e4b0cdb22340cf3ad368de9bde61c85f6b97fa74..0883af83028e8fc10b38ec59257f75e6
      const v8::Local<v8::Context>& worker) {
    GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread(
 diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
-index 17c01a1f03ad4d4fa8a9783a00e159fff7c67940..1bfec2280e6d1f5cb5c157d237069bdee44b9a5d 100644
+index ced5bb344ec46e751ad8331242967e9b207bc572..54cebcbc49875287b5ae008b14e7df515f31a2d5 100644
 --- a/content/renderer/renderer_blink_platform_impl.h
 +++ b/content/renderer/renderer_blink_platform_impl.h
-@@ -194,6 +194,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
+@@ -196,6 +196,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
    void DidStartWorkerThread() override;
    void WillStopWorkerThread() override;
    void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
@@ -55,10 +55,10 @@ index 17c01a1f03ad4d4fa8a9783a00e159fff7c67940..1bfec2280e6d1f5cb5c157d237069bde
        const blink::WebSecurityOrigin& script_origin) override;
    blink::ProtocolHandlerSecurityLevel GetProtocolHandlerSecurityLevel(
 diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
-index 6bae009bb76ea992d6c34383d75378f4467db5f7..8199839240ecc0abf5b0ce5e042f83bd31cafe9a 100644
+index d4e60554211f1e7ef5455fb870284127281348b4..38c6e96ac42ff064cb337a4edb493ecf95bd6820 100644
 --- a/third_party/blink/public/platform/platform.h
 +++ b/third_party/blink/public/platform/platform.h
-@@ -660,6 +660,7 @@ class BLINK_PLATFORM_EXPORT Platform {
+@@ -662,6 +662,7 @@ class BLINK_PLATFORM_EXPORT Platform {
    virtual void DidStartWorkerThread() {}
    virtual void WillStopWorkerThread() {}
    virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

+ 6 - 6
patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch

@@ -35,10 +35,10 @@ index 07c014a28ed1ef5878a50fbb194e38fe762361e9..ae4c9c011024a32354a4cc25c63835a4
    // from the worker thread.
    virtual void WillDestroyWorkerContextOnWorkerThread(
 diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
-index 0883af83028e8fc10b38ec59257f75e64e66c6e1..a9392803a6675391ffd4c97fee0ad782934006ff 100644
+index 86684e38d8cb84889c090576ab7f0f0e05b5c2b6..33977bfee6ded55f37ad58bc43bae4cf17c59ea3 100644
 --- a/content/renderer/renderer_blink_platform_impl.cc
 +++ b/content/renderer/renderer_blink_platform_impl.cc
-@@ -887,6 +887,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
+@@ -899,6 +899,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
        worker);
  }
  
@@ -52,10 +52,10 @@ index 0883af83028e8fc10b38ec59257f75e64e66c6e1..a9392803a6675391ffd4c97fee0ad782
      const blink::WebSecurityOrigin& script_origin) {
    return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker(
 diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
-index 1bfec2280e6d1f5cb5c157d237069bdee44b9a5d..c327e48cbefa0cbfe7192449a97896f3f84be70a 100644
+index 54cebcbc49875287b5ae008b14e7df515f31a2d5..c501ef55d85e9743dd7e0f6bcddfa3de2c155146 100644
 --- a/content/renderer/renderer_blink_platform_impl.h
 +++ b/content/renderer/renderer_blink_platform_impl.h
-@@ -194,6 +194,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
+@@ -196,6 +196,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
    void DidStartWorkerThread() override;
    void WillStopWorkerThread() override;
    void WorkerContextCreated(const v8::Local<v8::Context>& worker) override;
@@ -65,10 +65,10 @@ index 1bfec2280e6d1f5cb5c157d237069bdee44b9a5d..c327e48cbefa0cbfe7192449a97896f3
    bool AllowScriptExtensionForServiceWorker(
        const blink::WebSecurityOrigin& script_origin) override;
 diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
-index 8199839240ecc0abf5b0ce5e042f83bd31cafe9a..40269dcdfb2355067f20f25f4f4f9f31abc6e256 100644
+index 38c6e96ac42ff064cb337a4edb493ecf95bd6820..1bfd7a66d38e01fa173e02c656495e5ba674fa80 100644
 --- a/third_party/blink/public/platform/platform.h
 +++ b/third_party/blink/public/platform/platform.h
-@@ -660,6 +660,8 @@ class BLINK_PLATFORM_EXPORT Platform {
+@@ -662,6 +662,8 @@ class BLINK_PLATFORM_EXPORT Platform {
    virtual void DidStartWorkerThread() {}
    virtual void WillStopWorkerThread() {}
    virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

+ 2 - 2
patches/devtools_frontend/chore_expose_ui_to_allow_electron_to_set_dock_side.patch

@@ -10,10 +10,10 @@ to handle this without patching, but this is fairly clean for now and no longer
 patching legacy devtools code.
 
 diff --git a/front_end/entrypoints/main/MainImpl.ts b/front_end/entrypoints/main/MainImpl.ts
-index 002e42a9af04652fe711369001be0b83f01456ea..9598017c637afe337c0a2e761297a83f058689e2 100644
+index fbc6a1bd7145e75bda7fc3f0346aef324e2f7c8d..dddce4ea0d94454b80fa2e5c6f0ac412631776bf 100644
 --- a/front_end/entrypoints/main/MainImpl.ts
 +++ b/front_end/entrypoints/main/MainImpl.ts
-@@ -757,6 +757,8 @@ export class MainImpl {
+@@ -789,6 +789,8 @@ export class MainImpl {
  globalThis.Main = globalThis.Main || {};
  // @ts-ignore Exported for Tests.js
  globalThis.Main.Main = MainImpl;

+ 1 - 0
patches/node/.patches

@@ -46,3 +46,4 @@ src_provide_workaround_for_container-overflow.patch
 build_allow_unbundling_of_node_js_dependencies.patch
 test_use_static_method_names_in_call_stacks.patch
 build_use_third_party_simdutf.patch
+fix_remove_fastapitypedarray_usage.patch

+ 277 - 0
patches/node/fix_remove_fastapitypedarray_usage.patch

@@ -0,0 +1,277 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Sun, 29 Dec 2024 04:01:32 +0900
+Subject: fix: remove FastApiTypedArray usage
+
+Refs https://github.com/electron/electron/pull/45055#issuecomment-2559095439
+Can be removed when upstream adopts relevant V8 version.
+
+diff --git a/src/crypto/crypto_timing.cc b/src/crypto/crypto_timing.cc
+index 867a1c4aca54b9d41490d23a5eb55088b7e941cc..09f4c65a18efea262b1f854f993c6f18273f48f5 100644
+--- a/src/crypto/crypto_timing.cc
++++ b/src/crypto/crypto_timing.cc
+@@ -11,7 +11,6 @@
+ namespace node {
+ 
+ using v8::FastApiCallbackOptions;
+-using v8::FastApiTypedArray;
+ using v8::FunctionCallbackInfo;
+ using v8::Local;
+ using v8::Object;
+@@ -50,14 +49,13 @@ void TimingSafeEqual(const FunctionCallbackInfo<Value>& args) {
+ }
+ 
+ bool FastTimingSafeEqual(Local<Value> receiver,
+-                         const FastApiTypedArray<uint8_t>& a,
+-                         const FastApiTypedArray<uint8_t>& b,
++                         Local<Value> a,
++                         Local<Value> b,
+                          // NOLINTNEXTLINE(runtime/references)
+                          FastApiCallbackOptions& options) {
+-  uint8_t* data_a;
+-  uint8_t* data_b;
+-  if (a.length() != b.length() || !a.getStorageIfAligned(&data_a) ||
+-      !b.getStorageIfAligned(&data_b)) {
++  FAST_SPREAD_BUFFER_ARG(a, a_buffer);
++  FAST_SPREAD_BUFFER_ARG(b, b_buffer);
++  if (a_buffer_length != b_buffer_length) {
+     TRACK_V8_FAST_API_CALL("crypto.timingSafeEqual.error");
+     v8::HandleScope scope(options.isolate);
+     THROW_ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH(options.isolate);
+@@ -65,7 +63,7 @@ bool FastTimingSafeEqual(Local<Value> receiver,
+   }
+ 
+   TRACK_V8_FAST_API_CALL("crypto.timingSafeEqual.ok");
+-  return CRYPTO_memcmp(data_a, data_b, a.length()) == 0;
++  return CRYPTO_memcmp(a_buffer_data, b_buffer_data, a_buffer_length) == 0;
+ }
+ 
+ static v8::CFunction fast_equal(v8::CFunction::Make(FastTimingSafeEqual));
+diff --git a/src/node_buffer.cc b/src/node_buffer.cc
+index 2302e8d94da3250e7fb4ee0c5e6a51d3d6941fbc..ed72476e16036d972de54d39cf4bd37bbbed5c5f 100644
+--- a/src/node_buffer.cc
++++ b/src/node_buffer.cc
+@@ -44,6 +44,14 @@
+ #define THROW_AND_RETURN_UNLESS_BUFFER(env, obj)                            \
+   THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument")                      \
+ 
++#define THROW_AND_RETURN_VAL_UNLESS_BUFFER(isolate, val, prefix, retval)       \
++  do {                                                                         \
++    if (!Buffer::HasInstance(val)) {                                           \
++      node::THROW_ERR_INVALID_ARG_TYPE(isolate, prefix " must be a buffer");   \
++      return retval;                                                           \
++    }                                                                          \
++  } while (0)
++
+ #define THROW_AND_RETURN_IF_OOB(r)                                          \
+   do {                                                                      \
+     Maybe<bool> m = (r);                                                    \
+@@ -60,7 +68,6 @@ using v8::ArrayBufferView;
+ using v8::BackingStore;
+ using v8::Context;
+ using v8::EscapableHandleScope;
+-using v8::FastApiTypedArray;
+ using v8::FunctionCallbackInfo;
+ using v8::Global;
+ using v8::HandleScope;
+@@ -581,19 +588,24 @@ void SlowCopy(const FunctionCallbackInfo<Value>& args) {
+ 
+ // Assume caller has properly validated args.
+ uint32_t FastCopy(Local<Value> receiver,
+-                  const v8::FastApiTypedArray<uint8_t>& source,
+-                  const v8::FastApiTypedArray<uint8_t>& target,
++                  Local<Value> source_obj,
++                  Local<Value> target_obj,
+                   uint32_t target_start,
+                   uint32_t source_start,
+-                  uint32_t to_copy) {
+-  uint8_t* source_data;
+-  CHECK(source.getStorageIfAligned(&source_data));
+-
++                  uint32_t to_copy,
++                  v8::FastApiCallbackOptions& options) {
++  FAST_SPREAD_BUFFER_ARG(source_obj, source);
+   uint8_t* target_data;
+-  CHECK(target.getStorageIfAligned(&target_data));
++  FAST_SPREAD_BUFFER_ARG(target_obj, target_buffer);
++  if (target_buffer_length <= kMaxSizeInHeap) {
++    HandleScope handle_scope(options.isolate);
++    SPREAD_BUFFER_ARG(target_obj, target_buffer);
++    target_data = reinterpret_cast<uint8_t*>(target_buffer_data);
++  } else {
++    target_data = target_buffer_data;
++  }
+ 
+   memmove(target_data + target_start, source_data + source_start, to_copy);
+-
+   return to_copy;
+ }
+ 
+@@ -857,19 +869,17 @@ void Compare(const FunctionCallbackInfo<Value> &args) {
+ }
+ 
+ int32_t FastCompare(v8::Local<v8::Value>,
+-                    const FastApiTypedArray<uint8_t>& a,
+-                    const FastApiTypedArray<uint8_t>& b) {
+-  uint8_t* data_a;
+-  uint8_t* data_b;
+-  CHECK(a.getStorageIfAligned(&data_a));
+-  CHECK(b.getStorageIfAligned(&data_b));
++                    v8::Local<v8::Value> a,
++                    v8::Local<v8::Value> b) {
++  FAST_SPREAD_BUFFER_ARG(a, a_buffer);
++  FAST_SPREAD_BUFFER_ARG(b, b_buffer);
+ 
+-  size_t cmp_length = std::min(a.length(), b.length());
++  size_t cmp_length = std::min(a_buffer_length, b_buffer_length);
+ 
+   return normalizeCompareVal(
+-      cmp_length > 0 ? memcmp(data_a, data_b, cmp_length) : 0,
+-      a.length(),
+-      b.length());
++      cmp_length > 0 ? memcmp(a_buffer_data, b_buffer_data, cmp_length) : 0,
++      a_buffer_length,
++      b_buffer_length);
+ }
+ 
+ static v8::CFunction fast_compare(v8::CFunction::Make(FastCompare));
+@@ -1140,14 +1150,13 @@ void SlowIndexOfNumber(const FunctionCallbackInfo<Value>& args) {
+ }
+ 
+ int32_t FastIndexOfNumber(v8::Local<v8::Value>,
+-                          const FastApiTypedArray<uint8_t>& buffer,
++                          v8::Local<v8::Value> source_obj,
+                           uint32_t needle,
+                           int64_t offset_i64,
+                           bool is_forward) {
+-  uint8_t* buffer_data;
+-  CHECK(buffer.getStorageIfAligned(&buffer_data));
++  FAST_SPREAD_BUFFER_ARG(source_obj, buffer);
+   return IndexOfNumber(
+-      buffer_data, buffer.length(), needle, offset_i64, is_forward);
++      buffer_data, buffer_length, needle, offset_i64, is_forward);
+ }
+ 
+ static v8::CFunction fast_index_of_number(
+@@ -1552,21 +1561,31 @@ void SlowWriteString(const FunctionCallbackInfo<Value>& args) {
+ 
+ template <encoding encoding>
+ uint32_t FastWriteString(Local<Value> receiver,
+-                         const v8::FastApiTypedArray<uint8_t>& dst,
++                         Local<v8::Value> dst,
+                          const v8::FastOneByteString& src,
+                          uint32_t offset,
+-                         uint32_t max_length) {
+-  uint8_t* dst_data;
+-  CHECK(dst.getStorageIfAligned(&dst_data));
+-  CHECK(offset <= dst.length());
+-  CHECK(dst.length() - offset <= std::numeric_limits<uint32_t>::max());
++                         uint32_t max_length,
++                         v8::FastApiCallbackOptions& options) {
++  THROW_AND_RETURN_VAL_UNLESS_BUFFER(options.isolate, dst, "dst", 0);
++  uint8_t* dst_buffer_data;
++  FAST_SPREAD_BUFFER_ARG(dst, dst_fast_buffer);
++  if (dst_fast_buffer_length <= kMaxSizeInHeap) {
++    HandleScope handle_scope(options.isolate);
++    SPREAD_BUFFER_ARG(dst, dst_slow_buffer);
++    dst_buffer_data = reinterpret_cast<uint8_t*>(dst_slow_buffer_data);
++  } else {
++    dst_buffer_data = dst_fast_buffer_data;
++  };
++
++  CHECK(dst_fast_buffer_length <= std::numeric_limits<uint32_t>::max());
++  uint32_t dst_size = static_cast<uint32_t>(dst_fast_buffer_length);
+   TRACK_V8_FAST_API_CALL("buffer.writeString");
+ 
+   return WriteOneByteString<encoding>(
+       src.data,
+       src.length,
+-      reinterpret_cast<char*>(dst_data + offset),
+-      std::min<uint32_t>(dst.length() - offset, max_length));
++      reinterpret_cast<char*>(dst_buffer_data + offset),
++      std::min<uint32_t>(dst_size - offset, max_length));
+ }
+ 
+ static v8::CFunction fast_write_string_ascii(
+diff --git a/src/node_external_reference.h b/src/node_external_reference.h
+index 38a4ff7e6c2c9997f004c7c1f94cb5a9ffc2ffe0..48e73168f994d79ae3564b813acb5546ca8f2526 100644
+--- a/src/node_external_reference.h
++++ b/src/node_external_reference.h
+@@ -34,16 +34,16 @@ using CFunctionCallbackWithStrings =
+              const v8::FastOneByteString& base);
+ using CFunctionCallbackWithTwoUint8Arrays =
+     int32_t (*)(v8::Local<v8::Value>,
+-                const v8::FastApiTypedArray<uint8_t>&,
+-                const v8::FastApiTypedArray<uint8_t>&);
++                v8::Local<v8::Value>,
++                v8::Local<v8::Value>);
+ using CFunctionCallbackWithTwoUint8ArraysFallback =
+     bool (*)(v8::Local<v8::Value>,
+-             const v8::FastApiTypedArray<uint8_t>&,
+-             const v8::FastApiTypedArray<uint8_t>&,
++             v8::Local<v8::Value>,
++             v8::Local<v8::Value>,
+              v8::FastApiCallbackOptions&);
+ using CFunctionCallbackWithUint8ArrayUint32Int64Bool =
+     int32_t (*)(v8::Local<v8::Value>,
+-                const v8::FastApiTypedArray<uint8_t>&,
++                v8::Local<v8::Value>,
+                 uint32_t,
+                 int64_t,
+                 bool);
+@@ -58,18 +58,20 @@ using CFunctionWithBool = void (*)(v8::Local<v8::Value>, bool);
+ 
+ using CFunctionWriteString =
+     uint32_t (*)(v8::Local<v8::Value> receiver,
+-                 const v8::FastApiTypedArray<uint8_t>& dst,
++                 v8::Local<v8::Value> dst,
+                  const v8::FastOneByteString& src,
+                  uint32_t offset,
+-                 uint32_t max_length);
++                 uint32_t max_length,
++                 v8::FastApiCallbackOptions&);
+ 
+ using CFunctionBufferCopy =
+     uint32_t (*)(v8::Local<v8::Value> receiver,
+-                 const v8::FastApiTypedArray<uint8_t>& source,
+-                 const v8::FastApiTypedArray<uint8_t>& target,
++                 v8::Local<v8::Value> source,
++                 v8::Local<v8::Value> target,
+                  uint32_t target_start,
+                  uint32_t source_start,
+-                 uint32_t to_copy);
++                 uint32_t to_copy,
++                 v8::FastApiCallbackOptions&);
+ 
+ // This class manages the external references from the V8 heap
+ // to the C++ addresses in Node.js.
+diff --git a/src/util.h b/src/util.h
+index a6da8720c499df54ab4608eb03cff905759c2232..43ef977363e565a6f9422c9454e25b8fe0b327d5 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -57,6 +57,8 @@
+ 
+ namespace node {
+ 
++static constexpr size_t kMaxSizeInHeap = 64;                                 \
++
+ #ifdef _WIN32
+ /* MAX_PATH is in characters, not bytes. Make sure we have enough headroom. */
+ #define PATH_MAX_BYTES (MAX_PATH * 4)
+@@ -573,6 +575,16 @@ class BufferValue : public MaybeStackBuffer<char> {
+       static_cast<char*>(name->Buffer()->Data()) + name##_offset;              \
+   if (name##_length > 0) CHECK_NE(name##_data, nullptr);
+ 
++#define FAST_SPREAD_BUFFER_ARG(val, name)                                      \
++  CHECK((val)->IsArrayBufferView());                                           \
++  v8::Local<v8::ArrayBufferView> name = (val).As<v8::ArrayBufferView>();       \
++  uint8_t name##_buffer[kMaxSizeInHeap];                                       \
++  v8::MemorySpan<uint8_t> name##_storage(name##_buffer);                       \
++  name##_storage = name->GetContents(name##_storage);                          \
++  const size_t name##_length = name##_storage.size();                          \
++  uint8_t* name##_data = name##_storage.data();                                \
++  if (name##_length > 0) CHECK_NE(name##_data, nullptr);
++
+ // Use this when a variable or parameter is unused in order to explicitly
+ // silence a compiler warning about that.
+ template <typename T> inline void USE(T&&) {}

+ 0 - 3
patches/v8/.patches

@@ -1,5 +1,2 @@
 chore_allow_customizing_microtask_policy_per_context.patch
 deps_add_v8_object_setinternalfieldfornodecore.patch
-revert_fastapi_add_support_for_attribute_setters.patch
-revert_fastapi_remove_dynamic_overload_resolution.patch
-revert_api_delete_deprecated_struct_fastapitypedarray.patch

+ 2 - 2
patches/v8/deps_add_v8_object_setinternalfieldfornodecore.patch

@@ -46,10 +46,10 @@ index 3e57ae8efe33f326ef0e5d609c311d4be5b8afd6..dc521d39c2280dfc3217e97c1e413b2b
    V8_INLINE static void* GetAlignedPointerFromInternalField(
        const BasicTracedReference<Object>& object, int index) {
 diff --git a/src/api/api.cc b/src/api/api.cc
-index 311cd9f1c289c2c5aea234fab64ee200dd0c2a8d..af1f0f3ad6ad0f2f0e7cb0123f9cd1ad0d1c80cb 100644
+index c0ff2001df718c89bd1fdf06e95d51e56aa23f03..35ab90bc743acce711c5f499363e40e55bf2a0e1 100644
 --- a/src/api/api.cc
 +++ b/src/api/api.cc
-@@ -6471,14 +6471,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
+@@ -6487,14 +6487,33 @@ Local<Data> v8::Object::SlowGetInternalField(int index) {
        i::Cast<i::JSObject>(*obj)->GetEmbedderField(index), isolate));
  }
  

+ 0 - 419
patches/v8/revert_api_delete_deprecated_struct_fastapitypedarray.patch

@@ -1,419 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: John Kleinschmidt <[email protected]>
-Date: Fri, 15 Nov 2024 10:49:33 -0500
-Subject: Revert "[api] Delete deprecated struct FastApiTypedArray"
-
-Revert this until Node.js decides how to proceed and then pick up their fix.
-
-Refs: https://github.com/nodejs/node/issues/55452
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5956408
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5982984
-
-This reverts commit 35a6781f783f037404869f6c9ec22f147dba1c5e.
-
-diff --git a/include/v8-fast-api-calls.h b/include/v8-fast-api-calls.h
-index 12ef5e4f7e66f1bfe2ff3f46ebfa8f47c86e313c..9796601c287c0bb83a2fd85f7735678219c2cd5d 100644
---- a/include/v8-fast-api-calls.h
-+++ b/include/v8-fast-api-calls.h
-@@ -271,7 +271,7 @@ class CTypeInfo {
-   enum class SequenceType : uint8_t {
-     kScalar,
-     kIsSequence,  // sequence<T>
--    kIsTypedArray V8_DEPRECATED(
-+    kIsTypedArray V8_DEPRECATE_SOON(
-         "TypedArrays are not supported directly anymore."),
-     // is void
-     kIsArrayBuffer  // ArrayBuffer
-@@ -326,7 +326,7 @@ class CTypeInfo {
-   Flags flags_;
- };
- 
--struct V8_DEPRECATED(
-+struct V8_DEPRECATE_SOON(
-     "With the removal of FastApiTypedArray this type is not needed "
-     "anymore.") FastApiTypedArrayBase {
-  public:
-@@ -339,6 +339,42 @@ struct V8_DEPRECATED(
-   size_t length_ = 0;
- };
- 
-+template <typename T>
-+struct V8_DEPRECATE_SOON(
-+    "When an API function expects a TypedArray as a parameter, the type in the "
-+    "signature should be `v8::Local<v8::Value>` instead of "
-+    "FastApiTypedArray<>. The API function then has to type-check the "
-+    "parameter and convert it to a `v8::Local<v8::TypedArray` to access the "
-+    "data. In essence, the parameter should be handled the same as for a "
-+    "regular API call.") FastApiTypedArray : public FastApiTypedArrayBase {
-+ public:
-+  V8_INLINE T get(size_t index) const {
-+#ifdef DEBUG
-+    ValidateIndex(index);
-+#endif  // DEBUG
-+    T tmp;
-+    memcpy(&tmp, static_cast<void*>(reinterpret_cast<T*>(data_) + index),
-+           sizeof(T));
-+    return tmp;
-+  }
-+
-+  bool getStorageIfAligned(T** elements) const {
-+    if (reinterpret_cast<uintptr_t>(data_) % alignof(T) != 0) {
-+      return false;
-+    }
-+    *elements = reinterpret_cast<T*>(data_);
-+    return true;
-+  }
-+
-+ private:
-+  // This pointer should include the typed array offset applied.
-+  // It's not guaranteed that it's aligned to sizeof(T), it's only
-+  // guaranteed that it's 4-byte aligned, so for 8-byte types we need to
-+  // provide a special implementation for reading from it, which hides
-+  // the possibly unaligned read in the `get` method.
-+  void* data_;
-+};
-+
- struct V8_DEPRECATED("This API is dead within V8") FastApiArrayBufferView {
-   void* data;
-   size_t byte_length;
-@@ -664,6 +700,32 @@ PRIMITIVE_C_TYPES(DEFINE_TYPE_INFO_TRAITS)
- #undef PRIMITIVE_C_TYPES
- #undef ALL_C_TYPES
- 
-+#define SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA(T, Enum)                        \
-+  template <>                                                                  \
-+  struct V8_DEPRECATE_SOON(                                                    \
-+      "This struct is unnecessary now, because FastApiTypedArray has already " \
-+      "been deprecated as well") TypeInfoHelper<const FastApiTypedArray<T>&> { \
-+    static constexpr CTypeInfo::Flags Flags() {                                \
-+      return CTypeInfo::Flags::kNone;                                          \
-+    }                                                                          \
-+                                                                               \
-+    static constexpr CTypeInfo::Type Type() { return CTypeInfo::Type::Enum; }  \
-+    static constexpr CTypeInfo::SequenceType SequenceType() {                  \
-+      return CTypeInfo::SequenceType::kIsTypedArray;                           \
-+    }                                                                          \
-+  };
-+
-+#define TYPED_ARRAY_C_TYPES(V) \
-+  V(uint8_t, kUint8)           \
-+  V(int32_t, kInt32)           \
-+  V(uint32_t, kUint32)         \
-+  V(int64_t, kInt64)           \
-+  V(uint64_t, kUint64)         \
-+  V(float, kFloat32)           \
-+  V(double, kFloat64)
-+
-+TYPED_ARRAY_C_TYPES(SPECIALIZE_GET_TYPE_INFO_HELPER_FOR_TA)
-+
- #undef TYPED_ARRAY_C_TYPES
- 
- template <>
-diff --git a/src/compiler/turboshaft/fast-api-call-lowering-reducer.h b/src/compiler/turboshaft/fast-api-call-lowering-reducer.h
-index dc27e91ad0da93a5b68053f132f219f95f641ca1..38ba1110da3f77df4681ccb0ebcee78d1500fbd7 100644
---- a/src/compiler/turboshaft/fast-api-call-lowering-reducer.h
-+++ b/src/compiler/turboshaft/fast-api-call-lowering-reducer.h
-@@ -188,8 +188,20 @@ class FastApiCallLoweringReducer : public Next {
-           break;
-         }
-           START_ALLOW_USE_DEPRECATED()
--        case CTypeInfo::SequenceType::kIsTypedArray:
--          UNREACHABLE();
-+        case CTypeInfo::SequenceType::kIsTypedArray: {
-+          // Check that the value is a TypedArray with a type that matches the
-+          // type declared in the c-function.
-+          OpIndex stack_slot = AdaptFastCallTypedArrayArgument(
-+              argument,
-+              fast_api_call::GetTypedArrayElementsKind(
-+                  resolution_result.element_type),
-+              next);
-+          OpIndex target_address = __ ExternalConstant(
-+              ExternalReference::Create(c_functions[func_index].address,
-+                                        ExternalReference::FAST_C_CALL));
-+          GOTO(done, target_address, stack_slot);
-+          break;
-+        }
-           END_ALLOW_USE_DEPRECATED()
- 
-         default: {
-@@ -328,8 +340,15 @@ class FastApiCallLoweringReducer : public Next {
-         return __ AdaptLocalArgument(argument);
-       }
-         START_ALLOW_USE_DEPRECATED()
--      case CTypeInfo::SequenceType::kIsTypedArray:
--        UNREACHABLE();
-+      case CTypeInfo::SequenceType::kIsTypedArray: {
-+        // Check that the value is a HeapObject.
-+        GOTO_IF(__ ObjectIsSmi(argument), handle_error);
-+
-+        return AdaptFastCallTypedArrayArgument(
-+            argument,
-+            fast_api_call::GetTypedArrayElementsKind(arg_type.GetType()),
-+            handle_error);
-+      }
-         END_ALLOW_USE_DEPRECATED()
-       default: {
-         UNREACHABLE();
-@@ -387,6 +406,94 @@ class FastApiCallLoweringReducer : public Next {
-     }
-   }
- 
-+  OpIndex AdaptFastCallTypedArrayArgument(V<HeapObject> argument,
-+                                          ElementsKind expected_elements_kind,
-+                                          Label<>& bailout) {
-+    V<Map> map = __ LoadMapField(argument);
-+    V<Word32> instance_type = __ LoadInstanceTypeField(map);
-+    GOTO_IF_NOT(LIKELY(__ Word32Equal(instance_type, JS_TYPED_ARRAY_TYPE)),
-+                bailout);
-+
-+    V<Word32> bitfield2 =
-+        __ template LoadField<Word32>(map, AccessBuilder::ForMapBitField2());
-+    V<Word32> kind = __ Word32ShiftRightLogical(
-+        __ Word32BitwiseAnd(bitfield2, Map::Bits2::ElementsKindBits::kMask),
-+        Map::Bits2::ElementsKindBits::kShift);
-+    GOTO_IF_NOT(LIKELY(__ Word32Equal(kind, expected_elements_kind)), bailout);
-+
-+    V<HeapObject> buffer = __ template LoadField<HeapObject>(
-+        argument, AccessBuilder::ForJSArrayBufferViewBuffer());
-+    V<Word32> buffer_bitfield = __ template LoadField<Word32>(
-+        buffer, AccessBuilder::ForJSArrayBufferBitField());
-+
-+    // Go to the slow path if the {buffer} was detached.
-+    GOTO_IF(UNLIKELY(__ Word32BitwiseAnd(buffer_bitfield,
-+                                         JSArrayBuffer::WasDetachedBit::kMask)),
-+            bailout);
-+
-+    // Go to the slow path if the {buffer} is shared.
-+    GOTO_IF(UNLIKELY(__ Word32BitwiseAnd(buffer_bitfield,
-+                                         JSArrayBuffer::IsSharedBit::kMask)),
-+            bailout);
-+
-+    // Unpack the store and length, and store them to a struct
-+    // FastApiTypedArray.
-+    OpIndex external_pointer =
-+        __ LoadField(argument, AccessBuilder::ForJSTypedArrayExternalPointer());
-+
-+    // Load the base pointer for the buffer. This will always be Smi
-+    // zero unless we allow on-heap TypedArrays, which is only the case
-+    // for Chrome. Node and Electron both set this limit to 0. Setting
-+    // the base to Smi zero here allows the BuildTypedArrayDataPointer
-+    // to optimize away the tricky part of the access later.
-+    V<WordPtr> data_ptr;
-+    if constexpr (JSTypedArray::kMaxSizeInHeap == 0) {
-+      data_ptr = external_pointer;
-+    } else {
-+      V<Object> base_pointer = __ template LoadField<Object>(
-+          argument, AccessBuilder::ForJSTypedArrayBasePointer());
-+      V<WordPtr> base = __ BitcastTaggedToWordPtr(base_pointer);
-+      if (COMPRESS_POINTERS_BOOL) {
-+        // Zero-extend Tagged_t to UintPtr according to current compression
-+        // scheme so that the addition with |external_pointer| (which already
-+        // contains compensated offset value) will decompress the tagged value.
-+        // See JSTypedArray::ExternalPointerCompensationForOnHeapArray() for
-+        // details.
-+        base = __ ChangeUint32ToUintPtr(__ TruncateWordPtrToWord32(base));
-+      }
-+      data_ptr = __ WordPtrAdd(base, external_pointer);
-+    }
-+
-+    V<WordPtr> length_in_bytes = __ template LoadField<WordPtr>(
-+        argument, AccessBuilder::ForJSTypedArrayLength());
-+
-+    // We hard-code int32_t here, because all specializations of
-+    // FastApiTypedArray have the same size.
-+    START_ALLOW_USE_DEPRECATED()
-+    constexpr int kAlign = alignof(FastApiTypedArray<int32_t>);
-+    constexpr int kSize = sizeof(FastApiTypedArray<int32_t>);
-+    static_assert(kAlign == alignof(FastApiTypedArray<double>),
-+                  "Alignment mismatch between different specializations of "
-+                  "FastApiTypedArray");
-+    static_assert(kSize == sizeof(FastApiTypedArray<double>),
-+                  "Size mismatch between different specializations of "
-+                  "FastApiTypedArray");
-+    END_ALLOW_USE_DEPRECATED()
-+    static_assert(
-+        kSize == sizeof(uintptr_t) + sizeof(size_t),
-+        "The size of "
-+        "FastApiTypedArray isn't equal to the sum of its expected members.");
-+    OpIndex stack_slot = __ StackSlot(kSize, kAlign);
-+    __ StoreOffHeap(stack_slot, length_in_bytes,
-+                    MemoryRepresentation::UintPtr());
-+    __ StoreOffHeap(stack_slot, data_ptr, MemoryRepresentation::UintPtr(),
-+                    sizeof(size_t));
-+    static_assert(sizeof(uintptr_t) == sizeof(size_t),
-+                  "The buffer length can't "
-+                  "fit the PointerRepresentation used to store it.");
-+    return stack_slot;
-+  }
-+
-   V<Any> DefaultReturnValue(const CFunctionInfo* c_signature) {
-     switch (c_signature->ReturnInfo().GetType()) {
-       case CTypeInfo::Type::kVoid:
-diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc
-index 3898b51a1eab680c34102fea473f111cf8024b8b..0d6a0ef6516e25b2bb65b262b4d6495a268cd4d8 100644
---- a/test/cctest/test-api.cc
-+++ b/test/cctest/test-api.cc
-@@ -29772,6 +29772,16 @@ static Trivial* UnwrapTrivialObject(Local<Object> object) {
-   return wrapped;
- }
- 
-+START_ALLOW_USE_DEPRECATED()
-+void FastCallback1TypedArray(v8::Local<v8::Object> receiver, int arg0,
-+                             const v8::FastApiTypedArray<int32_t>& arg1) {
-+  Trivial* self = UnwrapTrivialObject(receiver);
-+  CHECK_NOT_NULL(self);
-+  CHECK_EQ(arg0, arg1.length());
-+  self->set_x(arg0);
-+}
-+END_ALLOW_USE_DEPRECATED()
-+
- void FastCallback2JSArray(v8::Local<v8::Object> receiver, int arg0,
-                           v8::Local<v8::Array> arg1) {
-   Trivial* self = UnwrapTrivialObject(receiver);
-@@ -29789,10 +29799,103 @@ void FastCallback4Scalar(v8::Local<v8::Object> receiver, int arg0, float arg1) {
- void FastCallback5DifferentArity(v8::Local<v8::Object> receiver, int arg0,
-                                  v8::Local<v8::Array> arg1, float arg2) {}
- 
-+void SequenceSlowCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
-+  CHECK(i::ValidateCallbackInfo(info));
-+  v8::Isolate* isolate = info.GetIsolate();
-+  Trivial* self = UnwrapTrivialObject(info.This());
-+  if (!self) {
-+    isolate->ThrowError("This method is not defined on the given receiver.");
-+    return;
-+  }
-+  self->set_x(1337);
-+
-+  HandleScope handle_scope(isolate);
-+
-+  if (info.Length() < 2 || !info[0]->IsNumber()) {
-+    isolate->ThrowError(
-+        "This method expects at least 2 arguments,"
-+        " first one a number.");
-+    return;
-+  }
-+  int64_t len = info[0]->IntegerValue(isolate->GetCurrentContext()).FromJust();
-+  if (info[1]->IsTypedArray()) {
-+    v8::Local<v8::TypedArray> typed_array_arg = info[1].As<v8::TypedArray>();
-+    size_t length = typed_array_arg->Length();
-+    CHECK_EQ(len, length);
-+    return;
-+  }
-+  if (!info[1]->IsArray()) {
-+    isolate->ThrowError("This method expects an array as a second argument.");
-+    return;
-+  }
-+  v8::Local<v8::Array> seq_arg = info[1].As<v8::Array>();
-+  uint32_t length = seq_arg->Length();
-+  CHECK_EQ(len, length);
-+  return;
-+}
- }  // namespace
- #endif  // !defined(V8_LITE_MODE) && defined(V8_ENABLE_TURBOFAN)
- 
- START_ALLOW_USE_DEPRECATED()
-+TEST(FastApiSequenceOverloads) {
-+#if !defined(V8_LITE_MODE) && defined(V8_ENABLE_TURBOFAN)
-+  if (i::v8_flags.jitless) return;
-+  if (i::v8_flags.disable_optimizing_compilers) return;
-+
-+  i::v8_flags.turbofan = true;
-+  i::v8_flags.turbo_fast_api_calls = true;
-+  i::v8_flags.allow_natives_syntax = true;
-+  // Disable --always_turbofan, otherwise we haven't generated the necessary
-+  // feedback to go down the "best optimization" path for the fast call.
-+  i::v8_flags.always_turbofan = false;
-+  i::FlagList::EnforceFlagImplications();
-+
-+  v8::Isolate* isolate = CcTest::isolate();
-+  HandleScope handle_scope(isolate);
-+  LocalContext env;
-+
-+  v8::CFunction typed_array_callback =
-+      v8::CFunctionBuilder().Fn(FastCallback1TypedArray).Build();
-+  v8::CFunction js_array_callback =
-+      v8::CFunctionBuilder().Fn(FastCallback2JSArray).Build();
-+  const v8::CFunction sequece_overloads[] = {
-+      typed_array_callback,
-+      js_array_callback,
-+  };
-+
-+  Local<v8::FunctionTemplate> sequence_callback_templ =
-+      v8::FunctionTemplate::NewWithCFunctionOverloads(
-+          isolate, SequenceSlowCallback, v8::Number::New(isolate, 42),
-+          v8::Local<v8::Signature>(), 1, v8::ConstructorBehavior::kThrow,
-+          v8::SideEffectType::kHasSideEffect, {sequece_overloads, 2});
-+
-+  v8::Local<v8::ObjectTemplate> object_template =
-+      v8::ObjectTemplate::New(isolate);
-+  object_template->SetInternalFieldCount(kV8WrapperObjectIndex + 1);
-+  object_template->Set(isolate, "api_func", sequence_callback_templ);
-+
-+  std::unique_ptr<Trivial> rcv(new Trivial(42));
-+  v8::Local<v8::Object> object =
-+      object_template->NewInstance(env.local()).ToLocalChecked();
-+  object->SetAlignedPointerInInternalField(kV8WrapperObjectIndex, rcv.get());
-+
-+  CHECK(
-+      (env)->Global()->Set(env.local(), v8_str("receiver"), object).FromJust());
-+  USE(CompileRun(
-+      "function func(num, arr) { return receiver.api_func(num, arr); }"
-+      "%PrepareFunctionForOptimization(func);"
-+      "func(3, [1,2,3]);"
-+      "%OptimizeFunctionOnNextCall(func);"
-+      "func(3, [1,2,3]);"));
-+  CHECK_EQ(3, rcv->x());
-+
-+  USE(
-+      CompileRun("const ta = new Int32Array([1, 2, 3, 4]);"
-+                 "func(4, ta);"));
-+  CHECK_EQ(4, rcv->x());
-+#endif  // !defined(V8_LITE_MODE) && defined(V8_ENABLE_TURBOFAN)
-+}
-+
- TEST(FastApiOverloadResolution) {
- #if !defined(V8_LITE_MODE) && defined(V8_ENABLE_TURBOFAN)
-   if (i::v8_flags.jitless) return;
-@@ -29806,15 +29909,22 @@ TEST(FastApiOverloadResolution) {
-   i::v8_flags.always_turbofan = false;
-   i::FlagList::EnforceFlagImplications();
- 
-+  v8::CFunction typed_array_callback =
-+      v8::CFunctionBuilder().Fn(FastCallback1TypedArray).Build();
-   v8::CFunction js_array_callback =
-       v8::CFunctionBuilder().Fn(FastCallback2JSArray).Build();
- 
-+  // Check that a general runtime overload resolution is possible.
-+  CHECK_EQ(v8::CFunction::OverloadResolution::kAtRuntime,
-+           typed_array_callback.GetOverloadResolution(&js_array_callback));
-+
-   v8::CFunction swapped_params_callback =
-       v8::CFunctionBuilder().Fn(FastCallback3SwappedParams).Build();
- 
-   // Check that difference in > 1 position is not possible.
--  CHECK_EQ(v8::CFunction::OverloadResolution::kImpossible,
--           js_array_callback.GetOverloadResolution(&swapped_params_callback));
-+  CHECK_EQ(
-+      v8::CFunction::OverloadResolution::kImpossible,
-+      typed_array_callback.GetOverloadResolution(&swapped_params_callback));
- 
-   v8::CFunction scalar_callback =
-       v8::CFunctionBuilder().Fn(FastCallback4Scalar).Build();
-@@ -29822,7 +29932,7 @@ TEST(FastApiOverloadResolution) {
-   // Check that resolving when there is a scalar at the difference position
-   // is not possible.
-   CHECK_EQ(v8::CFunction::OverloadResolution::kImpossible,
--           js_array_callback.GetOverloadResolution(&scalar_callback));
-+           typed_array_callback.GetOverloadResolution(&scalar_callback));
- 
-   v8::CFunction diff_arity_callback =
-       v8::CFunctionBuilder().Fn(FastCallback5DifferentArity).Build();
-@@ -29830,7 +29940,7 @@ TEST(FastApiOverloadResolution) {
-   // Check that overload resolution between different number of arguments
-   // is possible.
-   CHECK_EQ(v8::CFunction::OverloadResolution::kAtCompileTime,
--           js_array_callback.GetOverloadResolution(&diff_arity_callback));
-+           typed_array_callback.GetOverloadResolution(&diff_arity_callback));
- 
- #endif  // !defined(V8_LITE_MODE) && defined(V8_ENABLE_TURBOFAN)
- }

+ 0 - 525
patches/v8/revert_fastapi_add_support_for_attribute_setters.patch

@@ -1,525 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Calvin Watford <[email protected]>
-Date: Tue, 26 Nov 2024 16:06:53 -0700
-Subject: Revert "[fastapi] Add support for attribute setters"
-
-Revert this until Node.js decides how to proceed and then pick up their fix.
-
-Refs: https://github.com/nodejs/node/issues/55452
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5956408
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5982984
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5979766
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/6023139
-
-This reverts commit 6520094871895fbafe91403ceb700ff97fdfd413.
-
-diff --git a/src/compiler/fast-api-calls.cc b/src/compiler/fast-api-calls.cc
-index 5da23c3d55bc105ed380762dd515f8856cbe5933..2dc99dc83e0f78d2bbb0875cc04064b565deaf06 100644
---- a/src/compiler/fast-api-calls.cc
-+++ b/src/compiler/fast-api-calls.cc
-@@ -379,46 +379,6 @@ Node* BuildFastApiCall(Isolate* isolate, Graph* graph,
-   return builder.Build(c_function, data_argument);
- }
- 
--FastApiCallFunction GetFastApiCallTarget(
--    JSHeapBroker* broker, FunctionTemplateInfoRef function_template_info,
--    size_t arg_count) {
--  if (!v8_flags.turbo_fast_api_calls) return {0, nullptr};
--
--  static constexpr int kReceiver = 1;
--
--  const ZoneVector<const CFunctionInfo*>& signatures =
--      function_template_info.c_signatures(broker);
--  const size_t overloads_count = signatures.size();
--
--  // Only considers entries whose type list length matches arg_count.
--  for (size_t i = 0; i < overloads_count; i++) {
--    const CFunctionInfo* c_signature = signatures[i];
--    const size_t len = c_signature->ArgumentCount() - kReceiver;
--    bool optimize_to_fast_call =
--        (len == arg_count) &&
--        fast_api_call::CanOptimizeFastSignature(c_signature);
--
--    if (optimize_to_fast_call) {
--      // TODO(nicohartmann@): {Flags::kEnforceRangeBit} is currently only
--      // supported on 64 bit architectures. We should support this on 32 bit
--      // architectures.
--#if defined(V8_TARGET_ARCH_32_BIT)
--      for (unsigned int i = 0; i < c_signature->ArgumentCount(); ++i) {
--        const uint8_t flags =
--            static_cast<uint8_t>(c_signature->ArgumentInfo(i).GetFlags());
--        if (flags & static_cast<uint8_t>(CTypeInfo::Flags::kEnforceRangeBit)) {
--          // Bailout
--          return {0, nullptr};
--        }
--      }
--#endif
--      return {function_template_info.c_functions(broker)[i], c_signature};
--    }
--  }
--
--  return {0, nullptr};
--}
--
- }  // namespace fast_api_call
- }  // namespace compiler
- }  // namespace internal
-diff --git a/src/compiler/fast-api-calls.h b/src/compiler/fast-api-calls.h
-index b49322d91d06b7fed34fe41b6ac7d31dcc7783c4..171e66c427991bfe7db5c2875d12559767a24b55 100644
---- a/src/compiler/fast-api-calls.h
-+++ b/src/compiler/fast-api-calls.h
-@@ -55,10 +55,6 @@ Node* BuildFastApiCall(Isolate* isolate, Graph* graph,
-                        const InitializeOptions& initialize_options,
-                        const GenerateSlowApiCall& generate_slow_api_call);
- 
--FastApiCallFunction GetFastApiCallTarget(
--    JSHeapBroker* broker, FunctionTemplateInfoRef function_template_info,
--    size_t arg_count);
--
- }  // namespace fast_api_call
- }  // namespace compiler
- }  // namespace internal
-diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc
-index 48663a4fcc284b7d832849e0c467019b384a31ff..d75a38769d582cd6e5a807f9670732dc92d77b7e 100644
---- a/src/compiler/js-call-reducer.cc
-+++ b/src/compiler/js-call-reducer.cc
-@@ -3877,6 +3877,58 @@ Reduction JSCallReducer::ReduceCallWasmFunction(Node* node,
- }
- #endif  // V8_ENABLE_WEBASSEMBLY
- 
-+// Given a FunctionTemplateInfo, checks whether the fast API call can be
-+// optimized, applying the initial step of the overload resolution algorithm:
-+// Given an overload set function_template_info.c_signatures, and a list of
-+// arguments of size arg_count:
-+// 1. Remove from the set all entries whose type list is not of length
-+//    arg_count.
-+// Returns an array with the indexes of the remaining entries in S, which
-+// represents the set of "optimizable" function overloads.
-+
-+FastApiCallFunction GetFastApiCallTarget(
-+    JSHeapBroker* broker, FunctionTemplateInfoRef function_template_info,
-+    size_t arg_count) {
-+  if (!v8_flags.turbo_fast_api_calls) return {0, nullptr};
-+
-+  static constexpr int kReceiver = 1;
-+
-+  ZoneVector<Address> functions = function_template_info.c_functions(broker);
-+  ZoneVector<const CFunctionInfo*> signatures =
-+      function_template_info.c_signatures(broker);
-+  const size_t overloads_count = signatures.size();
-+
-+  // Only considers entries whose type list length matches arg_count.
-+  for (size_t i = 0; i < overloads_count; i++) {
-+    const CFunctionInfo* c_signature = signatures[i];
-+    const size_t len = c_signature->ArgumentCount() - kReceiver;
-+    bool optimize_to_fast_call = (len == arg_count);
-+
-+    optimize_to_fast_call =
-+        optimize_to_fast_call &&
-+        fast_api_call::CanOptimizeFastSignature(c_signature);
-+
-+    if (optimize_to_fast_call) {
-+      // TODO(nicohartmann@): {Flags::kEnforceRangeBit} is currently only
-+      // supported on 64 bit architectures. We should support this on 32 bit
-+      // architectures.
-+#if defined(V8_TARGET_ARCH_32_BIT)
-+      for (unsigned int i = 0; i < c_signature->ArgumentCount(); ++i) {
-+        const uint8_t flags =
-+            static_cast<uint8_t>(c_signature->ArgumentInfo(i).GetFlags());
-+        if (flags & static_cast<uint8_t>(CTypeInfo::Flags::kEnforceRangeBit)) {
-+          // Bailout
-+          return {0, nullptr};
-+        }
-+      }
-+#endif
-+      return {functions[i], c_signature};
-+    }
-+  }
-+
-+  return {0, nullptr};
-+}
-+
- Reduction JSCallReducer::ReduceCallApiFunction(Node* node,
-                                                SharedFunctionInfoRef shared) {
-   JSCallNode n(node);
-@@ -4057,8 +4109,8 @@ Reduction JSCallReducer::ReduceCallApiFunction(Node* node,
-   }
- 
-   // Handles overloaded functions.
--  FastApiCallFunction c_function = fast_api_call::GetFastApiCallTarget(
--      broker(), function_template_info, argc);
-+  FastApiCallFunction c_function =
-+      GetFastApiCallTarget(broker(), function_template_info, argc);
- 
-   if (c_function.address) {
-     FastApiCallReducerAssembler a(this, node, function_template_info,
-diff --git a/src/compiler/js-native-context-specialization.cc b/src/compiler/js-native-context-specialization.cc
-index 5b9a78e7a9a728842148eebe733501174c0c94a1..95c44eb81f9eba481b7c795d0a8becb1aa757a90 100644
---- a/src/compiler/js-native-context-specialization.cc
-+++ b/src/compiler/js-native-context-specialization.cc
-@@ -16,7 +16,6 @@
- #include "src/compiler/allocation-builder.h"
- #include "src/compiler/common-operator.h"
- #include "src/compiler/compilation-dependencies.h"
--#include "src/compiler/fast-api-calls.h"
- #include "src/compiler/frame-states.h"
- #include "src/compiler/graph-assembler.h"
- #include "src/compiler/js-graph.h"
-@@ -1463,7 +1462,7 @@ Reduction JSNativeContextSpecialization::ReduceMegaDOMPropertyAccess(
- 
-   value = InlineApiCall(lookup_start_object, lookup_start_object, frame_state,
-                         nullptr /*value*/, &effect, &control,
--                        function_template_info, source);
-+                        function_template_info);
-   ReplaceWithValue(node, value, effect, control);
-   return Replace(value);
- }
-@@ -2835,8 +2834,7 @@ Node* JSNativeContextSpecialization::InlinePropertyGetterCall(
-                                  access_info.api_holder().value(), broker())
-                            : receiver;
-     value = InlineApiCall(receiver, api_holder, frame_state, nullptr, effect,
--                          control, constant.AsFunctionTemplateInfo(),
--                          FeedbackSource());
-+                          control, constant.AsFunctionTemplateInfo());
-   }
-   // Remember to rewire the IfException edge if this is inside a try-block.
-   if (if_exceptions != nullptr) {
-@@ -2871,7 +2869,7 @@ void JSNativeContextSpecialization::InlinePropertySetterCall(
-                                  access_info.api_holder().value(), broker())
-                            : receiver;
-     InlineApiCall(receiver, api_holder, frame_state, value, effect, control,
--                  constant.AsFunctionTemplateInfo(), FeedbackSource());
-+                  constant.AsFunctionTemplateInfo());
-   }
-   // Remember to rewire the IfException edge if this is inside a try-block.
-   if (if_exceptions != nullptr) {
-@@ -2884,66 +2882,10 @@ void JSNativeContextSpecialization::InlinePropertySetterCall(
-   }
- }
- 
--namespace {
--CallDescriptor* PushRegularApiCallInputs(
--    JSGraph* jsgraph, JSHeapBroker* broker, Node* receiver, Node* api_holder,
--    Node* frame_state, Node* value, Node** effect, Node** control,
--    FunctionTemplateInfoRef function_template_info, Node** inputs,
--    int& cursor) {
--  // Only setters have a value.
--  int const argc = value == nullptr ? 0 : 1;
--
--  // The builtin always expects the receiver as the first param on the stack.
--  bool no_profiling = broker->dependencies()->DependOnNoProfilingProtector();
--  Callable call_api_callback = Builtins::CallableFor(
--      jsgraph->isolate(), no_profiling
--                              ? Builtin::kCallApiCallbackOptimizedNoProfiling
--                              : Builtin::kCallApiCallbackOptimized);
--
--  Node* func_templ =
--      jsgraph->HeapConstantNoHole(function_template_info.object());
--  ApiFunction function(function_template_info.callback(broker));
--  Node* function_reference = jsgraph->graph()->NewNode(
--      jsgraph->common()->ExternalConstant(ExternalReference::Create(
--          jsgraph->isolate(), &function, ExternalReference::DIRECT_API_CALL,
--          function_template_info.c_functions(broker).data(),
--          function_template_info.c_signatures(broker).data(),
--          static_cast<uint32_t>(
--              function_template_info.c_functions(broker).size()))));
--  Node* code = jsgraph->HeapConstantNoHole(call_api_callback.code());
--
--  // Add CallApiCallbackStub's register argument as well.
--  Node* context =
--      jsgraph->ConstantNoHole(broker->target_native_context(), broker);
--  inputs[cursor++] = code;
--  inputs[cursor++] = function_reference;
--  inputs[cursor++] = jsgraph->ConstantNoHole(argc);
--  inputs[cursor++] = func_templ;
--  inputs[cursor++] = api_holder;
--  inputs[cursor++] = receiver;
--  if (value) {
--    inputs[cursor++] = value;
--  }
--  inputs[cursor++] = context;
--  inputs[cursor++] = frame_state;
--  inputs[cursor++] = *effect;
--  inputs[cursor++] = *control;
--
--  CallInterfaceDescriptor call_interface_descriptor =
--      call_api_callback.descriptor();
--  return Linkage::GetStubCallDescriptor(
--      jsgraph->zone(), call_interface_descriptor,
--      call_interface_descriptor.GetStackParameterCount() + argc +
--          1 /* implicit receiver */,
--      CallDescriptor::kNeedsFrameState);
--}
--}  // namespace
--
- Node* JSNativeContextSpecialization::InlineApiCall(
-     Node* receiver, Node* api_holder, Node* frame_state, Node* value,
-     Node** effect, Node** control,
--    FunctionTemplateInfoRef function_template_info,
--    const FeedbackSource& feedback) {
-+    FunctionTemplateInfoRef function_template_info) {
-   compiler::OptionalObjectRef maybe_callback_data =
-       function_template_info.callback_data(broker());
-   // Check if the function has an associated C++ code to execute.
-@@ -2957,44 +2899,45 @@ Node* JSNativeContextSpecialization::InlineApiCall(
- 
-   // Only setters have a value.
-   int const argc = value == nullptr ? 0 : 1;
-+  // The builtin always expects the receiver as the first param on the stack.
-+  bool no_profiling = broker()->dependencies()->DependOnNoProfilingProtector();
-+  Callable call_api_callback = Builtins::CallableFor(
-+      isolate(), no_profiling ? Builtin::kCallApiCallbackOptimizedNoProfiling
-+                              : Builtin::kCallApiCallbackOptimized);
-+  CallInterfaceDescriptor call_interface_descriptor =
-+      call_api_callback.descriptor();
-+  auto call_descriptor = Linkage::GetStubCallDescriptor(
-+      graph()->zone(), call_interface_descriptor,
-+      call_interface_descriptor.GetStackParameterCount() + argc +
-+          1 /* implicit receiver */,
-+      CallDescriptor::kNeedsFrameState);
- 
--  // Handles overloaded functions.
--  FastApiCallFunction c_function = fast_api_call::GetFastApiCallTarget(
--      broker(), function_template_info, argc);
--
--  if (c_function.address) {
--    const int input_count = 14;
--    Node* inputs[input_count];
--
--    int cursor = 0;
--    inputs[cursor++] = receiver;
--    if (value) {
--      inputs[cursor++] = value;
--    }
--    inputs[cursor++] =
--        jsgraph()->ConstantNoHole(maybe_callback_data.value(), broker());
--
--    auto call_descriptor = PushRegularApiCallInputs(
--        jsgraph(), broker(), receiver, api_holder, frame_state, value, effect,
--        control, function_template_info, inputs, cursor);
--
--    // The input_count is constant, but getters have less parameters than
--    // setters.
--    DCHECK_LE(cursor, input_count);
-+  Node* func_templ =
-+      jsgraph()->HeapConstantNoHole(function_template_info.object());
-+  ApiFunction function(function_template_info.callback(broker()));
-+  Node* function_reference =
-+      graph()->NewNode(common()->ExternalConstant(ExternalReference::Create(
-+          &function, ExternalReference::DIRECT_API_CALL)));
-+  Node* code = jsgraph()->HeapConstantNoHole(call_api_callback.code());
- 
--    return *effect = *control = graph()->NewNode(
--               simplified()->FastApiCall(c_function, feedback, call_descriptor),
--               cursor, inputs);
-+  // Add CallApiCallbackStub's register argument as well.
-+  Node* context = jsgraph()->ConstantNoHole(native_context(), broker());
-+  Node* inputs[11] = {
-+      code,       function_reference, jsgraph()->ConstantNoHole(argc),
-+      func_templ, api_holder,         receiver};
-+  int index = 6 + argc;
-+  inputs[index++] = context;
-+  inputs[index++] = frame_state;
-+  inputs[index++] = *effect;
-+  inputs[index++] = *control;
-+  // This needs to stay here because of the edge case described in
-+  // http://crbug.com/675648.
-+  if (value != nullptr) {
-+    inputs[6] = value;
-   }
- 
--  Node* inputs[11];
--  int cursor = 0;
--  CallDescriptor* call_descriptor = PushRegularApiCallInputs(
--      jsgraph(), broker(), receiver, api_holder, frame_state, value, effect,
--      control, function_template_info, inputs, cursor);
--
-   return *effect = *control =
--             graph()->NewNode(common()->Call(call_descriptor), cursor, inputs);
-+             graph()->NewNode(common()->Call(call_descriptor), index, inputs);
- }
- 
- std::optional<JSNativeContextSpecialization::ValueEffectControl>
-diff --git a/src/compiler/js-native-context-specialization.h b/src/compiler/js-native-context-specialization.h
-index 8761637df00ed1a717ca581ef5faf8c78ec3336b..c74b59b6cc4c742fa5c50df2cc89794c8bd0f23d 100644
---- a/src/compiler/js-native-context-specialization.h
-+++ b/src/compiler/js-native-context-specialization.h
-@@ -185,8 +185,7 @@ class V8_EXPORT_PRIVATE JSNativeContextSpecialization final
-                                 PropertyAccessInfo const& access_info);
-   Node* InlineApiCall(Node* receiver, Node* api_holder, Node* frame_state,
-                       Node* value, Node** effect, Node** control,
--                      FunctionTemplateInfoRef function_template_info,
--                      const FeedbackSource& feedback);
-+                      FunctionTemplateInfoRef function_template_info);
- 
-   // Construct the appropriate subgraph for element access.
-   ValueEffectControl BuildElementAccess(Node* receiver, Node* index,
-diff --git a/src/d8/d8-test.cc b/src/d8/d8-test.cc
-index 77e3b3d71d552fdb50e47b75ca8d1bc7296bb9d4..6467930fbb39a67a10d6822545e985965ced83ad 100644
---- a/src/d8/d8-test.cc
-+++ b/src/d8/d8-test.cc
-@@ -1305,67 +1305,6 @@ class FastCApiObject {
-     info.GetReturnValue().Set(BigInt::NewFromUnsigned(isolate, a + b));
-   }
- 
--  static void AttributeGetterSlowCallback(
--      const FunctionCallbackInfo<Value>& info) {
--    FastCApiObject* self = UnwrapObject(info.This());
--    self->slow_call_count_++;
--    info.GetReturnValue().Set(self->attribute_value_);
--  }
--
--  static int AttributeGetterFastCallback(Local<Object> receiver,
--                                         FastApiCallbackOptions& options) {
--    FastCApiObject* self = UnwrapObject(receiver);
--    CHECK_SELF_OR_THROW_FAST_OPTIONS(0);
--    self->fast_call_count_++;
--    return self->attribute_value_;
--  }
--
--#ifdef V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS
--  static AnyCType AttributeGetterFastCallbackPatch(AnyCType receiver,
--                                                   AnyCType options) {
--    AnyCType ret;
--    ret.int32_value = AttributeGetterFastCallback(receiver.object_value,
--                                                  *options.options_value);
--    return ret;
--  }
--#endif  //  V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS
--
--  static void AttributeSetterSlowCallback(
--      const FunctionCallbackInfo<Value>& info) {
--    FastCApiObject* self = UnwrapObject(info.This());
--    self->slow_call_count_++;
--    if (info.Length() < 1 || !info[0]->IsNumber()) {
--      info.GetIsolate()->ThrowError(
--          "The attribute requires a number as a new value");
--      return;
--    }
--    double double_val =
--        info[0]->NumberValue(info.GetIsolate()->GetCurrentContext()).FromJust();
--    if (!base::IsValueInRangeForNumericType<int>(double_val)) {
--      info.GetIsolate()->ThrowError(
--          "New value of attribute is not within int32 range");
--      return;
--    }
--    self->attribute_value_ = static_cast<int>(double_val);
--  }
--
--  static void AttributeSetterFastCallback(Local<Object> receiver, int32_t value,
--                                          FastApiCallbackOptions& options) {
--    FastCApiObject* self = UnwrapObject(receiver);
--    CHECK_SELF_OR_THROW_FAST_OPTIONS();
--    self->fast_call_count_++;
--    self->attribute_value_ = value;
--  }
--
--#ifdef V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS
--  static void AttributeSetterFastCallbackPatch(AnyCType receiver,
--                                               AnyCType value,
--                                               AnyCType options) {
--    AttributeSetterFastCallback(receiver.object_value, value.int32_value,
--                                *options.options_value);
--  }
--#endif  //  V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS
--
-   static void FastCallCount(const FunctionCallbackInfo<Value>& info) {
-     FastCApiObject* self = UnwrapObject(info.This());
-     CHECK_SELF_OR_THROW_SLOW();
-@@ -1500,25 +1439,6 @@ Local<FunctionTemplate> Shell::CreateTestFastCApiTemplate(Isolate* isolate) {
-                               ConstructorBehavior::kThrow,
-                               SideEffectType::kHasSideEffect, &add_all_c_func));
- 
--    CFunction fast_setter = CFunction::Make(
--        FastCApiObject::AttributeSetterFastCallback V8_IF_USE_SIMULATOR(
--            FastCApiObject::AttributeSetterFastCallback));
--    CFunction fast_getter = CFunction::Make(
--        FastCApiObject::AttributeGetterFastCallback V8_IF_USE_SIMULATOR(
--            FastCApiObject::AttributeGetterFastCallback));
--
--    api_obj_ctor->PrototypeTemplate()->SetAccessorProperty(
--        String::NewFromUtf8(isolate, "fast_attribute").ToLocalChecked(),
--        FunctionTemplate::New(
--            isolate, FastCApiObject::AttributeGetterSlowCallback,
--            Local<Value>(), signature, 1, ConstructorBehavior::kThrow,
--            SideEffectType::kHasSideEffect, &fast_getter),
--        FunctionTemplate::New(
--            isolate, FastCApiObject::AttributeSetterSlowCallback,
--            Local<Value>(), signature, 1, ConstructorBehavior::kThrow,
--            SideEffectType::kHasSideEffect, &fast_setter),
--        v8::PropertyAttribute::None);
--
-     CFunction add_all_seq_c_func = CFunction::Make(
-         FastCApiObject::AddAllSequenceFastCallback V8_IF_USE_SIMULATOR(
-             FastCApiObject::AddAllSequenceFastCallbackPatch));
-diff --git a/test/mjsunit/compiler/fast-api-attributes.js b/test/mjsunit/compiler/fast-api-attributes.js
-deleted file mode 100644
-index 137e5c917cf7a56c89e70ed49d07e3134d1c8eac..0000000000000000000000000000000000000000
---- a/test/mjsunit/compiler/fast-api-attributes.js
-+++ /dev/null
-@@ -1,45 +0,0 @@
--// Copyright 2021 the V8 project authors. All rights reserved.
--// Use of this source code is governed by a BSD-style license that can be
--// found in the LICENSE file.
--
--// This file excercises basic fast API calls and enables fuzzing of this
--// functionality.
--
--// Flags: --turbo-fast-api-calls --expose-fast-api --allow-natives-syntax --turbofan
--// --always-turbofan is disabled because we rely on particular feedback for
--// optimizing to the fastest path.
--// Flags: --no-always-turbofan
--// The test relies on optimizing/deoptimizing at predictable moments, so
--// it's not suitable for deoptimization fuzzing.
--// Flags: --deopt-every-n-times=0
--// Flags: --fast-api-allow-float-in-sim
--
--const fast_c_api = new d8.test.FastCAPI();
--
--function get() {
--    return fast_c_api.fast_attribute;
--}
--
--function set(value) {
--    fast_c_api.fast_attribute = value;
--}
--
--%PrepareFunctionForOptimization(set);
--set(12);
--%OptimizeFunctionOnNextCall(set);
--%PrepareFunctionForOptimization(get);
--assertEquals(12, get());
--%OptimizeFunctionOnNextCall(get);
--
--
--fast_c_api.reset_counts();
--set(21);
--assertOptimized(set);
--assertEquals(1, fast_c_api.fast_call_count());
--assertEquals(0, fast_c_api.slow_call_count());
--
--fast_c_api.reset_counts();
--assertEquals(21, get());
--assertOptimized(get);
--assertEquals(1, fast_c_api.fast_call_count());
--assertEquals(0, fast_c_api.slow_call_count());
-diff --git a/test/mjsunit/mjsunit.status b/test/mjsunit/mjsunit.status
-index 93fe36a988be33f1eab1e814c8f0ad62bfbcbb53..632a8f4f0475076f82f66c73a29d92d3e9fc8c50 100644
---- a/test/mjsunit/mjsunit.status
-+++ b/test/mjsunit/mjsunit.status
-@@ -757,7 +757,6 @@
-   # These tests rely on TurboFan being enabled.
-   'compiler/call-with-arraylike-or-spread*': [SKIP],
-   'compiler/fast-api-calls': [SKIP],
--  'compiler/fast-api-attributes': [SKIP],
-   'compiler/fast-api-interface-types': [SKIP],
-   'compiler/regress-crbug-1201011': [SKIP],
-   'compiler/regress-crbug-1201057': [SKIP],
-@@ -2358,7 +2357,6 @@
-   'regress/regress-1049982-2': [FAIL],
-   # Maglev doesn't support fast API calls.
-   'compiler/fast-api-annotations': [FAIL],
--  'compiler/fast-api-attributes': [FAIL],
-   'compiler/fast-api-calls': [FAIL],
-   'compiler/fast-api-calls-8args': [FAIL],
-   'compiler/fast-api-calls-string': [FAIL],

+ 0 - 853
patches/v8/revert_fastapi_remove_dynamic_overload_resolution.patch

@@ -1,853 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: John Kleinschmidt <[email protected]>
-Date: Fri, 15 Nov 2024 10:46:43 -0500
-Subject: Revert "[fastapi] Remove dynamic overload resolution"
-
-Revert this until Node.js decides how to proceed and then pick up their fix.
-
-Refs: https://github.com/nodejs/node/issues/55452
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5956408
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5982984
-Refs: https://chromium-review.googlesource.com/c/v8/v8/+/5979766
-
-This reverts commit c41f7a0ef99bd1c9752ee79923f634145ebc4153.
-
-diff --git a/src/api/api.cc b/src/api/api.cc
-index af1f0f3ad6ad0f2f0e7cb0123f9cd1ad0d1c80cb..b6a8bd3dfe53494502f13dbbfdfad1d79f621d40 100644
---- a/src/api/api.cc
-+++ b/src/api/api.cc
-@@ -1349,16 +1349,6 @@ Local<FunctionTemplate> FunctionTemplate::NewWithCFunctionOverloads(
-   i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(v8_isolate);
-   API_RCS_SCOPE(i_isolate, FunctionTemplate, New);
- 
--  // Check that all overloads of the fast API callback have different numbers of
--  // parameters. Since the number of overloads is supposed to be small, just
--  // comparing them with each other should be fine.
--  for (size_t i = 0; i < c_function_overloads.size(); ++i) {
--    for (size_t j = i + 1; j < c_function_overloads.size(); ++j) {
--      CHECK_NE(c_function_overloads.data()[i].ArgumentCount(),
--               c_function_overloads.data()[j].ArgumentCount());
--    }
--  }
--
-   if (!Utils::ApiCheck(
-           c_function_overloads.empty() ||
-               behavior == ConstructorBehavior::kThrow,
-diff --git a/src/compiler/fast-api-calls.cc b/src/compiler/fast-api-calls.cc
-index 2dc99dc83e0f78d2bbb0875cc04064b565deaf06..d560afa2ee9f4384738cddf659a51d4c42b4fe67 100644
---- a/src/compiler/fast-api-calls.cc
-+++ b/src/compiler/fast-api-calls.cc
-@@ -62,6 +62,52 @@ ElementsKind GetTypedArrayElementsKind(CTypeInfo::Type type) {
-   }
- }
- 
-+OverloadsResolutionResult ResolveOverloads(
-+    const FastApiCallFunctionVector& candidates, unsigned int arg_count) {
-+  DCHECK_GT(arg_count, 0);
-+
-+  static constexpr int kReceiver = 1;
-+
-+  // Only the case of the overload resolution of two functions, one with a
-+  // JSArray param and the other with a typed array param is currently
-+  // supported.
-+  DCHECK_EQ(candidates.size(), 2);
-+
-+  for (unsigned int arg_index = kReceiver; arg_index < arg_count; arg_index++) {
-+    int index_of_func_with_js_array_arg = -1;
-+    int index_of_func_with_typed_array_arg = -1;
-+    CTypeInfo::Type element_type = CTypeInfo::Type::kVoid;
-+
-+    for (size_t i = 0; i < candidates.size(); i++) {
-+      const CTypeInfo& type_info =
-+          candidates[i].signature->ArgumentInfo(arg_index);
-+      CTypeInfo::SequenceType sequence_type = type_info.GetSequenceType();
-+
-+      START_ALLOW_USE_DEPRECATED()
-+      if (sequence_type == CTypeInfo::SequenceType::kIsSequence) {
-+        DCHECK_LT(index_of_func_with_js_array_arg, 0);
-+        index_of_func_with_js_array_arg = static_cast<int>(i);
-+      } else if (sequence_type == CTypeInfo::SequenceType::kIsTypedArray) {
-+        DCHECK_LT(index_of_func_with_typed_array_arg, 0);
-+        index_of_func_with_typed_array_arg = static_cast<int>(i);
-+        element_type = type_info.GetType();
-+      } else {
-+        DCHECK_LT(index_of_func_with_js_array_arg, 0);
-+        DCHECK_LT(index_of_func_with_typed_array_arg, 0);
-+      }
-+      END_ALLOW_USE_DEPRECATED()
-+    }
-+
-+    if (index_of_func_with_js_array_arg >= 0 &&
-+        index_of_func_with_typed_array_arg >= 0) {
-+      return {static_cast<int>(arg_index), element_type};
-+    }
-+  }
-+
-+  // No overload found with a JSArray and a typed array as i-th argument.
-+  return OverloadsResolutionResult::Invalid();
-+}
-+
- bool CanOptimizeFastSignature(const CFunctionInfo* c_signature) {
-   USE(c_signature);
- 
-@@ -149,7 +195,8 @@ class FastApiCallBuilder {
-         initialize_options_(initialize_options),
-         generate_slow_api_call_(generate_slow_api_call) {}
- 
--  Node* Build(FastApiCallFunction c_function, Node* data_argument);
-+  Node* Build(const FastApiCallFunctionVector& c_functions,
-+              const CFunctionInfo* c_signature, Node* data_argument);
- 
-  private:
-   Node* WrapFastCall(const CallDescriptor* call_descriptor, int inputs_size,
-@@ -230,15 +277,35 @@ void FastApiCallBuilder::PropagateException() {
-   __ Call(call_descriptor, count, inputs);
- }
- 
--Node* FastApiCallBuilder::Build(FastApiCallFunction c_function,
-+Node* FastApiCallBuilder::Build(const FastApiCallFunctionVector& c_functions,
-+                                const CFunctionInfo* c_signature,
-                                 Node* data_argument) {
--  const CFunctionInfo* c_signature = c_function.signature;
-   const int c_arg_count = c_signature->ArgumentCount();
- 
-   // Hint to fast path.
-   auto if_success = __ MakeLabel();
-   auto if_error = __ MakeDeferredLabel();
- 
-+  // Overload resolution
-+  bool generate_fast_call = false;
-+  OverloadsResolutionResult overloads_resolution_result =
-+      OverloadsResolutionResult::Invalid();
-+
-+  if (c_functions.size() == 1) {
-+    generate_fast_call = true;
-+  } else {
-+    DCHECK_EQ(c_functions.size(), 2);
-+    overloads_resolution_result = ResolveOverloads(c_functions, c_arg_count);
-+    if (overloads_resolution_result.is_valid()) {
-+      generate_fast_call = true;
-+    }
-+  }
-+
-+  if (!generate_fast_call) {
-+    // Only generate the slow call.
-+    return generate_slow_api_call_();
-+  }
-+
-   // Generate fast call.
- 
-   const int kFastTargetAddressInputIndex = 0;
-@@ -263,11 +330,18 @@ Node* FastApiCallBuilder::Build(FastApiCallFunction c_function,
-   // address associated to the first and only element in the c_functions vector.
-   // If there are multiple overloads the value of this input will be set later
-   // with a Phi node created by AdaptOverloadedFastCallArgument.
--  inputs[kFastTargetAddressInputIndex] = __ ExternalConstant(
--      ExternalReference::Create(c_function.address, ref_type));
-+  inputs[kFastTargetAddressInputIndex] =
-+      (c_functions.size() == 1) ? __ ExternalConstant(ExternalReference::Create(
-+                                      c_functions[0].address, ref_type))
-+                                : nullptr;
- 
-   for (int i = 0; i < c_arg_count; ++i) {
--    inputs[i + kFastTargetAddressInputCount] = get_parameter_(i, &if_error);
-+    inputs[i + kFastTargetAddressInputCount] =
-+        get_parameter_(i, overloads_resolution_result, &if_error);
-+    if (overloads_resolution_result.target_address) {
-+      inputs[kFastTargetAddressInputIndex] =
-+          overloads_resolution_result.target_address;
-+    }
-   }
-   DCHECK_NOT_NULL(inputs[kFastTargetAddressInputIndex]);
- 
-@@ -368,7 +442,8 @@ Node* FastApiCallBuilder::Build(FastApiCallFunction c_function,
- 
- Node* BuildFastApiCall(Isolate* isolate, Graph* graph,
-                        GraphAssembler* graph_assembler,
--                       FastApiCallFunction c_function, Node* data_argument,
-+                       const FastApiCallFunctionVector& c_functions,
-+                       const CFunctionInfo* c_signature, Node* data_argument,
-                        const GetParameter& get_parameter,
-                        const ConvertReturnValue& convert_return_value,
-                        const InitializeOptions& initialize_options,
-@@ -376,7 +451,7 @@ Node* BuildFastApiCall(Isolate* isolate, Graph* graph,
-   FastApiCallBuilder builder(isolate, graph, graph_assembler, get_parameter,
-                              convert_return_value, initialize_options,
-                              generate_slow_api_call);
--  return builder.Build(c_function, data_argument);
-+  return builder.Build(c_functions, c_signature, data_argument);
- }
- 
- }  // namespace fast_api_call
-diff --git a/src/compiler/fast-api-calls.h b/src/compiler/fast-api-calls.h
-index 171e66c427991bfe7db5c2875d12559767a24b55..b97b37e5746433d3801de19d4666a19afc223cdc 100644
---- a/src/compiler/fast-api-calls.h
-+++ b/src/compiler/fast-api-calls.h
-@@ -40,16 +40,21 @@ struct OverloadsResolutionResult {
- 
- ElementsKind GetTypedArrayElementsKind(CTypeInfo::Type type);
- 
-+OverloadsResolutionResult ResolveOverloads(
-+    const FastApiCallFunctionVector& candidates, unsigned int arg_count);
-+
- bool CanOptimizeFastSignature(const CFunctionInfo* c_signature);
- 
--using GetParameter = std::function<Node*(int, GraphAssemblerLabel<0>*)>;
-+using GetParameter = std::function<Node*(int, OverloadsResolutionResult&,
-+                                         GraphAssemblerLabel<0>*)>;
- using ConvertReturnValue = std::function<Node*(const CFunctionInfo*, Node*)>;
- using InitializeOptions = std::function<void(Node*)>;
- using GenerateSlowApiCall = std::function<Node*()>;
- 
- Node* BuildFastApiCall(Isolate* isolate, Graph* graph,
-                        GraphAssembler* graph_assembler,
--                       FastApiCallFunction c_function, Node* data_argument,
-+                       const FastApiCallFunctionVector& c_functions,
-+                       const CFunctionInfo* c_signature, Node* data_argument,
-                        const GetParameter& get_parameter,
-                        const ConvertReturnValue& convert_return_value,
-                        const InitializeOptions& initialize_options,
-diff --git a/src/compiler/js-call-reducer.cc b/src/compiler/js-call-reducer.cc
-index d75a38769d582cd6e5a807f9670732dc92d77b7e..a29bd4a5be0c9a268386898f8a52e98933211b6c 100644
---- a/src/compiler/js-call-reducer.cc
-+++ b/src/compiler/js-call-reducer.cc
-@@ -631,11 +631,11 @@ class FastApiCallReducerAssembler : public JSCallReducerAssembler {
-   FastApiCallReducerAssembler(
-       JSCallReducer* reducer, Node* node,
-       const FunctionTemplateInfoRef function_template_info,
--      FastApiCallFunction c_function, Node* receiver, Node* holder,
--      const SharedFunctionInfoRef shared, Node* target, const int arity,
--      Node* effect)
-+      const FastApiCallFunctionVector& c_candidate_functions, Node* receiver,
-+      Node* holder, const SharedFunctionInfoRef shared, Node* target,
-+      const int arity, Node* effect)
-       : JSCallReducerAssembler(reducer, node),
--        c_function_(c_function),
-+        c_candidate_functions_(c_candidate_functions),
-         function_template_info_(function_template_info),
-         receiver_(receiver),
-         holder_(holder),
-@@ -643,6 +643,7 @@ class FastApiCallReducerAssembler : public JSCallReducerAssembler {
-         target_(target),
-         arity_(arity) {
-     DCHECK_EQ(IrOpcode::kJSCall, node->opcode());
-+    CHECK_GT(c_candidate_functions.size(), 0);
-     InitializeEffectControl(effect, NodeProperties::GetControlInput(node));
-   }
- 
-@@ -654,7 +655,7 @@ class FastApiCallReducerAssembler : public JSCallReducerAssembler {
-     // All functions in c_candidate_functions_ have the same number of
-     // arguments, so extract c_argument_count from the first function.
-     const int c_argument_count =
--        static_cast<int>(c_function_.signature->ArgumentCount());
-+        static_cast<int>(c_candidate_functions_[0].signature->ArgumentCount());
-     CHECK_GE(c_argument_count, kReceiver);
- 
-     const int slow_arg_count =
-@@ -755,12 +756,13 @@ class FastApiCallReducerAssembler : public JSCallReducerAssembler {
- 
-   TNode<Object> FastApiCall(CallDescriptor* descriptor, Node** inputs,
-                             size_t inputs_size) {
--    return AddNode<Object>(graph()->NewNode(
--        simplified()->FastApiCall(c_function_, feedback(), descriptor),
--        static_cast<int>(inputs_size), inputs));
-+    return AddNode<Object>(
-+        graph()->NewNode(simplified()->FastApiCall(c_candidate_functions_,
-+                                                   feedback(), descriptor),
-+                         static_cast<int>(inputs_size), inputs));
-   }
- 
--  FastApiCallFunction c_function_;
-+  const FastApiCallFunctionVector c_candidate_functions_;
-   const FunctionTemplateInfoRef function_template_info_;
-   Node* const receiver_;
-   Node* const holder_;
-@@ -3886,10 +3888,11 @@ Reduction JSCallReducer::ReduceCallWasmFunction(Node* node,
- // Returns an array with the indexes of the remaining entries in S, which
- // represents the set of "optimizable" function overloads.
- 
--FastApiCallFunction GetFastApiCallTarget(
--    JSHeapBroker* broker, FunctionTemplateInfoRef function_template_info,
--    size_t arg_count) {
--  if (!v8_flags.turbo_fast_api_calls) return {0, nullptr};
-+FastApiCallFunctionVector CanOptimizeFastCall(
-+    JSHeapBroker* broker, Zone* zone,
-+    FunctionTemplateInfoRef function_template_info, size_t arg_count) {
-+  FastApiCallFunctionVector result(zone);
-+  if (!v8_flags.turbo_fast_api_calls) return result;
- 
-   static constexpr int kReceiver = 1;
- 
-@@ -3918,15 +3921,15 @@ FastApiCallFunction GetFastApiCallTarget(
-             static_cast<uint8_t>(c_signature->ArgumentInfo(i).GetFlags());
-         if (flags & static_cast<uint8_t>(CTypeInfo::Flags::kEnforceRangeBit)) {
-           // Bailout
--          return {0, nullptr};
-+          return FastApiCallFunctionVector(zone);
-         }
-       }
- #endif
--      return {functions[i], c_signature};
-+      result.push_back({functions[i], c_signature});
-     }
-   }
- 
--  return {0, nullptr};
-+  return result;
- }
- 
- Reduction JSCallReducer::ReduceCallApiFunction(Node* node,
-@@ -4109,13 +4112,15 @@ Reduction JSCallReducer::ReduceCallApiFunction(Node* node,
-   }
- 
-   // Handles overloaded functions.
--  FastApiCallFunction c_function =
--      GetFastApiCallTarget(broker(), function_template_info, argc);
- 
--  if (c_function.address) {
-+  FastApiCallFunctionVector c_candidate_functions = CanOptimizeFastCall(
-+      broker(), graph()->zone(), function_template_info, argc);
-+  DCHECK_LE(c_candidate_functions.size(), 2);
-+
-+  if (!c_candidate_functions.empty()) {
-     FastApiCallReducerAssembler a(this, node, function_template_info,
--                                  c_function, receiver, holder, shared, target,
--                                  argc, effect);
-+                                  c_candidate_functions, receiver, holder,
-+                                  shared, target, argc, effect);
-     Node* fast_call_subgraph = a.ReduceFastApiCall();
- 
-     return Replace(fast_call_subgraph);
-diff --git a/src/compiler/simplified-lowering.cc b/src/compiler/simplified-lowering.cc
-index 377d36b1d880892d0d446ee386d21028d3ffec16..ebb8bcd585f6b185e355922fd97c94bd0136d968 100644
---- a/src/compiler/simplified-lowering.cc
-+++ b/src/compiler/simplified-lowering.cc
-@@ -2015,7 +2015,7 @@ class RepresentationSelector {
-     // argument, which must be a JSArray in one function and a TypedArray in the
-     // other function, and both JSArrays and TypedArrays have the same UseInfo
-     // UseInfo::AnyTagged(). All the other argument types must match.
--    const CFunctionInfo* c_signature = op_params.c_function().signature;
-+    const CFunctionInfo* c_signature = op_params.c_functions()[0].signature;
-     const int c_arg_count = c_signature->ArgumentCount();
-     CallDescriptor* call_descriptor = op_params.descriptor();
-     // Arguments for CallApiCallbackOptimizedXXX builtin (including context)
-@@ -2057,8 +2057,12 @@ class RepresentationSelector {
- 
-     // Effect and Control.
-     ProcessRemainingInputs<T>(node, value_input_count);
-+    if (op_params.c_functions().empty()) {
-+      SetOutput<T>(node, MachineRepresentation::kTagged);
-+      return;
-+    }
- 
--    CTypeInfo return_type = op_params.c_function().signature->ReturnInfo();
-+    CTypeInfo return_type = op_params.c_functions()[0].signature->ReturnInfo();
-     switch (return_type.GetType()) {
-       case CTypeInfo::Type::kBool:
-         SetOutput<T>(node, MachineRepresentation::kBit);
-diff --git a/src/compiler/simplified-operator.cc b/src/compiler/simplified-operator.cc
-index d0405cf5bc25d47b7cf8bfd03b0bb639df4eddd4..f5810d72d99f4ecfe668d9e1fd9b3ad2ea123875 100644
---- a/src/compiler/simplified-operator.cc
-+++ b/src/compiler/simplified-operator.cc
-@@ -2096,21 +2096,26 @@ FastApiCallParameters const& FastApiCallParametersOf(const Operator* op) {
- }
- 
- std::ostream& operator<<(std::ostream& os, FastApiCallParameters const& p) {
--  FastApiCallFunction c_function = p.c_function();
--  os << c_function.address << ":" << c_function.signature << ", ";
-+  const auto& c_functions = p.c_functions();
-+  for (size_t i = 0; i < c_functions.size(); i++) {
-+    os << c_functions[i].address << ":" << c_functions[i].signature << ", ";
-+  }
-   return os << p.feedback() << ", " << p.descriptor();
- }
- 
- size_t hash_value(FastApiCallParameters const& p) {
--  FastApiCallFunction c_function = p.c_function();
--  size_t hash = base::hash_combine(c_function.address, c_function.signature);
-+  const auto& c_functions = p.c_functions();
-+  size_t hash = 0;
-+  for (size_t i = 0; i < c_functions.size(); i++) {
-+    hash = base::hash_combine(c_functions[i].address, c_functions[i].signature);
-+  }
-   return base::hash_combine(hash, FeedbackSource::Hash()(p.feedback()),
-                             p.descriptor());
- }
- 
- bool operator==(FastApiCallParameters const& lhs,
-                 FastApiCallParameters const& rhs) {
--  return lhs.c_function() == rhs.c_function() &&
-+  return lhs.c_functions() == rhs.c_functions() &&
-          lhs.feedback() == rhs.feedback() &&
-          lhs.descriptor() == rhs.descriptor();
- }
-@@ -2320,11 +2325,19 @@ const Operator* SimplifiedOperatorBuilder::TransitionAndStoreNonNumberElement(
- }
- 
- const Operator* SimplifiedOperatorBuilder::FastApiCall(
--    FastApiCallFunction c_function, FeedbackSource const& feedback,
--    CallDescriptor* descriptor) {
--  CHECK_NOT_NULL(c_function.signature);
--  const CFunctionInfo* signature = c_function.signature;
-+    const FastApiCallFunctionVector& c_functions,
-+    FeedbackSource const& feedback, CallDescriptor* descriptor) {
-+  DCHECK(!c_functions.empty());
-+
-+  // All function overloads have the same number of arguments and options.
-+  const CFunctionInfo* signature = c_functions[0].signature;
-   const int c_arg_count = signature->ArgumentCount();
-+  for (size_t i = 1; i < c_functions.size(); i++) {
-+    CHECK_NOT_NULL(c_functions[i].signature);
-+    DCHECK_EQ(c_functions[i].signature->ArgumentCount(), c_arg_count);
-+    DCHECK_EQ(c_functions[i].signature->HasOptions(),
-+              c_functions[0].signature->HasOptions());
-+  }
-   // Arguments for CallApiCallbackOptimizedXXX builtin (including context)
-   // plus JS arguments (including receiver).
-   int slow_arg_count = static_cast<int>(descriptor->ParameterCount());
-@@ -2334,13 +2347,13 @@ const Operator* SimplifiedOperatorBuilder::FastApiCall(
-   return zone()->New<Operator1<FastApiCallParameters>>(
-       IrOpcode::kFastApiCall, Operator::kNoProperties, "FastApiCall",
-       value_input_count, 1, 1, 1, 1, 2,
--      FastApiCallParameters(c_function, feedback, descriptor));
-+      FastApiCallParameters(c_functions, feedback, descriptor));
- }
- 
- // static
- int FastApiCallNode::FastCallArgumentCount(Node* node) {
-   FastApiCallParameters p = FastApiCallParametersOf(node->op());
--  const CFunctionInfo* signature = p.c_function().signature;
-+  const CFunctionInfo* signature = p.c_functions()[0].signature;
-   CHECK_NOT_NULL(signature);
-   return signature->ArgumentCount();
- }
-diff --git a/src/compiler/simplified-operator.h b/src/compiler/simplified-operator.h
-index 5cb305f8db8419bcaedc89dbd9d68226bcf90551..19cc23394d5dd729974ff4faf0e4f7cf54c4710e 100644
---- a/src/compiler/simplified-operator.h
-+++ b/src/compiler/simplified-operator.h
-@@ -742,25 +742,35 @@ struct FastApiCallFunction {
-     return address == rhs.address && signature == rhs.signature;
-   }
- };
-+typedef ZoneVector<FastApiCallFunction> FastApiCallFunctionVector;
- 
- class FastApiCallParameters {
-  public:
--  explicit FastApiCallParameters(FastApiCallFunction c_function,
-+  explicit FastApiCallParameters(const FastApiCallFunctionVector& c_functions,
-                                  FeedbackSource const& feedback,
-                                  CallDescriptor* descriptor)
--      : c_function_(c_function), feedback_(feedback), descriptor_(descriptor) {}
-+      : c_functions_(c_functions),
-+        feedback_(feedback),
-+        descriptor_(descriptor) {}
- 
--  FastApiCallFunction c_function() const { return c_function_; }
-+  const FastApiCallFunctionVector& c_functions() const { return c_functions_; }
-   FeedbackSource const& feedback() const { return feedback_; }
-   CallDescriptor* descriptor() const { return descriptor_; }
--  const CFunctionInfo* signature() const { return c_function_.signature; }
-+  const CFunctionInfo* signature() const {
-+    DCHECK(!c_functions_.empty());
-+    return c_functions_[0].signature;
-+  }
-   unsigned int argument_count() const {
-     const unsigned int count = signature()->ArgumentCount();
-+    DCHECK(base::all_of(c_functions_, [count](const auto& f) {
-+      return f.signature->ArgumentCount() == count;
-+    }));
-     return count;
-   }
- 
-  private:
--  FastApiCallFunction c_function_;
-+  // A single FastApiCall node can represent multiple overloaded functions.
-+  const FastApiCallFunctionVector c_functions_;
- 
-   const FeedbackSource feedback_;
-   CallDescriptor* descriptor_;
-@@ -1233,9 +1243,9 @@ class V8_EXPORT_PRIVATE SimplifiedOperatorBuilder final
-   const Operator* Unsigned32Divide();
- 
-   // Represents the inputs necessary to construct a fast and a slow API call.
--  const Operator* FastApiCall(FastApiCallFunction c_function,
--                              FeedbackSource const& feedback,
--                              CallDescriptor* descriptor);
-+  const Operator* FastApiCall(
-+      const FastApiCallFunctionVector& c_candidate_functions,
-+      FeedbackSource const& feedback, CallDescriptor* descriptor);
- 
- #ifdef V8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA
-   const Operator* GetContinuationPreservedEmbedderData();
-diff --git a/src/compiler/turbofan-typer.cc b/src/compiler/turbofan-typer.cc
-index 811c9c5ab82ebbdf6ca14a2fd99c3b154609d506..f36916c1a0d39293f01eca84cac6ef83096cd25e 100644
---- a/src/compiler/turbofan-typer.cc
-+++ b/src/compiler/turbofan-typer.cc
-@@ -1190,8 +1190,11 @@ Type Typer::Visitor::TypeCall(Node* node) { return Type::Any(); }
- 
- Type Typer::Visitor::TypeFastApiCall(Node* node) {
-   FastApiCallParameters const& op_params = FastApiCallParametersOf(node->op());
-+  if (op_params.c_functions().empty()) {
-+    return Type::Undefined();
-+  }
- 
--  const CFunctionInfo* c_signature = op_params.c_function().signature;
-+  const CFunctionInfo* c_signature = op_params.c_functions()[0].signature;
-   CTypeInfo return_type = c_signature->ReturnInfo();
- 
-   switch (return_type.GetType()) {
-diff --git a/src/compiler/turboshaft/fast-api-call-lowering-reducer.h b/src/compiler/turboshaft/fast-api-call-lowering-reducer.h
-index 2dec266f9e648391fe61a62931cca1ad20de719c..dc27e91ad0da93a5b68053f132f219f95f641ca1 100644
---- a/src/compiler/turboshaft/fast-api-call-lowering-reducer.h
-+++ b/src/compiler/turboshaft/fast-api-call-lowering-reducer.h
-@@ -29,23 +29,41 @@ class FastApiCallLoweringReducer : public Next {
-       base::Vector<const OpIndex> arguments,
-       const FastApiCallParameters* parameters,
-       base::Vector<const RegisterRepresentation> out_reps) {
--    FastApiCallFunction c_function = parameters->c_function;
-+    const auto& c_functions = parameters->c_functions;
-     const auto& c_signature = parameters->c_signature();
-     const int c_arg_count = c_signature->ArgumentCount();
-     DCHECK_EQ(c_arg_count, arguments.size());
-+    const auto& resolution_result = parameters->resolution_result;
- 
-     Label<> handle_error(this);
-     Label<Word32> done(this);
-     Variable result = __ NewVariable(RegisterRepresentation::FromCTypeInfo(
-         c_signature->ReturnInfo(), c_signature->GetInt64Representation()));
- 
--    OpIndex callee = __ ExternalConstant(ExternalReference::Create(
--        c_function.address, ExternalReference::FAST_C_CALL));
--
-+    OpIndex callee;
-     base::SmallVector<OpIndex, 16> args;
-     for (int i = 0; i < c_arg_count; ++i) {
-+      // Check if this is the argument on which we need to perform overload
-+      // resolution.
-+      if (i == resolution_result.distinguishable_arg_index) {
-+        DCHECK_GT(c_functions.size(), 1);
-+        // This only happens when the FastApiCall node represents multiple
-+        // overloaded functions and {i} is the index of the distinguishable
-+        // argument.
-+        OpIndex arg_i;
-+        std::tie(callee, arg_i) = AdaptOverloadedFastCallArgument(
-+            arguments[i], c_functions, resolution_result, handle_error);
-+        args.push_back(arg_i);
-+      } else {
-         CTypeInfo type = c_signature->ArgumentInfo(i);
-         args.push_back(AdaptFastCallArgument(arguments[i], type, handle_error));
-+      }
-+    }
-+
-+    if (c_functions.size() == 1) {
-+      DCHECK(!callee.valid());
-+      callee = __ ExternalConstant(ExternalReference::Create(
-+          c_functions[0].address, ExternalReference::FAST_C_CALL));
-     }
- 
-     // While adapting the arguments, we might have noticed an inconsistency that
-@@ -137,6 +155,56 @@ class FastApiCallLoweringReducer : public Next {
-   }
- 
-  private:
-+  std::pair<OpIndex, OpIndex> AdaptOverloadedFastCallArgument(
-+      OpIndex argument, const FastApiCallFunctionVector& c_functions,
-+      const fast_api_call::OverloadsResolutionResult& resolution_result,
-+      Label<>& handle_error) {
-+    Label<WordPtr, WordPtr> done(this);
-+
-+    for (size_t func_index = 0; func_index < c_functions.size(); ++func_index) {
-+      const CFunctionInfo* c_signature = c_functions[func_index].signature;
-+      CTypeInfo arg_type = c_signature->ArgumentInfo(
-+          resolution_result.distinguishable_arg_index);
-+
-+      Label<> next(this);
-+
-+      // Check that the value is a HeapObject.
-+      GOTO_IF(__ ObjectIsSmi(argument), handle_error);
-+
-+      switch (arg_type.GetSequenceType()) {
-+        case CTypeInfo::SequenceType::kIsSequence: {
-+          CHECK_EQ(arg_type.GetType(), CTypeInfo::Type::kVoid);
-+
-+          // Check that the value is a JSArray.
-+          V<Map> map = __ LoadMapField(argument);
-+          V<Word32> instance_type = __ LoadInstanceTypeField(map);
-+          GOTO_IF_NOT(__ Word32Equal(instance_type, JS_ARRAY_TYPE), next);
-+
-+          OpIndex argument_to_pass = __ AdaptLocalArgument(argument);
-+          OpIndex target_address = __ ExternalConstant(
-+              ExternalReference::Create(c_functions[func_index].address,
-+                                        ExternalReference::FAST_C_CALL));
-+          GOTO(done, target_address, argument_to_pass);
-+          break;
-+        }
-+          START_ALLOW_USE_DEPRECATED()
-+        case CTypeInfo::SequenceType::kIsTypedArray:
-+          UNREACHABLE();
-+          END_ALLOW_USE_DEPRECATED()
-+
-+        default: {
-+          UNREACHABLE();
-+        }
-+      }
-+
-+      BIND(next);
-+    }
-+    GOTO(handle_error);
-+
-+    BIND(done, callee, arg);
-+    return {callee, arg};
-+  }
-+
-   template <typename T>
-   V<T> Checked(V<Tuple<T, Word32>> result, Label<>& otherwise) {
-     V<Word32> result_state = __ template Projection<1>(result);
-diff --git a/src/compiler/turboshaft/graph-builder.cc b/src/compiler/turboshaft/graph-builder.cc
-index f24cd884bf7810aaed5e58b2044c2770653266f1..d79f6c801d2562a3cd65597d79050791fee3ad08 100644
---- a/src/compiler/turboshaft/graph-builder.cc
-+++ b/src/compiler/turboshaft/graph-builder.cc
-@@ -1974,7 +1974,7 @@ OpIndex GraphBuilder::Process(
-       DCHECK(dominating_frame_state.valid());
-       FastApiCallNode n(node);
-       const auto& params = n.Parameters();
--      FastApiCallFunction c_function = params.c_function();
-+      const FastApiCallFunctionVector& c_functions = params.c_functions();
-       const int c_arg_count = params.argument_count();
- 
-       base::SmallVector<OpIndex, 16> slow_call_arguments;
-@@ -2141,6 +2141,40 @@ OpIndex GraphBuilder::Process(
-         Block* catch_block = Map(block->SuccessorAt(1));
-         catch_scope.emplace(assembler, catch_block);
-       }
-+      // Overload resolution.
-+      auto resolution_result =
-+          fast_api_call::OverloadsResolutionResult::Invalid();
-+      if (c_functions.size() != 1) {
-+        DCHECK_EQ(c_functions.size(), 2);
-+        resolution_result =
-+            fast_api_call::ResolveOverloads(c_functions, c_arg_count);
-+        if (!resolution_result.is_valid()) {
-+          V<Object> fallback_result = V<Object>::Cast(__ Call(
-+              slow_call_callee, dominating_frame_state,
-+              base::VectorOf(slow_call_arguments),
-+              TSCallDescriptor::Create(params.descriptor(), CanThrow::kYes,
-+                                       LazyDeoptOnThrow::kNo,
-+                                       __ graph_zone())));
-+          Variable result =
-+              __ NewVariable(RegisterRepresentation::FromCTypeInfo(
-+                  c_functions[0].signature->ReturnInfo(),
-+                  c_functions[0].signature->GetInt64Representation()));
-+          convert_fallback_return(
-+              result, c_functions[0].signature->GetInt64Representation(),
-+              c_functions[0].signature->ReturnInfo().GetType(),
-+              fallback_result);
-+          V<Any> value = __ GetVariable(result);
-+          if (is_final_control) {
-+            // The `__ Call()` before has already created exceptional
-+            // control flow and bound a new block for the success case. So we
-+            // can just `Goto` the block that Turbofan designated as the
-+            // `IfSuccess` successor.
-+            __ Goto(Map(block->SuccessorAt(0)));
-+          }
-+          return value;
-+        }
-+      }
-+
-       // Prepare FastCallApiOp parameters.
-       base::SmallVector<OpIndex, 16> arguments;
-       for (int i = 0; i < c_arg_count; ++i) {
-@@ -2150,8 +2184,8 @@ OpIndex GraphBuilder::Process(
- 
-       V<Context> context = Map(n.Context());
- 
--      const FastApiCallParameters* parameters =
--          FastApiCallParameters::Create(c_function, __ graph_zone());
-+      const FastApiCallParameters* parameters = FastApiCallParameters::Create(
-+          c_functions, resolution_result, __ graph_zone());
- 
-       // There is one return in addition to the return value of the C function,
-       // which indicates if a fast API call actually happened.
-diff --git a/src/compiler/turboshaft/operations.h b/src/compiler/turboshaft/operations.h
-index 1977d4d57a34781ae925d4f0ad0d09192b937dbe..d258f4b10f09b79c4aaf54ebff5e55cf8227aecc 100644
---- a/src/compiler/turboshaft/operations.h
-+++ b/src/compiler/turboshaft/operations.h
-@@ -6403,16 +6403,24 @@ struct Float64SameValueOp : FixedArityOperationT<2, Float64SameValueOp> {
- };
- 
- struct FastApiCallParameters : public NON_EXPORTED_BASE(ZoneObject) {
--  FastApiCallFunction c_function;
-+  const FastApiCallFunctionVector c_functions;
-+  fast_api_call::OverloadsResolutionResult resolution_result;
- 
--  const CFunctionInfo* c_signature() const { return c_function.signature; }
-+  const CFunctionInfo* c_signature() const { return c_functions[0].signature; }
- 
--  explicit FastApiCallParameters(FastApiCallFunction c_function)
--      : c_function(c_function) {}
-+  FastApiCallParameters(
-+      const FastApiCallFunctionVector& c_functions,
-+      const fast_api_call::OverloadsResolutionResult& resolution_result)
-+      : c_functions(c_functions), resolution_result(resolution_result) {
-+    DCHECK_LT(0, c_functions.size());
-+  }
- 
--  static const FastApiCallParameters* Create(FastApiCallFunction c_function,
--                                             Zone* graph_zone) {
--    return graph_zone->New<FastApiCallParameters>(c_function);
-+  static const FastApiCallParameters* Create(
-+      const FastApiCallFunctionVector& c_functions,
-+      const fast_api_call::OverloadsResolutionResult& resolution_result,
-+      Zone* graph_zone) {
-+    return graph_zone->New<FastApiCallParameters>(std::move(c_functions),
-+                                                  resolution_result);
-   }
- };
- 
-diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
-index 2a1edc79d000801b21e89304eefc27d6ea6f4675..79b2e0b010609acbf0e0b8ac6835364a6448ff03 100644
---- a/src/compiler/wasm-compiler.cc
-+++ b/src/compiler/wasm-compiler.cc
-@@ -8356,13 +8356,19 @@ class WasmWrapperGraphBuilder : public WasmGraphBuilder {
-                     wasm::ObjectAccess::ToTagged(
-                         FunctionTemplateInfo::kCallbackDataOffset));
- 
--    FastApiCallFunction c_function{c_address, c_signature};
-+    FastApiCallFunctionVector fast_api_call_function_vector(mcgraph()->zone());
-+    fast_api_call_function_vector.push_back({c_address, c_signature});
-     Node* call = fast_api_call::BuildFastApiCall(
--        target->GetIsolate(), graph(), gasm_.get(), c_function,
--        api_data_argument,
-+        target->GetIsolate(), graph(), gasm_.get(),
-+        fast_api_call_function_vector, c_signature, api_data_argument,
-         // Load and convert parameters passed to C function
--        [this, c_signature, receiver_node](int param_index,
--                                           GraphAssemblerLabel<0>*) {
-+        [this, c_signature, receiver_node](
-+            int param_index,
-+            fast_api_call::OverloadsResolutionResult& overloads,
-+            GraphAssemblerLabel<0>*) {
-+          // Wasm does not currently support overloads
-+          CHECK(!overloads.is_valid());
-+
-           if (param_index == 0) {
-             return gasm_->AdaptLocalArgument(receiver_node);
-           }
-diff --git a/src/d8/d8-test.cc b/src/d8/d8-test.cc
-index 6467930fbb39a67a10d6822545e985965ced83ad..1c99e4d89cbc605c6c1b75ce31b09b67334a10ee 100644
---- a/src/d8/d8-test.cc
-+++ b/src/d8/d8-test.cc
-@@ -443,6 +443,20 @@ class FastCApiObject {
-     }
-   }
- 
-+  static int32_t AddAllIntInvalidCallback(Local<Object> receiver,
-+                                          int32_t arg_i32,
-+                                          FastApiCallbackOptions& options) {
-+    // This should never be called
-+    UNREACHABLE();
-+  }
-+
-+  static int32_t AddAllIntInvalidOverloadCallback(
-+      Local<Object> receiver, Local<Object> seq_arg,
-+      FastApiCallbackOptions& options) {
-+    // This should never be called
-+    UNREACHABLE();
-+  }
-+
- #ifdef V8_USE_SIMULATOR_WITH_GENERIC_C_CALLS
-   static AnyCType Add32BitIntFastCallbackPatch(AnyCType receiver,
-                                                AnyCType arg_i32,
-@@ -1553,6 +1567,22 @@ Local<FunctionTemplate> Shell::CreateTestFastCApiTemplate(Isolate* isolate) {
-             signature, 1, ConstructorBehavior::kThrow,
-             SideEffectType::kHasSideEffect, {add_all_overloads, 2}));
- 
-+    CFunction add_all_int_invalid_func =
-+        CFunction::Make(FastCApiObject::AddAllIntInvalidCallback);
-+    CFunction add_all_int_invalid_overload =
-+        CFunction::Make(FastCApiObject::AddAllIntInvalidOverloadCallback);
-+
-+    const CFunction add_all_invalid_overloads[] = {
-+        add_all_int_invalid_func,
-+        add_all_int_invalid_overload,
-+    };
-+    api_obj_ctor->PrototypeTemplate()->Set(
-+        isolate, "add_all_invalid_overload",
-+        FunctionTemplate::NewWithCFunctionOverloads(
-+            isolate, FastCApiObject::AddAllSequenceSlowCallback, Local<Value>(),
-+            signature, 1, ConstructorBehavior::kThrow,
-+            SideEffectType::kHasSideEffect, {add_all_invalid_overloads, 2}));
-+
-     CFunction add_all_32bit_int_8args_c_func = CFunction::Make(
-         FastCApiObject::AddAll32BitIntFastCallback_8Args V8_IF_USE_SIMULATOR(
-             FastCApiObject::AddAll32BitIntFastCallback_8ArgsPatch));
-diff --git a/test/mjsunit/compiler/fast-api-sequences.js b/test/mjsunit/compiler/fast-api-sequences.js
-index 6a982bbbfe13ae792a3d3a1d3376f71b6b00d38a..4318f60fc70f0a2684c6f233861e513063f8e542 100644
---- a/test/mjsunit/compiler/fast-api-sequences.js
-+++ b/test/mjsunit/compiler/fast-api-sequences.js
-@@ -81,6 +81,30 @@ for (let i = 0; i < 100; i++) {
-   ExpectFastCall(overloaded_test, 62);
- })();
- 
-+// Test function with invalid overloads.
-+(function () {
-+  function overloaded_test() {
-+    return fast_c_api.add_all_invalid_overload(
-+      [26, -6, 42]);
-+  }
-+
-+  %PrepareFunctionForOptimization(overloaded_test);
-+  result = overloaded_test();
-+  assertEquals(62, result);
-+
-+  fast_c_api.reset_counts();
-+  %OptimizeFunctionOnNextCall(overloaded_test);
-+  result = overloaded_test();
-+  assertEquals(62, result);
-+  // Here we deopt because with this invalid overload:
-+  // - add_all_int_invalid_func(Receiver, Bool, Int32, Options)
-+  // - add_all_seq_c_func(Receiver, Bool, JSArray, Options)
-+  // we expect that a number will be passed as 3rd argument
-+  // (SimplifiedLowering takes the type from the first overloaded function).
-+  assertUnoptimized(overloaded_test);
-+  assertEquals(0, fast_c_api.fast_call_count());
-+})();
-+
- // ----------- Test different TypedArray functions. -----------
- // ----------- add_all_<TYPE>_typed_array -----------
- // `add_all_<TYPE>_typed_array` have the following signature:
-diff --git a/test/mjsunit/regress/regress-335548148.js b/test/mjsunit/regress/regress-335548148.js
-new file mode 100644
-index 0000000000000000000000000000000000000000..4725c48990767fc2a469a5ab3c04ba96e11bf54c
---- /dev/null
-+++ b/test/mjsunit/regress/regress-335548148.js
-@@ -0,0 +1,29 @@
-+// Copyright 2024 the V8 project authors. All rights reserved.
-+// Use of this source code is governed by a BSD-style license that can be
-+// found in the LICENSE file.
-+
-+// Flags: --turbo-fast-api-calls --expose-fast-api --allow-natives-syntax --turbofan
-+// --always-turbofan is disabled because we rely on particular feedback for
-+// optimizing to the fastest path.
-+// Flags: --no-always-turbofan
-+// The test relies on optimizing/deoptimizing at predictable moments, so
-+// it's not suitable for deoptimization fuzzing.
-+// Flags: --deopt-every-n-times=0
-+// Flags: --fast-api-allow-float-in-sim
-+
-+const __v_0 = new d8.test.FastCAPI();
-+
-+function __f_0(__v_4, __v_5) {
-+  try {
-+    // Call the API function with an invalid parameter. Because of the invalid
-+    // parameter the overload resolution of the fast API cannot figure out
-+    // which function should be called, and therefore emits code for a normal
-+    // API call.
-+    __v_0.add_all_invalid_overload(__v_5, Object.prototype);
-+  } catch (e) {}
-+}
-+
-+%PrepareFunctionForOptimization(__f_0);
-+__f_0(Number.MIN_VALUE, Number.MIN_VALUE);
-+%OptimizeFunctionOnNextCall(__f_0);
-+__f_0(Number.MIN_VALUE, Number.MIN_VALUE);

+ 12 - 9
shell/browser/api/electron_api_app.cc

@@ -543,11 +543,12 @@ App::App() {
       ->set_delegate(this);
   Browser::Get()->AddObserver(this);
 
-  auto pid = content::ChildProcessHost::kInvalidUniqueID;
+  auto unsafe_pid = content::ChildProcessId::FromUnsafeValue(
+      content::ChildProcessHost::kInvalidUniqueID);
   auto process_metric = std::make_unique<electron::ProcessMetric>(
       content::PROCESS_TYPE_BROWSER, base::GetCurrentProcessHandle(),
       base::ProcessMetrics::CreateCurrentProcessMetrics());
-  app_metrics_[pid] = std::move(process_metric);
+  app_metrics_[unsafe_pid] = std::move(process_metric);
 }
 
 App::~App() {
@@ -785,26 +786,28 @@ void App::OnGpuInfoUpdate() {
 
 void App::BrowserChildProcessLaunchedAndConnected(
     const content::ChildProcessData& data) {
-  ChildProcessLaunched(data.process_type, data.id, data.GetProcess().Handle(),
-                       data.metrics_name, base::UTF16ToUTF8(data.name));
+  ChildProcessLaunched(data.process_type,
+                       content::ChildProcessId::FromUnsafeValue(data.id),
+                       data.GetProcess().Handle(), data.metrics_name,
+                       base::UTF16ToUTF8(data.name));
 }
 
 void App::BrowserChildProcessHostDisconnected(
     const content::ChildProcessData& data) {
-  ChildProcessDisconnected(data.id);
+  ChildProcessDisconnected(content::ChildProcessId::FromUnsafeValue(data.id));
 }
 
 void App::BrowserChildProcessCrashed(
     const content::ChildProcessData& data,
     const content::ChildProcessTerminationInfo& info) {
-  ChildProcessDisconnected(data.id);
+  ChildProcessDisconnected(content::ChildProcessId::FromUnsafeValue(data.id));
   BrowserChildProcessCrashedOrKilled(data, info);
 }
 
 void App::BrowserChildProcessKilled(
     const content::ChildProcessData& data,
     const content::ChildProcessTerminationInfo& info) {
-  ChildProcessDisconnected(data.id);
+  ChildProcessDisconnected(content::ChildProcessId::FromUnsafeValue(data.id));
   BrowserChildProcessCrashedOrKilled(data, info);
 }
 
@@ -834,7 +837,7 @@ void App::RenderProcessExited(content::RenderProcessHost* host) {
 }
 
 void App::ChildProcessLaunched(int process_type,
-                               int pid,
+                               content::ChildProcessId pid,
                                base::ProcessHandle handle,
                                const std::string& service_name,
                                const std::string& name) {
@@ -848,7 +851,7 @@ void App::ChildProcessLaunched(int process_type,
       process_type, handle, std::move(metrics), service_name, name);
 }
 
-void App::ChildProcessDisconnected(int pid) {
+void App::ChildProcessDisconnected(content::ChildProcessId pid) {
   app_metrics_.erase(pid);
 }
 

+ 5 - 3
shell/browser/api/electron_api_app.h

@@ -186,11 +186,11 @@ class App final : public ElectronBrowserClient::Delegate,
 
   void SetAppPath(const base::FilePath& app_path);
   void ChildProcessLaunched(int process_type,
-                            int pid,
+                            content::ChildProcessId pid,
                             base::ProcessHandle handle,
                             const std::string& service_name = std::string(),
                             const std::string& name = std::string());
-  void ChildProcessDisconnected(int pid);
+  void ChildProcessDisconnected(content::ChildProcessId pid);
 
   void SetAppLogsPath(gin_helper::ErrorThrower thrower,
                       std::optional<base::FilePath> custom_path);
@@ -275,7 +275,9 @@ class App final : public ElectronBrowserClient::Delegate,
   base::FilePath app_path_;
 
   // pid -> electron::ProcessMetric
-  base::flat_map<int, std::unique_ptr<electron::ProcessMetric>> app_metrics_;
+  base::flat_map<content::ChildProcessId,
+                 std::unique_ptr<electron::ProcessMetric>>
+      app_metrics_;
 
   bool disable_hw_acceleration_ = false;
   bool disable_domain_blocking_for_3DAPIs_ = false;

+ 67 - 16
shell/browser/api/electron_api_web_contents.cc

@@ -143,6 +143,7 @@
 #include "third_party/blink/public/common/input/web_input_event.h"
 #include "third_party/blink/public/common/messaging/transferable_message_mojom_traits.h"
 #include "third_party/blink/public/common/page/page_zoom.h"
+#include "third_party/blink/public/common/peerconnection/webrtc_ip_handling_policy.h"
 #include "third_party/blink/public/mojom/frame/find_in_page.mojom.h"
 #include "third_party/blink/public/mojom/frame/fullscreen.mojom.h"
 #include "third_party/blink/public/mojom/messaging/transferable_message.mojom.h"
@@ -191,6 +192,14 @@
 #include "content/public/browser/plugin_service.h"
 #endif
 
+#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
+#include "chrome/browser/spellchecker/spellcheck_factory.h"
+#include "chrome/browser/spellchecker/spellcheck_service.h"
+#include "components/spellcheck/browser/spellcheck_platform.h"
+#include "components/spellcheck/common/spellcheck_common.h"
+#include "components/spellcheck/common/spellcheck_features.h"
+#endif
+
 #if !IS_MAS_BUILD()
 #include "chrome/browser/hang_monitor/hang_crash_dump.h"  // nogncheck
 #endif
@@ -560,7 +569,7 @@ std::string RegisterFileSystem(content::WebContents* web_contents,
   content::ChildProcessSecurityPolicy* policy =
       content::ChildProcessSecurityPolicy::GetInstance();
   content::RenderViewHost* render_view_host = web_contents->GetRenderViewHost();
-  int renderer_id = render_view_host->GetProcess()->GetID();
+  int renderer_id = render_view_host->GetProcess()->GetDeprecatedID();
   policy->GrantReadFileSystem(renderer_id, file_system.id());
   policy->GrantWriteFileSystem(renderer_id, file_system.id());
   policy->GrantCreateFileForFileSystem(renderer_id, file_system.id());
@@ -1464,11 +1473,44 @@ void WebContents::RendererResponsive(
 
 bool WebContents::HandleContextMenu(content::RenderFrameHost& render_frame_host,
                                     const content::ContextMenuParams& params) {
-  Emit("context-menu", std::make_pair(params, &render_frame_host));
+#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
+  if (!params.misspelled_word.empty() && spellcheck::UseBrowserSpellChecker()) {
+    SpellcheckService* spellcheck_service =
+        SpellcheckServiceFactory::GetForContext(
+            render_frame_host.GetBrowserContext());
+    if (spellcheck_service) {
+      spellcheck_platform::GetPerLanguageSuggestions(
+          spellcheck_service->platform_spell_checker(), params.misspelled_word,
+          base::BindOnce(&WebContents::OnGetPlatformSuggestionsComplete,
+                         GetWeakPtr(), std::ref(render_frame_host), params));
+    }
+  } else {
+#endif
+    Emit("context-menu",
+         std::make_tuple(params, &render_frame_host,
+                         std::optional<std::vector<std::u16string>>{}));
+#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
+  }
+#endif
 
   return true;
 }
 
+#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
+void WebContents::OnGetPlatformSuggestionsComplete(
+    content::RenderFrameHost& render_frame_host,
+    const content::ContextMenuParams& params,
+    const spellcheck::PerLanguageSuggestions&
+        platform_per_language_suggestions) {
+  std::vector<std::u16string> combined_suggestions;
+  spellcheck::FillSuggestions(platform_per_language_suggestions,
+                              &combined_suggestions);
+  Emit("context-menu",
+       std::make_tuple(params, &render_frame_host,
+                       std::make_optional(combined_suggestions)));
+}
+#endif
+
 void WebContents::FindReply(content::WebContents* web_contents,
                             int request_id,
                             int number_of_matches,
@@ -1740,7 +1782,8 @@ void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
   // This event is necessary for tracking any states with respect to
   // intermediate render view hosts aka speculative render view hosts. Currently
   // used by object-registry.js to ref count remote objects.
-  Emit("render-view-deleted", render_view_host->GetProcess()->GetID());
+  Emit("render-view-deleted",
+       render_view_host->GetProcess()->GetID().GetUnsafeValue());
 
   if (web_contents()->GetRenderViewHost() == render_view_host) {
     // When the RVH that has been deleted is the current RVH it means that the
@@ -1748,7 +1791,7 @@ void WebContents::RenderViewDeleted(content::RenderViewHost* render_view_host) {
     // Currently tracked by guest-window-manager.ts to destroy the
     // BrowserWindow.
     Emit("current-render-view-deleted",
-         render_view_host->GetProcess()->GetID());
+         render_view_host->GetProcess()->GetID().GetUnsafeValue());
   }
 }
 
@@ -1820,7 +1863,8 @@ void WebContents::DOMContentLoaded(
 void WebContents::DidFinishLoad(content::RenderFrameHost* render_frame_host,
                                 const GURL& validated_url) {
   bool is_main_frame = !render_frame_host->GetParent();
-  int frame_process_id = render_frame_host->GetProcess()->GetID();
+  int32_t frame_process_id =
+      render_frame_host->GetProcess()->GetID().GetUnsafeValue();
   int frame_routing_id = render_frame_host->GetRoutingID();
   auto weak_this = GetWeakPtr();
   Emit("did-frame-finish-load", is_main_frame, frame_process_id,
@@ -1847,7 +1891,8 @@ void WebContents::DidFailLoad(content::RenderFrameHost* render_frame_host,
     return;
 
   bool is_main_frame = !render_frame_host->GetParent();
-  int frame_process_id = render_frame_host->GetProcess()->GetID();
+  int32_t frame_process_id =
+      render_frame_host->GetProcess()->GetID().GetUnsafeValue();
   int frame_routing_id = render_frame_host->GetRoutingID();
   Emit("did-fail-load", error_code, "", url, is_main_frame, frame_process_id,
        frame_routing_id);
@@ -1872,7 +1917,7 @@ bool WebContents::EmitNavigationEvent(
   int frame_process_id = -1, frame_routing_id = -1;
   content::RenderFrameHost* frame_host = GetRenderFrameHost(navigation_handle);
   if (frame_host) {
-    frame_process_id = frame_host->GetProcess()->GetID();
+    frame_process_id = frame_host->GetProcess()->GetID().GetUnsafeValue();
     frame_routing_id = frame_host->GetRoutingID();
   }
   bool is_same_document = navigation_handle->IsSameDocument();
@@ -2019,7 +2064,7 @@ gin::Handle<gin_helper::internal::Event> WebContents::MakeEventWithSender(
   if (frame) {
     dict.SetGetter("senderFrame", frame);
     dict.Set("frameId", frame->GetRoutingID());
-    dict.Set("processId", frame->GetProcess()->GetID());
+    dict.Set("processId", frame->GetProcess()->GetID().GetUnsafeValue());
     dict.Set("frameTreeNodeId", frame->GetFrameTreeNodeId());
   }
   return event;
@@ -2121,7 +2166,7 @@ void WebContents::DidFinishNavigation(
       navigation_handle->GetRenderFrameHost();
   int frame_process_id = -1, frame_routing_id = -1;
   if (frame_host) {
-    frame_process_id = frame_host->GetProcess()->GetID();
+    frame_process_id = frame_host->GetProcess()->GetID().GetUnsafeValue();
     frame_routing_id = frame_host->GetRoutingID();
   }
   if (!navigation_handle->IsErrorPage()) {
@@ -2353,8 +2398,12 @@ void WebContents::SetBackgroundThrottling(bool allowed) {
   }
 }
 
-int WebContents::GetProcessID() const {
-  return web_contents()->GetPrimaryMainFrame()->GetProcess()->GetID();
+int32_t WebContents::GetProcessID() const {
+  return web_contents()
+      ->GetPrimaryMainFrame()
+      ->GetProcess()
+      ->GetID()
+      .GetUnsafeValue();
 }
 
 base::ProcessId WebContents::GetOSProcessID() const {
@@ -2594,7 +2643,8 @@ int WebContents::GetHistoryLength() const {
 }
 
 const std::string WebContents::GetWebRTCIPHandlingPolicy() const {
-  return web_contents()->GetMutableRendererPrefs()->webrtc_ip_handling_policy;
+  return blink::ToString(
+      web_contents()->GetMutableRendererPrefs()->webrtc_ip_handling_policy);
 }
 
 void WebContents::SetWebRTCIPHandlingPolicy(
@@ -2602,7 +2652,7 @@ void WebContents::SetWebRTCIPHandlingPolicy(
   if (GetWebRTCIPHandlingPolicy() == webrtc_ip_handling_policy)
     return;
   web_contents()->GetMutableRendererPrefs()->webrtc_ip_handling_policy =
-      webrtc_ip_handling_policy;
+      blink::ToWebRTCIPHandlingPolicy(webrtc_ip_handling_policy);
 
   web_contents()->SyncRendererPrefs();
 }
@@ -2662,8 +2712,9 @@ std::string WebContents::GetMediaSourceID(
   content::DesktopMediaID media_id(
       content::DesktopMediaID::TYPE_WEB_CONTENTS,
       content::DesktopMediaID::kNullId,
-      content::WebContentsMediaCaptureId(frame_host->GetProcess()->GetID(),
-                                         frame_host->GetRoutingID()));
+      content::WebContentsMediaCaptureId(
+          frame_host->GetProcess()->GetDeprecatedID(),
+          frame_host->GetRoutingID()));
 
   auto* request_frame_host = request_web_contents->GetPrimaryMainFrame();
   if (!request_frame_host)
@@ -2671,7 +2722,7 @@ std::string WebContents::GetMediaSourceID(
 
   std::string id =
       content::DesktopStreamsRegistry::GetInstance()->RegisterStream(
-          request_frame_host->GetProcess()->GetID(),
+          request_frame_host->GetProcess()->GetDeprecatedID(),
           request_frame_host->GetRoutingID(),
           url::Origin::Create(request_frame_host->GetLastCommittedURL()
                                   .DeprecatedGetOriginAsURL()),

+ 13 - 1
shell/browser/api/electron_api_web_contents.h

@@ -55,6 +55,10 @@ class ScriptExecutor;
 }
 #endif
 
+#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
+#include "components/spellcheck/common/spellcheck_common.h"
+#endif
+
 namespace blink {
 struct DeviceEmulationParams;
 // enum class PermissionType;
@@ -183,7 +187,7 @@ class WebContents final : public ExclusiveAccessContext,
   bool GetBackgroundThrottling() const override;
 
   void SetBackgroundThrottling(bool allowed);
-  int GetProcessID() const;
+  int32_t GetProcessID() const;
   base::ProcessId GetOSProcessID() const;
   [[nodiscard]] Type type() const { return type_; }
   bool Equal(const WebContents* web_contents) const;
@@ -795,6 +799,14 @@ class WebContents final : public ExclusiveAccessContext,
   // Update the html fullscreen flag in both browser and renderer.
   void UpdateHtmlApiFullscreen(bool fullscreen);
 
+#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
+  void OnGetPlatformSuggestionsComplete(
+      content::RenderFrameHost& render_frame_host,
+      const content::ContextMenuParams& params,
+      const spellcheck::PerLanguageSuggestions&
+          platform_per_language_suggestions);
+#endif
+
   v8::Global<v8::Value> session_;
   v8::Global<v8::Value> devtools_web_contents_;
   v8::Global<v8::Value> debugger_;

+ 2 - 2
shell/browser/api/electron_api_web_frame_main.cc

@@ -362,10 +362,10 @@ base::ProcessId WebFrameMain::OSProcessID() const {
   return base::GetProcId(process_handle);
 }
 
-int WebFrameMain::ProcessID() const {
+int32_t WebFrameMain::ProcessID() const {
   if (!CheckRenderFrame())
     return -1;
-  return render_frame_->GetProcess()->GetID();
+  return render_frame_->GetProcess()->GetID().GetUnsafeValue();
 }
 
 int WebFrameMain::RoutingID() const {

+ 1 - 1
shell/browser/api/electron_api_web_frame_main.h

@@ -122,7 +122,7 @@ class WebFrameMain final : public gin::Wrappable<WebFrameMain>,
   content::FrameTreeNodeId FrameTreeNodeID() const;
   std::string Name() const;
   base::ProcessId OSProcessID() const;
-  int ProcessID() const;
+  int32_t ProcessID() const;
   int RoutingID() const;
   GURL URL() const;
   std::string Origin() const;

+ 8 - 6
shell/browser/badging/badge_manager.h

@@ -10,6 +10,7 @@
 #include <string>
 
 #include "components/keyed_service/core/keyed_service.h"
+#include "content/public/browser/child_process_id.h"
 #include "mojo/public/cpp/bindings/receiver_set.h"
 #include "third_party/blink/public/mojom/badging/badging.mojom.h"
 #include "url/gurl.h"
@@ -59,30 +60,31 @@ class BadgeManager : public KeyedService, public blink::mojom::BadgeService {
   // The BindingContext for Window execution contexts.
   class FrameBindingContext final : public BindingContext {
    public:
-    FrameBindingContext(int process_id, int frame_id)
+    FrameBindingContext(content::ChildProcessId process_id, int frame_id)
         : process_id_(process_id), frame_id_(frame_id) {}
     ~FrameBindingContext() override = default;
 
-    int GetProcessId() { return process_id_; }
+    content::ChildProcessId GetProcessId() { return process_id_; }
     int GetFrameId() { return frame_id_; }
 
    private:
-    int process_id_;
+    content::ChildProcessId process_id_;
     int frame_id_;
   };
 
   // The BindingContext for ServiceWorkerGlobalScope execution contexts.
   class ServiceWorkerBindingContext final : public BindingContext {
    public:
-    ServiceWorkerBindingContext(int process_id, const GURL& scope)
+    ServiceWorkerBindingContext(content::ChildProcessId process_id,
+                                const GURL& scope)
         : process_id_(process_id), scope_(scope) {}
     ~ServiceWorkerBindingContext() override = default;
 
-    int GetProcessId() { return process_id_; }
+    content::ChildProcessId GetProcessId() { return process_id_; }
     GURL GetScope() { return scope_; }
 
    private:
-    int process_id_;
+    content::ChildProcessId process_id_;
     GURL scope_;
   };
 

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