Browse Source

chore: bump chromium to 106.0.5249.30 (21-x-y) (#35423)

electron-roller[bot] 2 years ago
parent
commit
aaf560817b
100 changed files with 936 additions and 797 deletions
  1. 1 1
      DEPS
  2. 3 4
      chromium_src/BUILD.gn
  3. 3 1
      patches/chromium/.patches
  4. 3 3
      patches/chromium/accelerator.patch
  5. 8 8
      patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
  6. 10 10
      patches/chromium/add_didinstallconditionalfeatures.patch
  7. 1 1
      patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch
  8. 16 29
      patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch
  9. 7 7
      patches/chromium/allow_in-process_windows_to_have_different_web_prefs.patch
  10. 3 3
      patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch
  11. 6 6
      patches/chromium/blink_local_frame.patch
  12. 1 1
      patches/chromium/build_disable_partition_alloc_on_mac.patch
  13. 4 5
      patches/chromium/build_disable_print_content_analysis.patch
  14. 10 10
      patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch
  15. 1 1
      patches/chromium/build_libc_as_static_library.patch
  16. 24 24
      patches/chromium/can_create_window.patch
  17. 0 179
      patches/chromium/cherry-pick-9b5207569882.patch
  18. 1 1
      patches/chromium/chore_add_electron_deps_to_gitignores.patch
  19. 2 2
      patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch
  20. 8 8
      patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch
  21. 1 1
      patches/chromium/chrome_key_systems.patch
  22. 2 2
      patches/chromium/crash_allow_setting_more_options.patch
  23. 2 2
      patches/chromium/disable-redraw-lock.patch
  24. 7 7
      patches/chromium/disable_color_correct_rendering.patch
  25. 2 2
      patches/chromium/disable_compositor_recycling.patch
  26. 6 6
      patches/chromium/disable_hidden.patch
  27. 59 0
      patches/chromium/disable_optimization_guide_for_preconnect_feature.patch
  28. 1 1
      patches/chromium/don_t_run_pcscan_notifythreadcreated_if_pcscan_is_disabled.patch
  29. 2 2
      patches/chromium/enable_reset_aspect_ratio.patch
  30. 8 8
      patches/chromium/expose_setuseragent_on_networkcontext.patch
  31. 3 3
      patches/chromium/extend_apply_webpreferences.patch
  32. 5 5
      patches/chromium/feat_add_streaming-protocol_registry_to_multibuffer_data_source.patch
  33. 1 1
      patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch
  34. 2 2
      patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch
  35. 2 2
      patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch
  36. 2 2
      patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch
  37. 2 2
      patches/chromium/fix_aspect_ratio_with_max_size.patch
  38. 4 4
      patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch
  39. 31 32
      patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch
  40. 198 0
      patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch
  41. 3 3
      patches/chromium/fix_revert_emulationhandler_update_functions_to_early_return.patch
  42. 47 0
      patches/chromium/fix_the_gn_gen_for_components_segmentation_platform.patch
  43. 4 4
      patches/chromium/frame_host_manager.patch
  44. 3 3
      patches/chromium/gin_enable_disable_v8_platform.patch
  45. 5 5
      patches/chromium/gpu_notify_when_dxdiag_request_fails.patch
  46. 2 2
      patches/chromium/gritsettings_resource_ids.patch
  47. 2 2
      patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch
  48. 2 2
      patches/chromium/load_v8_snapshot_in_browser_process.patch
  49. 2 2
      patches/chromium/logging_win32_only_create_a_console_if_logging_to_stderr.patch
  50. 7 7
      patches/chromium/mas_disable_custom_window_frame.patch
  51. 17 17
      patches/chromium/mas_disable_remote_accessibility.patch
  52. 1 1
      patches/chromium/mas_no_private_api.patch
  53. 7 7
      patches/chromium/network_service_allow_remote_certificate_verification_logic.patch
  54. 6 6
      patches/chromium/notification_provenance.patch
  55. 3 3
      patches/chromium/picture-in-picture.patch
  56. 1 1
      patches/chromium/port_autofill_colors_to_the_color_pipeline.patch
  57. 59 59
      patches/chromium/printing.patch
  58. 2 2
      patches/chromium/process_singleton.patch
  59. 7 7
      patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
  60. 6 6
      patches/chromium/render_widget_host_view_base.patch
  61. 6 6
      patches/chromium/render_widget_host_view_mac.patch
  62. 3 3
      patches/chromium/resource_file_conflict.patch
  63. 2 2
      patches/chromium/revert_spellcheck_fully_launch_spell_check_delayed_initialization.patch
  64. 2 2
      patches/chromium/scroll_bounce_flag.patch
  65. 28 29
      patches/chromium/short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch
  66. 2 2
      patches/chromium/support_mixed_sandbox_with_zygote.patch
  67. 1 1
      patches/chromium/sysroot.patch
  68. 5 5
      patches/chromium/web_contents.patch
  69. 2 2
      patches/chromium/webview_cross_drag.patch
  70. 2 2
      patches/chromium/webview_fullscreen.patch
  71. 9 9
      patches/chromium/worker_context_will_destroy.patch
  72. 8 8
      patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch
  73. 1 3
      patches/config.json
  74. 0 1
      patches/lss/.patches
  75. 0 24
      patches/lss/fix_cast_pwrite64_arg_to_long_for_arm.patch
  76. 2 0
      patches/node/.patches
  77. 21 0
      patches/node/enable_-wunqualified-std-cast-call.patch
  78. 22 0
      patches/node/v8_api_advance_api_deprecation.patch
  79. 3 3
      patches/v8/build_gn.patch
  80. 2 19
      patches/v8/dcheck.patch
  81. 2 2
      patches/v8/do_not_export_private_v8_symbols_on_windows.patch
  82. 2 2
      patches/v8/export_symbols_needed_for_windows_build.patch
  83. 2 2
      patches/v8/expose_mksnapshot.patch
  84. 4 4
      patches/v8/revert_runtime_dhceck_terminating_exception_in_microtasks.patch
  85. 3 3
      patches/v8/workaround_an_undefined_symbol_error.patch
  86. 1 0
      shell/browser/api/electron_api_web_contents.cc
  87. 1 0
      shell/browser/api/electron_api_web_contents.h
  88. 49 43
      shell/browser/electron_browser_client.cc
  89. 7 0
      shell/browser/electron_browser_context.cc
  90. 2 0
      shell/browser/electron_browser_context.h
  91. 10 0
      shell/browser/electron_permission_manager.cc
  92. 7 4
      shell/browser/electron_permission_manager.h
  93. 7 7
      shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc
  94. 4 4
      shell/browser/ui/devtools_ui.cc
  95. 26 36
      shell/browser/zoom_level_delegate.cc
  96. 2 3
      shell/browser/zoom_level_delegate.h
  97. 5 0
      shell/common/extensions/electron_extensions_client.cc
  98. 2 0
      shell/common/extensions/electron_extensions_client.h
  99. 39 37
      shell/renderer/api/electron_api_web_frame.cc
  100. 2 2
      shell/renderer/electron_api_service_impl.cc

+ 1 - 1
DEPS

@@ -2,7 +2,7 @@ gclient_gn_args_from = 'src'
 
 vars = {
   'chromium_version':
-    '106.0.5216.0',
+    '106.0.5249.30',
   'node_version':
     'v16.16.0',
   'nan_version':

+ 3 - 4
chromium_src/BUILD.gn

@@ -156,10 +156,7 @@ static_library("chrome") {
     "//services/strings",
   ]
 
-  deps = [
-    "//chrome/browser:resource_prefetch_predictor_proto",
-    "//components/optimization_guide/proto:optimization_guide_proto",
-  ]
+  deps = [ "//chrome/browser:resource_prefetch_predictor_proto" ]
 
   if (is_linux) {
     sources += [ "//chrome/browser/icon_loader_auralinux.cc" ]
@@ -232,6 +229,8 @@ static_library("chrome") {
       "//chrome/browser/printing/printer_query.h",
       "//chrome/browser/printing/printing_service.cc",
       "//chrome/browser/printing/printing_service.h",
+      "//components/printing/browser/print_to_pdf/pdf_print_job.cc",
+      "//components/printing/browser/print_to_pdf/pdf_print_job.h",
       "//components/printing/browser/print_to_pdf/pdf_print_utils.cc",
       "//components/printing/browser/print_to_pdf/pdf_print_utils.h",
     ]

+ 3 - 1
patches/chromium/.patches

@@ -118,4 +118,6 @@ revert_spellcheck_fully_launch_spell_check_delayed_initialization.patch
 add_electron_deps_to_license_credits_file.patch
 feat_add_set_can_resize_mutator.patch
 fix_revert_emulationhandler_update_functions_to_early_return.patch
-cherry-pick-9b5207569882.patch
+fix_return_v8_value_from_localframe_requestexecutescript.patch
+disable_optimization_guide_for_preconnect_feature.patch
+fix_the_gn_gen_for_components_segmentation_platform.patch

+ 3 - 3
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 9fca6ff3e62204095ff0edc6fafce3a61cd2ff5c..089f8b818018a600cc8c90811f09374a1f702d8b 100644
+index e032433d7096a941132c25528781ecbf375eb9af..33d88f947bc9a0a4795f1584e114952f942b277b 100644
 --- a/ui/base/accelerators/accelerator.cc
 +++ b/ui/base/accelerators/accelerator.cc
 @@ -11,6 +11,7 @@
@@ -44,7 +44,7 @@ index 9fca6ff3e62204095ff0edc6fafce3a61cd2ff5c..089f8b818018a600cc8c90811f09374a
    }
  
  #if BUILDFLAG(IS_MAC)
-@@ -447,7 +457,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
+@@ -445,7 +455,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
      const std::u16string& shortcut) const {
    std::u16string result = shortcut;
  
@@ -53,7 +53,7 @@ index 9fca6ff3e62204095ff0edc6fafce3a61cd2ff5c..089f8b818018a600cc8c90811f09374a
      result = ApplyModifierToAcceleratorString(result, IDS_APP_SHIFT_KEY);
  
    // Note that we use 'else-if' in order to avoid using Ctrl+Alt as a shortcut.
-@@ -455,7 +465,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
+@@ -453,7 +463,7 @@ std::u16string Accelerator::ApplyLongFormModifiers(
    // more information.
    if (IsCtrlDown())
      result = ApplyModifierToAcceleratorString(result, IDS_APP_CTRL_KEY);

+ 8 - 8
patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch

@@ -10,7 +10,7 @@ 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 b692a49b71661b8394c1126250fb150653aece97..c087c0f99a15edd3a9c776a68c76b2cf46257123 100644
+index d435206f773dd30086ae81868412bc28029935d8..a0856c214d962199a2e51c7bd14f0f676d35507e 100644
 --- a/content/gpu/gpu_main.cc
 +++ b/content/gpu/gpu_main.cc
 @@ -239,6 +239,10 @@ int GpuMain(MainFunctionParams parameters) {
@@ -24,16 +24,16 @@ index b692a49b71661b8394c1126250fb150653aece97..c087c0f99a15edd3a9c776a68c76b2cf
    // 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
-@@ -337,7 +341,6 @@ int GpuMain(MainFunctionParams parameters) {
-   ChildProcess gpu_process(io_thread_type);
-   DCHECK(base::ThreadPoolInstance::Get()->WasStarted());
+@@ -323,7 +327,6 @@ int GpuMain(MainFunctionParams parameters) {
+       const_cast<base::CommandLine*>(&command_line), gpu_preferences);
+   const bool dead_on_arrival = !init_success;
  
 -  auto* client = GetContentClient()->gpu();
-   if (client)
-     client->PostIOThreadCreated(gpu_process.io_task_runner());
- 
+   if (client) {
+     client->PostSandboxInitialized();
+   }
 diff --git a/content/public/gpu/content_gpu_client.h b/content/public/gpu/content_gpu_client.h
-index 04274b751b498456fc4b269bfbc6399b4f27d3ed..2fb98baf0df4e191e5e18fd7055cc2d92a2156df 100644
+index a5d868b9e409c986bc85dfd71bb0363b5fa22145..9abe1cf5b2cc8ce60387ddf81b7c13aff9c178c4 100644
 --- a/content/public/gpu/content_gpu_client.h
 +++ b/content/public/gpu/content_gpu_client.h
 @@ -29,6 +29,10 @@ class CONTENT_EXPORT ContentGpuClient {

+ 10 - 10
patches/chromium/add_didinstallconditionalfeatures.patch

@@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the
 context, which can cause some preload scripts to trip.
 
 diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h
-index 5a7d3da58451f491ed6dfabd3bc31a645843bb60..36cbf8c5c01330acc8b3a708bd6481ede21d73be 100644
+index 7d169540590b83924766b1d423dc1bc46ab35250..f5bbb6ab26bd714d667236071a2eb0a5794a5631 100644
 --- a/content/public/renderer/render_frame_observer.h
 +++ b/content/public/renderer/render_frame_observer.h
 @@ -136,6 +136,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener,
@@ -23,10 +23,10 @@ index 5a7d3da58451f491ed6dfabd3bc31a645843bb60..36cbf8c5c01330acc8b3a708bd6481ed
                                          int32_t world_id) {}
    virtual void DidClearWindowObject() {}
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index 33497b7afbe1fa196a596a2cb384a81a973de026..b6b63c182980b09987e82911f72282c275ff0dc6 100644
+index 8199122b2d759aa8b27affabe67b108fb9a16c38..97cf24ad5f4a64322f242b0c339a807e3edb23fc 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -4294,6 +4294,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
+@@ -4345,6 +4345,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
      observer.DidCreateScriptContext(context, world_id);
  }
  
@@ -40,10 +40,10 @@ index 33497b7afbe1fa196a596a2cb384a81a973de026..b6b63c182980b09987e82911f72282c2
                                                 int world_id) {
    for (auto& observer : observers_)
 diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
-index 19eae2c0b98ecf27c6d8196c7accc44bdb24a543..40b2dc79e13080d15094a3db235e2e21760ac96d 100644
+index c8e822502d1b18c701a303024c3cba7e434d7829..89a048fbdaec8a8ea184790b78b0c63cfda7d171 100644
 --- a/content/renderer/render_frame_impl.h
 +++ b/content/renderer/render_frame_impl.h
-@@ -585,6 +585,8 @@ class CONTENT_EXPORT RenderFrameImpl
+@@ -588,6 +588,8 @@ class CONTENT_EXPORT RenderFrameImpl
                            uint32_t ng_call_count) override;
    void DidCreateScriptContext(v8::Local<v8::Context> context,
                                int world_id) override;
@@ -53,10 +53,10 @@ index 19eae2c0b98ecf27c6d8196c7accc44bdb24a543..40b2dc79e13080d15094a3db235e2e21
                                  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 544ea3f5cd705d61dd0b99f2e0f541d98ca75c53..d863681a4297cbf2844469a1baae2a81cb0d1238 100644
+index 4ef7353157272a623cea6b086b84da72ca795fca..548f6afd429695088bd83743fa6f6c1cd4197276 100644
 --- a/third_party/blink/public/web/web_local_frame_client.h
 +++ b/third_party/blink/public/web/web_local_frame_client.h
-@@ -579,6 +579,9 @@ class BLINK_EXPORT WebLocalFrameClient {
+@@ -584,6 +584,9 @@ class BLINK_EXPORT WebLocalFrameClient {
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) {}
  
@@ -92,7 +92,7 @@ index 83a62e23b1d395b0aa545de5b828c24196cccc6d..0ca8163eb9ab87aead27bc8b2ee9e614
                                          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 f40f022ff8ff88f1f128d4996f4460b8fdea1d95..480503e245dbb28dffc8ac9d2843d541793db534 100644
+index 2ac22a0410eea7f67cc7eb066879da649f7c6a0e..53ec3d177afbd75b4e67c6ab847094994c291dcb 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
 @@ -273,6 +273,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -123,10 +123,10 @@ index c974fa2f7c7f9c2aa5f075ec4aeb887d0b104453..b4ed9b2fadcfad7676387045b8581eb8
                                  int32_t world_id) override;
  
 diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
-index d44adfd65bd9a71996cdd323a5220d2dcaa09de2..1011a318a7d79186abe556d03f78badc725c802a 100644
+index a2d7e97958d378dc5d37524f2f5516205c010749..e3f605938b3eea7f1c4dfac8e3c25014ebd15476 100644
 --- a/third_party/blink/renderer/core/loader/empty_clients.h
 +++ b/third_party/blink/renderer/core/loader/empty_clients.h
-@@ -366,6 +366,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
+@@ -367,6 +367,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
  
    void DidCreateScriptContext(v8::Local<v8::Context>,
                                int32_t world_id) override {}

+ 1 - 1
patches/chromium/add_ui_scopedcliboardwriter_writeunsaferawdata.patch

@@ -29,7 +29,7 @@ index 1eb1d0fe4696f26e7de43fc8797c283e9e6db042..766f8d8df866ce7fbc337cecceb715cc
    objects_.clear();
    platform_representations_.clear();
 diff --git a/ui/base/clipboard/scoped_clipboard_writer.h b/ui/base/clipboard/scoped_clipboard_writer.h
-index c47909313da0d7cd8a2b3cd670327011af66e3fb..0d259c21507f38124dfa46aceeacfda76cfd4a38 100644
+index 96f5bf8b6b5f3ed5ab25e15845f0de455eb68e0b..e6718a893e1bc5c970245c8265c95dda5d5fa2ff 100644
 --- a/ui/base/clipboard/scoped_clipboard_writer.h
 +++ b/ui/base/clipboard/scoped_clipboard_writer.h
 @@ -84,6 +84,10 @@ class COMPONENT_EXPORT(UI_BASE_CLIPBOARD) ScopedClipboardWriter {

+ 16 - 29
patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch

@@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView
 This allows us to disable throttling for hidden windows.
 
 diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc
-index 00f570d90db1279a486c3c0a34146e59b902c10f..373309f79a97ca58d2d291b6a162891935d5c4b7 100644
+index 5c03f1194643c6f7302131404f7d869502f1e18b..fa990e6a444d5321213d956b01ba89ef21d57bd2 100644
 --- a/content/browser/renderer_host/render_view_host_impl.cc
 +++ b/content/browser/renderer_host/render_view_host_impl.cc
-@@ -658,6 +658,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
+@@ -659,6 +659,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
    GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
  }
  
@@ -22,10 +22,10 @@ index 00f570d90db1279a486c3c0a34146e59b902c10f..373309f79a97ca58d2d291b6a1628919
    return is_active();
  }
 diff --git a/content/browser/renderer_host/render_view_host_impl.h b/content/browser/renderer_host/render_view_host_impl.h
-index 3ccc771a82992ae70c770fa6d2dde92904aa17db..505091e9006f7d41fa8d02e603afef1d10b35bf4 100644
+index dfefe47c77c723c1cfdc6abe0e8ff96bc5ec6ddd..8d195ec46b9a6ea830c1ff36ee740b3b8be2b341 100644
 --- a/content/browser/renderer_host/render_view_host_impl.h
 +++ b/content/browser/renderer_host/render_view_host_impl.h
-@@ -138,6 +138,7 @@ class CONTENT_EXPORT RenderViewHostImpl
+@@ -137,6 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl
    void EnablePreferredSizeMode() override;
    void WriteIntoTrace(perfetto::TracedProto<TraceProto> context) const override;
  
@@ -34,7 +34,7 @@ index 3ccc771a82992ae70c770fa6d2dde92904aa17db..505091e9006f7d41fa8d02e603afef1d
    void SendRendererPreferencesToRenderer(
        const blink::RendererPreferences& preferences);
 diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h
-index 4d2a4c6746e1dbfc619faf2e16eaa4948d74e372..6c9f190ff595234eca18ff20ca0655da4689b7a2 100644
+index 2e4af843d7d0bbef5b7e6357de73355068b38948..77c69de4a541c56389ae11330f67c5fb6bbc4d2a 100644
 --- a/content/public/browser/render_view_host.h
 +++ b/content/public/browser/render_view_host.h
 @@ -77,6 +77,9 @@ class CONTENT_EXPORT RenderViewHost {
@@ -47,27 +47,14 @@ index 4d2a4c6746e1dbfc619faf2e16eaa4948d74e372..6c9f190ff595234eca18ff20ca0655da
   private:
    // This interface should only be implemented inside content.
    friend class RenderViewHostImpl;
-diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
-index f55211fdb346c8659c93d077ec04ccebdae5b450..19b846f6ccf99423b712f0b589c20c1ab35bdfcf 100644
---- a/content/renderer/render_view_impl.h
-+++ b/content/renderer/render_view_impl.h
-@@ -138,6 +138,8 @@ class CONTENT_EXPORT RenderViewImpl : public blink::WebViewClient {
-                   bool was_created_by_renderer,
-                   scoped_refptr<base::SingleThreadTaskRunner> task_runner);
- 
-+  void OnSetSchedulerThrottling(bool allowed);
-+
-   static WindowOpenDisposition NavigationPolicyToDisposition(
-       blink::WebNavigationPolicy policy);
- 
 diff --git a/third_party/blink/public/mojom/page/page.mojom b/third_party/blink/public/mojom/page/page.mojom
-index 39bfc2200e924d0c589cfd07f085f182ef6853a6..bddff6d5ad3f6d08c4dc48e66ebc5319b1a5ec28 100644
+index 6ff7c34463f3ce5011ea8711d23f9cd11da38d8b..2b8e313dfac2ea9fad0583bb5e98d0c385e8584a 100644
 --- a/third_party/blink/public/mojom/page/page.mojom
 +++ b/third_party/blink/public/mojom/page/page.mojom
-@@ -108,4 +108,7 @@ interface PageBroadcast {
- 
-   // Sent to whole page, but should only be used by the main frame.
-   SetPageBaseBackgroundColor(skia.mojom.SkColor? color);
+@@ -137,4 +137,7 @@ interface PageBroadcast {
+     mojo_base.mojom.UnguessableToken devtools_frame_token,
+     RemoteFrameInterfacesFromBrowser remote_frame_interfaces,
+     RemoteMainFrameInterfaces remote_main_frame_interfaces);
 +
 +  // Whether to enable the Renderer scheduler background throttling.
 +  SetSchedulerThrottling(bool allowed);
@@ -85,10 +72,10 @@ index 3af33a4d699b5bbfb0a1abac9408ad322a47a5ac..30bc8aa73fb46a0306ccc837a99cc4d5
    // 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 8f15822dc33a2f8a19971afd7da0ab305f0b48b7..38faafcc7432c2bedead647d4946b7183233b4bc 100644
+index 231f76d07d8a0d3d060b30e0ff6eabe4aa33d755..40aa3b1a5c569e66b6f5d1630afe248c40d5715b 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
-@@ -3758,6 +3758,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
+@@ -3787,6 +3787,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
    return GetPage()->GetPageScheduler();
  }
  
@@ -102,7 +89,7 @@ index 8f15822dc33a2f8a19971afd7da0ab305f0b48b7..38faafcc7432c2bedead647d4946b718
  void WebViewImpl::SetVisibilityState(
      mojom::blink::PageVisibilityState visibility_state,
      bool is_initial_state) {
-@@ -3769,7 +3776,8 @@ void WebViewImpl::SetVisibilityState(
+@@ -3798,7 +3805,8 @@ void WebViewImpl::SetVisibilityState(
    }
    GetPage()->SetVisibilityState(visibility_state, is_initial_state);
    GetPage()->GetPageScheduler()->SetPageVisible(
@@ -113,10 +100,10 @@ index 8f15822dc33a2f8a19971afd7da0ab305f0b48b7..38faafcc7432c2bedead647d4946b718
  
  mojom::blink::PageVisibilityState WebViewImpl::GetVisibilityState() {
 diff --git a/third_party/blink/renderer/core/exported/web_view_impl.h b/third_party/blink/renderer/core/exported/web_view_impl.h
-index 1b0e7811c023f795f9f8f8cdf8bf621e54b79855..915348eaa98191c60bddaaa3d146bdc99099e16b 100644
+index 08cc81481cbe4fe40a7df6316db765fa2eac7fda..c5dfefd84b44de5a2c28afb2b9bd8035647da12b 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.h
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.h
-@@ -416,6 +416,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
+@@ -425,6 +425,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
    LocalDOMWindow* PagePopupWindow() const;
  
    PageScheduler* Scheduler() const override;
@@ -124,7 +111,7 @@ index 1b0e7811c023f795f9f8f8cdf8bf621e54b79855..915348eaa98191c60bddaaa3d146bdc9
    void SetVisibilityState(mojom::blink::PageVisibilityState visibility_state,
                            bool is_initial_state) override;
    mojom::blink::PageVisibilityState GetVisibilityState() override;
-@@ -866,6 +867,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
+@@ -875,6 +876,8 @@ class CORE_EXPORT WebViewImpl final : public WebView,
    // If true, we send IPC messages when |preferred_size_| changes.
    bool send_preferred_size_changes_ = false;
  

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

@@ -32,7 +32,7 @@ index e5c9ebda8156c1a7c32f7eb0661dff40f022c264..8840d4be4b49b27dfb257866f6a074ef
        accelerated_video_decode_enabled(false),
        animation_policy(
 diff --git a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
-index a910d7b53a1346797f0e2bd030dff7ff84a834b8..4847c7587484eb02b8d7f532be53e499517a95fb 100644
+index cfd107cf7257b5c0c2482baba8964e1d2508fc8b..6a2e25a3d7700df9c59952ff19c9ce62d391005c 100644
 --- a/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
 +++ b/third_party/blink/common/web_preferences/web_preferences_mojom_traits.cc
 @@ -149,6 +149,19 @@ bool StructTraits<blink::mojom::WebPreferencesDataView,
@@ -56,7 +56,7 @@ index a910d7b53a1346797f0e2bd030dff7ff84a834b8..4847c7587484eb02b8d7f532be53e499
    out->accelerated_video_decode_enabled =
        data.accelerated_video_decode_enabled();
 diff --git a/third_party/blink/public/common/web_preferences/web_preferences.h b/third_party/blink/public/common/web_preferences/web_preferences.h
-index 33ca0140e9434f37c67386973f1ebf460222691c..220551e3be0ae9275714f80758671eeac87b0cca 100644
+index adbb4f0de4d787ac7710de06de2bf3b32dc6491f..c68a71ca2e272874420d309f2154cf89cf99b7ec 100644
 --- a/third_party/blink/public/common/web_preferences/web_preferences.h
 +++ b/third_party/blink/public/common/web_preferences/web_preferences.h
 @@ -10,6 +10,7 @@
@@ -67,7 +67,7 @@ index 33ca0140e9434f37c67386973f1ebf460222691c..220551e3be0ae9275714f80758671eea
  #include "net/nqe/effective_connection_type.h"
  #include "third_party/blink/public/common/common_export.h"
  #include "third_party/blink/public/mojom/css/preferred_color_scheme.mojom-shared.h"
-@@ -157,6 +158,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
+@@ -159,6 +160,19 @@ struct BLINK_COMMON_EXPORT WebPreferences {
    // If true, stylus handwriting recognition to text input will be available in
    // editable input fields which are non-password type.
    bool stylus_handwriting_enabled;
@@ -88,7 +88,7 @@ index 33ca0140e9434f37c67386973f1ebf460222691c..220551e3be0ae9275714f80758671eea
    // This flags corresponds to a Page's Settings' setCookieEnabled state. It
    // only controls whether or not the "document.cookie" field is properly
 diff --git a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
-index d4c86ca871c796c3179a0fe099de0b3082ebf46e..0b438a894c37826c19bdac1b1474a50a4afe8e4f 100644
+index fa2db0ccc2d9f72aa4976816548df31f83c2ef54..ab896b217be1f8695c6d05414252a37c8086369d 100644
 --- a/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
 +++ b/third_party/blink/public/common/web_preferences/web_preferences_mojom_traits.h
 @@ -6,6 +6,7 @@
@@ -99,7 +99,7 @@ index d4c86ca871c796c3179a0fe099de0b3082ebf46e..0b438a894c37826c19bdac1b1474a50a
  #include "mojo/public/cpp/bindings/struct_traits.h"
  #include "net/nqe/effective_connection_type.h"
  #include "third_party/blink/public/common/common_export.h"
-@@ -433,6 +434,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
+@@ -438,6 +439,52 @@ struct BLINK_COMMON_EXPORT StructTraits<blink::mojom::WebPreferencesDataView,
      return r.stylus_handwriting_enabled;
    }
  
@@ -153,7 +153,7 @@ index d4c86ca871c796c3179a0fe099de0b3082ebf46e..0b438a894c37826c19bdac1b1474a50a
      return r.cookie_enabled;
    }
 diff --git a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
-index 4638c6cf8f3834bb3dc5f98347069f1211cb7332..8cf8845375809f239998b1db256622c2ce5b1e58 100644
+index 656ed9364bc7b5874273797f3587d5d74f2c6bdb..e8e990b10890cca95ecc8927222e622eee8b888f 100644
 --- a/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
 +++ b/third_party/blink/public/mojom/webpreferences/web_preferences.mojom
 @@ -10,6 +10,7 @@ import "third_party/blink/public/mojom/v8_cache_options.mojom";
@@ -164,7 +164,7 @@ index 4638c6cf8f3834bb3dc5f98347069f1211cb7332..8cf8845375809f239998b1db256622c2
  
  enum PointerType {
    kPointerNone                              = 1,             // 1 << 0
-@@ -209,6 +210,19 @@ struct WebPreferences {
+@@ -210,6 +211,19 @@ struct WebPreferences {
    // If true, stylus handwriting recognition to text input will be available in
    // editable input fields which are non-password type.
    bool stylus_handwriting_enabled;

+ 3 - 3
patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch

@@ -6,7 +6,7 @@ Subject: Allow setting secondary label via SimpleMenuModel
 Builds on https://chromium-review.googlesource.com/c/chromium/src/+/2208976
 
 diff --git a/ui/base/models/simple_menu_model.cc b/ui/base/models/simple_menu_model.cc
-index ce1d8d490c34b7a1f7f539dac401be4a4eafdde6..a40d91b1135f2baf0b5d654b7175107180048163 100644
+index 6e1ed6b05b9358a46c796ac175a6556703477a1f..f138d6dc153694c2c3fbb8c98d9557e5bab8214e 100644
 --- a/ui/base/models/simple_menu_model.cc
 +++ b/ui/base/models/simple_menu_model.cc
 @@ -53,6 +53,11 @@ std::u16string SimpleMenuModel::Delegate::GetLabelForCommandId(
@@ -21,7 +21,7 @@ index ce1d8d490c34b7a1f7f539dac401be4a4eafdde6..a40d91b1135f2baf0b5d654b71751071
  ImageModel SimpleMenuModel::Delegate::GetIconForCommandId(
      int command_id) const {
    return ImageModel();
-@@ -310,6 +315,11 @@ void SimpleMenuModel::SetLabel(size_t index, const std::u16string& label) {
+@@ -311,6 +316,11 @@ void SimpleMenuModel::SetLabel(size_t index, const std::u16string& label) {
    MenuItemsChanged();
  }
  
@@ -33,7 +33,7 @@ index ce1d8d490c34b7a1f7f539dac401be4a4eafdde6..a40d91b1135f2baf0b5d654b71751071
  void SimpleMenuModel::SetMinorText(size_t index,
                                     const std::u16string& minor_text) {
    items_[ValidateItemIndex(index)].minor_text = minor_text;
-@@ -403,6 +413,12 @@ std::u16string SimpleMenuModel::GetLabelAt(size_t index) const {
+@@ -404,6 +414,12 @@ std::u16string SimpleMenuModel::GetLabelAt(size_t index) const {
    return items_[ValidateItemIndex(index)].label;
  }
  

+ 6 - 6
patches/chromium/blink_local_frame.patch

@@ -15,10 +15,10 @@ Refs changes in:
 This patch reverts the changes to fix associated crashes in Electron.
 
 diff --git a/third_party/blink/renderer/core/frame/frame.cc b/third_party/blink/renderer/core/frame/frame.cc
-index 83b1a2231b522d10cf4b17864e444a00ef514735..f74d6e73675713780326ab20e504e43be61659d9 100644
+index 0e50579d9b1c989beee4113d6762d32b8074efb4..bbcd21ddc38a799fe4226447f9b3447f1ea54feb 100644
 --- a/third_party/blink/renderer/core/frame/frame.cc
 +++ b/third_party/blink/renderer/core/frame/frame.cc
-@@ -123,14 +123,6 @@ bool Frame::Detach(FrameDetachType type) {
+@@ -124,14 +124,6 @@ bool Frame::Detach(FrameDetachType type) {
  
    DCHECK(!IsDetached());
  
@@ -33,7 +33,7 @@ index 83b1a2231b522d10cf4b17864e444a00ef514735..f74d6e73675713780326ab20e504e43b
    if (type == FrameDetachType::kRemove) {
      if (provisional_frame_) {
        provisional_frame_->Detach(FrameDetachType::kRemove);
-@@ -154,6 +146,14 @@ bool Frame::Detach(FrameDetachType type) {
+@@ -155,6 +147,14 @@ bool Frame::Detach(FrameDetachType type) {
      GetWindowProxyManager()->ClearForSwap();
    }
  
@@ -49,10 +49,10 @@ index 83b1a2231b522d10cf4b17864e444a00ef514735..f74d6e73675713780326ab20e504e43b
    // 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 dd19180e5f29182a8993a18d939e5c78d49446c9..e3d7332e13524e5571b7aee2139648501d377dfb 100644
+index 90cf3971e573aaec7a85ccf4b6fff9f931924bdc..bb4e80de2930b2e3213cc7c4469bb2875760ebee 100644
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
-@@ -545,10 +545,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -547,10 +547,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
    }
    DCHECK(!view_ || !view_->IsAttached());
  
@@ -63,7 +63,7 @@ index dd19180e5f29182a8993a18d939e5c78d49446c9..e3d7332e13524e5571b7aee213964850
    if (!Client())
      return false;
  
-@@ -594,6 +590,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -596,6 +592,11 @@ bool LocalFrame::DetachImpl(FrameDetachType type) {
    DCHECK(!view_->IsAttached());
    Client()->WillBeDetached();
  

+ 1 - 1
patches/chromium/build_disable_partition_alloc_on_mac.patch

@@ -9,7 +9,7 @@ and can be removed when the crash in fork is resolved.
 Related issue: https://github.com/electron/electron/issues/32718
 
 diff --git a/base/allocator/allocator.gni b/base/allocator/allocator.gni
-index 605a2d455a8affffb3e864d872ffa767fdbc988f..ab4da059149f51724c057cdff7e04e9f6bc85270 100644
+index 674def40cfdc83432d0f3ced8ab3f570dc9e8b1b..96e5e5e145715218724f93041060df60d709839a 100644
 --- a/base/allocator/allocator.gni
 +++ b/base/allocator/allocator.gni
 @@ -20,7 +20,7 @@ _disable_partition_alloc = is_component_build || (is_win && is_debug)

+ 4 - 5
patches/chromium/build_disable_print_content_analysis.patch

@@ -13,16 +13,15 @@ This patch can be removed when enable_print_content_analysis can be more
 easily enabled or disabled by default with buildflags.
 
 diff --git a/printing/buildflags/buildflags.gni b/printing/buildflags/buildflags.gni
-index 1d2b24adbb39215531bbe189d6191dba026d4f68..88b7962836cfe93a59d1569245f4815f22be355e 100644
+index e57b8edde3b3e8f7a9cd580e2bcd039f1beebdff..f49cbaa980674444ccaee4a615dc99e9c630f7b8 100644
 --- a/printing/buildflags/buildflags.gni
 +++ b/printing/buildflags/buildflags.gni
-@@ -36,8 +36,7 @@ declare_args() {
+@@ -36,7 +36,7 @@ declare_args() {
  
    # Enable snapshotting a page when printing for its content to be analyzed for
    # sensitive content by enterprise users.
--  enable_print_content_analysis =
--      is_chromeos_ash || is_chromeos_lacros || is_win || is_linux || is_mac
-+  enable_print_content_analysis = is_chromeos_ash || is_chromeos_lacros
+-  enable_print_content_analysis = is_chromeos || is_win || is_linux || is_mac
++  enable_print_content_analysis = is_chromeos
  }
  
  declare_args() {

+ 10 - 10
patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch

@@ -11,10 +11,10 @@ if we ever align our .pak file generation with Chrome we can remove this
 patch.
 
 diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
-index 31d63709bd68819a439901823b6649e4328244f8..319447a52fb6ad39c879c3916bd8acfefb578981 100644
+index 0223183c4e869e835429a52ad7d9eb381a2d21f5..47162ccaa75ea637b7ce5ed0fed976862b14c427 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
-@@ -175,11 +175,16 @@ if (!is_android && !is_mac) {
+@@ -176,11 +176,16 @@ if (!is_android && !is_mac) {
          "common/crash_keys.h",
        ]
  
@@ -33,10 +33,10 @@ index 31d63709bd68819a439901823b6649e4328244f8..319447a52fb6ad39c879c3916bd8acfe
          "//base",
          "//build:branding_buildflags",
 diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
-index db5d426cef5850603eb9f98c69989e5f11fcb513..198a31142605f428d00a6e594908fb2c7fbdcf50 100644
+index bb193ea0cb1df492e52a5023bd84852bfc3985ce..f89c54a1f73f26ca142a2764fd235111e6cbeff0 100644
 --- a/chrome/browser/BUILD.gn
 +++ b/chrome/browser/BUILD.gn
-@@ -4614,7 +4614,7 @@ static_library("browser") {
+@@ -4623,7 +4623,7 @@ static_library("browser") {
  
      # On Windows, the hashes are embedded in //chrome:chrome_initial rather
      # than here in :chrome_dll.
@@ -46,10 +46,10 @@ index db5d426cef5850603eb9f98c69989e5f11fcb513..198a31142605f428d00a6e594908fb2c
        sources += [ "certificate_viewer_stub.cc" ]
      }
 diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
-index 0119e51f4ee0f98968d854e6310234c01028c4ff..9d87f0fdbe110663ab0d3da26fbc0d34e9a0c579 100644
+index ade95f3592fc54e69ec8717c7542ef2eae645056..c339589fc723be5ad49cca88bddbd9ae8a649644 100644
 --- a/chrome/test/BUILD.gn
 +++ b/chrome/test/BUILD.gn
-@@ -6011,7 +6011,6 @@ test("unit_tests") {
+@@ -6038,7 +6038,6 @@ test("unit_tests") {
  
      deps += [
        "//chrome:other_version",
@@ -57,7 +57,7 @@ index 0119e51f4ee0f98968d854e6310234c01028c4ff..9d87f0fdbe110663ab0d3da26fbc0d34
        "//chrome//services/util_win:unit_tests",
        "//chrome/app:chrome_dll_resources",
        "//chrome/app:crash_reporter_client_win_unit_tests",
-@@ -6036,6 +6035,10 @@ test("unit_tests") {
+@@ -6063,6 +6062,10 @@ test("unit_tests") {
        "//ui/resources",
      ]
  
@@ -68,16 +68,16 @@ index 0119e51f4ee0f98968d854e6310234c01028c4ff..9d87f0fdbe110663ab0d3da26fbc0d34
      ldflags = [
        "/DELAYLOAD:api-ms-win-core-winrt-error-l1-1-0.dll",
        "/DELAYLOAD:api-ms-win-core-winrt-l1-1-0.dll",
-@@ -6933,7 +6936,7 @@ test("unit_tests") {
+@@ -6964,7 +6967,7 @@ test("unit_tests") {
      }
  
      deps += [
 -      "//chrome:packed_resources_integrity_hash",
 +    # "//chrome:packed_resources_integrity_hash",
+       "//chrome/browser/autofill_assistant/password_change/vector_icons:vector_icons",
        "//chrome/browser/enterprise/connectors/analysis:features",
        "//chrome/browser/media/router:test_support",
-       "//chrome/browser/media/router/discovery:discovery",
-@@ -7051,6 +7054,10 @@ test("unit_tests") {
+@@ -7083,6 +7086,10 @@ test("unit_tests") {
      }
    }
  

+ 1 - 1
patches/chromium/build_libc_as_static_library.patch

@@ -7,7 +7,7 @@ Build libc++ as static library to compile and pass
 nan tests
 
 diff --git a/buildtools/third_party/libc++/BUILD.gn b/buildtools/third_party/libc++/BUILD.gn
-index 4fec8db3c0431294f65e2a7f0046b6ac5ba78c47..2a4ad0955b3c01b2f1d1665fb65e6d9bb16f5fc2 100644
+index 01f5a1713c28f077e624fe1ea1c84fa3b514d660..3837b9ccf00b2d9f0b655a2c08e96d5020b0afbf 100644
 --- a/buildtools/third_party/libc++/BUILD.gn
 +++ b/buildtools/third_party/libc++/BUILD.gn
 @@ -44,7 +44,11 @@ config("winver") {

+ 24 - 24
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 9fe7a9c021c8d29359f072e04665a55858048be6..115dab63efa4b90f37609a9a0a363ad75a0ff582 100644
+index abfe94dc8c31fc928eb554ec3f2ec095aa6a970b..e815010dcb9437727f32b12f0d47a31384e24677 100644
 --- a/content/browser/renderer_host/render_frame_host_impl.cc
 +++ b/content/browser/renderer_host/render_frame_host_impl.cc
-@@ -7298,6 +7298,7 @@ void RenderFrameHostImpl::CreateNewWindow(
+@@ -7313,6 +7313,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 9fe7a9c021c8d29359f072e04665a55858048be6..115dab63efa4b90f37609a9a0a363ad7
            &no_javascript_access);
  
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 276ae812cfb35f4fe6000a87b38c2155f37b12d3..9a0edcadef1bc60b035ca67df5082a7d06dd4436 100644
+index 8e1c0feede6dc599c0bc78d6278726b16c7931df..2b393e7e7089d17a0906610c3c8979c20928a5f6 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -3996,6 +3996,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -4012,6 +4012,14 @@ FrameTree* WebContentsImpl::CreateNewWindow(
    }
    auto* new_contents_impl = new_contents.get();
  
@@ -39,7 +39,7 @@ index 276ae812cfb35f4fe6000a87b38c2155f37b12d3..9a0edcadef1bc60b035ca67df5082a7d
    new_contents_impl->GetController().SetSessionStorageNamespace(
        partition_config, session_storage_namespace);
  
-@@ -4040,12 +4048,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -4056,12 +4064,6 @@ FrameTree* WebContentsImpl::CreateNewWindow(
      AddWebContentsDestructionObserver(new_contents_impl);
    }
  
@@ -53,10 +53,10 @@ index 276ae812cfb35f4fe6000a87b38c2155f37b12d3..9a0edcadef1bc60b035ca67df5082a7d
                               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 fc7e18c294993f1fa8cef88782ae3f4ba60e4d54..c41545fc79a6a45c82aa39ff21e790bdcd7b8f01 100644
+index 4eee5f6c069c83039bf0acee71056d8ed4ea92eb..9212926fba9d06296c9c46a95519b6ed777569ee 100644
 --- a/content/common/frame.mojom
 +++ b/content/common/frame.mojom
-@@ -571,6 +571,10 @@ struct CreateNewWindowParams {
+@@ -574,6 +574,10 @@ struct CreateNewWindowParams {
  
    // Additional parameters for creating picture-in-picture windows.
    blink.mojom.PictureInPictureWindowOptions? pip_options;
@@ -68,10 +68,10 @@ index fc7e18c294993f1fa8cef88782ae3f4ba60e4d54..c41545fc79a6a45c82aa39ff21e790bd
  
  // 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 82a07cfb29870615a18a1718e5b6c0b2a42443ef..ba6e21fb83b4c58716b776c1a018c36f14902e6f 100644
+index a9c96d4b463929143c7de0ec29d4afee5315fd92..2750d9f6c377b36fd1684077d9eec1cde78c856c 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
-@@ -610,6 +610,8 @@ bool ContentBrowserClient::CanCreateWindow(
+@@ -617,6 +617,8 @@ bool ContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,
@@ -81,10 +81,10 @@ index 82a07cfb29870615a18a1718e5b6c0b2a42443ef..ba6e21fb83b4c58716b776c1a018c36f
      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 2f475430b85cf6029f0066f30069294847d05bd1..f399bc59be5705542b34185e7fe7202a029c40ea 100644
+index bac29d867e465c87f69ea4f28eac118718db0992..7eb47e0c73c7f0d8a0cadcf5b8163f8a5154faea 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -164,6 +164,7 @@ class NetworkService;
+@@ -163,6 +163,7 @@ class NetworkService;
  class TrustedURLLoaderHeaderClient;
  }  // namespace mojom
  struct ResourceRequest;
@@ -92,7 +92,7 @@ index 2f475430b85cf6029f0066f30069294847d05bd1..f399bc59be5705542b34185e7fe7202a
  }  // namespace network
  
  namespace sandbox {
-@@ -991,6 +992,8 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -999,6 +1000,8 @@ class CONTENT_EXPORT ContentBrowserClient {
        const std::string& frame_name,
        WindowOpenDisposition disposition,
        const blink::mojom::WindowFeatures& features,
@@ -149,13 +149,13 @@ index 0274e3bb5cc62ce2c52be68a50b57c339fc5bba7..1ea3e1fdf067ea54ce54d31f494ac2bf
    // Notifies the delegate about the creation of a new WebContents. This
    // typically happens when popups are created.
    virtual void WebContentsCreated(WebContents* source_contents,
-diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
-index f9a857f270bad274fc952655efd7a9a32fbd7fb1..80cad3267721dc7bf78f5b75f99cda2a0d1d2016 100644
---- a/content/renderer/render_view_impl.cc
-+++ b/content/renderer/render_view_impl.cc
-@@ -297,6 +297,10 @@ WebView* RenderViewImpl::CreateView(
-       /*openee_can_access_opener_origin=*/true, !creator->IsAllowedToDownload(),
-       creator->IsAdFrame());
+diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
+index d70f6df69aa604972755d1cfe0cfcd2b0369f68c..8199122b2d759aa8b27affabe67b108fb9a16c38 100644
+--- a/content/renderer/render_frame_impl.cc
++++ b/content/renderer/render_frame_impl.cc
+@@ -6196,6 +6196,10 @@ WebView* RenderFrameImpl::CreateNewWindow(
+       /*openee_can_access_opener_origin=*/true,
+       !GetWebFrame()->IsAllowedToDownload(), GetWebFrame()->IsAdFrame());
  
 +  params->raw_features = features.raw_features.Utf8(
 +      WTF::UTF8ConversionMode::kStrictUTF8ConversionReplacingUnpairedSurrogatesWithFFFD);
@@ -165,10 +165,10 @@ index f9a857f270bad274fc952655efd7a9a32fbd7fb1..80cad3267721dc7bf78f5b75f99cda2a
    // 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 6abdcf70bdeeb3a34d01c3b00e5f629373eef76b..537f71cbf3cc1112100a199a15b77a535efd8a4e 100644
+index 40b82385697d8721ef6da3d0c77544d6d0ca400c..3a2d5207fb2eeea4b016012b09c3668af8dc35b4 100644
 --- a/content/web_test/browser/web_test_content_browser_client.cc
 +++ b/content/web_test/browser/web_test_content_browser_client.cc
-@@ -440,6 +440,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
+@@ -482,6 +482,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,
@@ -212,12 +212,12 @@ index 34570168ccb123f5102dcf8fa6bbf98e7c373ec6..192701e56d258da41b3724292853885e
  
  }  // 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 cc39235616f0249c8a979a870885aec2d0e04cc4..77e6bbe18556279a98b5453d4ba1c3eb5b850287 100644
+index 5bf3339038b6a8498221d1bd222ec340d78d1b92..c4be7a96144ac53be856fbf52dff8e990aa736aa 100644
 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc
 +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
-@@ -2090,6 +2090,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
+@@ -2091,6 +2091,8 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
    WebWindowFeatures window_features =
-       GetWindowFeaturesFromString(features, entered_window);
+       GetWindowFeaturesFromString(features, entered_window, completed_url);
  
 +  window_features.raw_features = features;
 +

+ 0 - 179
patches/chromium/cherry-pick-9b5207569882.patch

@@ -1,179 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Ken Rockot <[email protected]>
-Date: Wed, 31 Aug 2022 15:39:45 +0000
-Subject: Mojo: Validate response message type
-
-Ensures that a response message is actually the type expected by the
-original request.
-
-Fixed: 1358134
-Change-Id: I8f8f58168764477fbf7a6d2e8aeb040f07793d45
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3864274
-Reviewed-by: Robert Sesek <[email protected]>
-Commit-Queue: Ken Rockot <[email protected]>
-Cr-Commit-Position: refs/heads/main@{#1041553}
-
-diff --git a/mojo/public/cpp/bindings/interface_endpoint_client.h b/mojo/public/cpp/bindings/interface_endpoint_client.h
-index 0ebbc94ad51cca74fcebc357b5262229ae5c9d0e..cd79a5edb3f939623b874db36542ee651113c164 100644
---- a/mojo/public/cpp/bindings/interface_endpoint_client.h
-+++ b/mojo/public/cpp/bindings/interface_endpoint_client.h
-@@ -221,20 +221,32 @@ class COMPONENT_EXPORT(MOJO_CPP_BINDINGS) InterfaceEndpointClient
-   void ForgetAsyncRequest(uint64_t request_id);
- 
-  private:
--  // Maps from the id of a response to the MessageReceiver that handles the
--  // response.
--  using AsyncResponderMap =
--      std::map<uint64_t, std::unique_ptr<MessageReceiver>>;
-+  struct PendingAsyncResponse {
-+   public:
-+    PendingAsyncResponse(uint32_t request_message_name,
-+                         std::unique_ptr<MessageReceiver> responder);
-+    PendingAsyncResponse(PendingAsyncResponse&&);
-+    PendingAsyncResponse(const PendingAsyncResponse&) = delete;
-+    PendingAsyncResponse& operator=(PendingAsyncResponse&&);
-+    PendingAsyncResponse& operator=(const PendingAsyncResponse&) = delete;
-+    ~PendingAsyncResponse();
-+
-+    uint32_t request_message_name;
-+    std::unique_ptr<MessageReceiver> responder;
-+  };
-+
-+  using AsyncResponderMap = std::map<uint64_t, PendingAsyncResponse>;
- 
-   struct SyncResponseInfo {
-    public:
--    explicit SyncResponseInfo(bool* in_response_received);
-+    SyncResponseInfo(uint32_t request_message_name, bool* in_response_received);
- 
-     SyncResponseInfo(const SyncResponseInfo&) = delete;
-     SyncResponseInfo& operator=(const SyncResponseInfo&) = delete;
- 
-     ~SyncResponseInfo();
- 
-+    uint32_t request_message_name;
-     Message response;
- 
-     // Points to a stack-allocated variable.
-diff --git a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
-index ded0d20ab193cfdaf36bd44c25719d7073c989fb..a6f41414b8918989662eb0a1dea773932631c8cc 100644
---- a/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
-+++ b/mojo/public/cpp/bindings/lib/interface_endpoint_client.cc
-@@ -30,6 +30,7 @@
- #include "mojo/public/cpp/bindings/sync_call_restrictions.h"
- #include "mojo/public/cpp/bindings/sync_event_watcher.h"
- #include "mojo/public/cpp/bindings/thread_safe_proxy.h"
-+#include "third_party/abseil-cpp/absl/types/optional.h"
- #include "third_party/perfetto/protos/perfetto/trace/track_event/chrome_mojo_event_info.pbzero.h"
- 
- namespace mojo {
-@@ -316,9 +317,27 @@ class ResponderThunk : public MessageReceiverWithStatus {
- 
- // ----------------------------------------------------------------------------
- 
-+InterfaceEndpointClient::PendingAsyncResponse::PendingAsyncResponse(
-+    uint32_t request_message_name,
-+    std::unique_ptr<MessageReceiver> responder)
-+    : request_message_name(request_message_name),
-+      responder(std::move(responder)) {}
-+
-+InterfaceEndpointClient::PendingAsyncResponse::PendingAsyncResponse(
-+    PendingAsyncResponse&&) = default;
-+
-+InterfaceEndpointClient::PendingAsyncResponse&
-+InterfaceEndpointClient::PendingAsyncResponse::operator=(
-+    PendingAsyncResponse&&) = default;
-+
-+InterfaceEndpointClient::PendingAsyncResponse::~PendingAsyncResponse() =
-+    default;
-+
- InterfaceEndpointClient::SyncResponseInfo::SyncResponseInfo(
-+    uint32_t request_message_name,
-     bool* in_response_received)
--    : response_received(in_response_received) {}
-+    : request_message_name(request_message_name),
-+      response_received(in_response_received) {}
- 
- InterfaceEndpointClient::SyncResponseInfo::~SyncResponseInfo() {}
- 
-@@ -606,6 +625,7 @@ bool InterfaceEndpointClient::SendMessageWithResponder(
-   // message before calling |SendMessage()| below.
- #endif
- 
-+  const uint32_t message_name = message->name();
-   const bool is_sync = message->has_flag(Message::kFlagIsSync);
-   const bool exclusive_wait = message->has_flag(Message::kFlagNoInterrupt);
-   if (!controller_->SendMessage(message))
-@@ -622,7 +642,8 @@ bool InterfaceEndpointClient::SendMessageWithResponder(
-       controller_->RegisterExternalSyncWaiter(request_id);
-     }
-     base::AutoLock lock(async_responders_lock_);
--    async_responders_[request_id] = std::move(responder);
-+    async_responders_.emplace(
-+        request_id, PendingAsyncResponse{message_name, std::move(responder)});
-     return true;
-   }
- 
-@@ -630,7 +651,8 @@ bool InterfaceEndpointClient::SendMessageWithResponder(
- 
-   bool response_received = false;
-   sync_responses_.insert(std::make_pair(
--      request_id, std::make_unique<SyncResponseInfo>(&response_received)));
-+      request_id,
-+      std::make_unique<SyncResponseInfo>(message_name, &response_received)));
- 
-   base::WeakPtr<InterfaceEndpointClient> weak_self =
-       weak_ptr_factory_.GetWeakPtr();
-@@ -808,13 +830,13 @@ void InterfaceEndpointClient::ResetFromAnotherSequenceUnsafe() {
- }
- 
- void InterfaceEndpointClient::ForgetAsyncRequest(uint64_t request_id) {
--  std::unique_ptr<MessageReceiver> responder;
-+  absl::optional<PendingAsyncResponse> response;
-   {
-     base::AutoLock lock(async_responders_lock_);
-     auto it = async_responders_.find(request_id);
-     if (it == async_responders_.end())
-       return;
--    responder = std::move(it->second);
-+    response = std::move(it->second);
-     async_responders_.erase(it);
-   }
- }
-@@ -906,6 +928,10 @@ bool InterfaceEndpointClient::HandleValidatedMessage(Message* message) {
-         return false;
- 
-       if (it->second) {
-+        if (message->name() != it->second->request_message_name) {
-+          return false;
-+        }
-+
-         it->second->response = std::move(*message);
-         *it->second->response_received = true;
-         return true;
-@@ -916,18 +942,22 @@ bool InterfaceEndpointClient::HandleValidatedMessage(Message* message) {
-       sync_responses_.erase(it);
-     }
- 
--    std::unique_ptr<MessageReceiver> responder;
-+    absl::optional<PendingAsyncResponse> pending_response;
-     {
-       base::AutoLock lock(async_responders_lock_);
-       auto it = async_responders_.find(request_id);
-       if (it == async_responders_.end())
-         return false;
--      responder = std::move(it->second);
-+      pending_response = std::move(it->second);
-       async_responders_.erase(it);
-     }
- 
-+    if (message->name() != pending_response->request_message_name) {
-+      return false;
-+    }
-+
-     internal::MessageDispatchContext dispatch_context(message);
--    return responder->Accept(message);
-+    return pending_response->responder->Accept(message);
-   } else {
-     if (mojo::internal::ControlMessageHandler::IsControlMessage(message))
-       return control_message_handler_.Accept(message);

+ 1 - 1
patches/chromium/chore_add_electron_deps_to_gitignores.patch

@@ -6,7 +6,7 @@ Subject: chore: add electron deps to gitignores
 Makes things like "git status" quicker when developing electron locally
 
 diff --git a/.gitignore b/.gitignore
-index baf86ec0cde417fa4287f794de10b78d19439930..29d7b595fbfd6e211864e3baa8e2d3014b2e7a5b 100644
+index 651d8ec7d8e98e7588f8f182018188ab234d5c5a..1fc645a7f748d3cad8ca2f4fa9897454cb937a4c 100644
 --- a/.gitignore
 +++ b/.gitignore
 @@ -230,6 +230,7 @@ vs-chromium-project.txt

+ 2 - 2
patches/chromium/chore_allow_chromium_to_handle_synthetic_mouse_events_for_touch.patch

@@ -34,10 +34,10 @@ index 0aae49ec83b88057434af5bbfb54b10e53469918..058e5dc978e76a71fa02dc9e275592f3
    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 67871eec9821cf100acc719a1765be489dfbe7d8..1f883dc7d46d5cc3fddffe75c55e6b96fb0fc5f2 100644
+index 2dbe61a4bdf6556f6db101e47d81d37417736bd1..dec439f15a7995b14ccf4ef95651413911b5fc4f 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -3136,15 +3136,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
+@@ -3137,15 +3137,19 @@ LRESULT HWNDMessageHandler::HandleMouseEventInternal(UINT message,
        SetMsgHandled(FALSE);
      // We must let Windows handle the caption buttons if it's drawing them, or
      // they won't work.

+ 8 - 8
patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch

@@ -63,10 +63,10 @@ index faa684c429e8cd5817c043db48dcbea33c6c8782..8b5991bc8279585cc0749f6816aa8a03
        content::RenderFrameHost* requesting_frame,
        const blink::mojom::FullscreenOptions& options) final;
 diff --git a/chrome/browser/ui/ash/ash_web_view_impl.cc b/chrome/browser/ui/ash/ash_web_view_impl.cc
-index 268355f22577cf21926e209a9fcdb3f52314f2ac..80f998cdb10d9955e438ba5ef4599b35c448fae2 100644
+index a3083a16b1317cc58b87e13f30498bcf3e475eaf..50deda6f7ee9b2cbf57288d54a30a44022be808a 100644
 --- a/chrome/browser/ui/ash/ash_web_view_impl.cc
 +++ b/chrome/browser/ui/ash/ash_web_view_impl.cc
-@@ -84,10 +84,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
+@@ -96,10 +96,9 @@ bool AshWebViewImpl::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -108,10 +108,10 @@ index 1318d5e04d5448d2b357454c3ce4207264288760..3b0324c35d5b18ed2e29264aae860c48
    }
  
 diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
-index ecf7d1e17ec8aa8f593b6f1b17d2d1c98928879a..8fa9f8b224526c7a41c16f0f6fd51c4ca6b3b66e 100644
+index 244584b4df1fb85241212c44cca7da3e87c174f3..1e6239c111b0ea765388f384385789537f473237 100644
 --- a/chrome/browser/ui/browser.cc
 +++ b/chrome/browser/ui/browser.cc
-@@ -1821,12 +1821,11 @@ bool Browser::IsWebContentsCreationOverridden(
+@@ -1811,12 +1811,11 @@ bool Browser::IsWebContentsCreationOverridden(
      content::SiteInstance* source_site_instance,
      content::mojom::WindowContainerType window_container_type,
      const GURL& opener_url,
@@ -127,10 +127,10 @@ index ecf7d1e17ec8aa8f593b6f1b17d2d1c98928879a..8fa9f8b224526c7a41c16f0f6fd51c4c
  
  WebContents* Browser::CreateCustomWebContents(
 diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
-index b0f70cfaa60d28547f74b199d41ce81a5cdc8891..74efdc0a0ba5e5b862e12180dbfdb9534e9e0a5d 100644
+index 38ee0d848089a4abefa357e47169da871753df6e..53332516617dc196ce21d674ab6987c6de8438e0 100644
 --- a/chrome/browser/ui/browser.h
 +++ b/chrome/browser/ui/browser.h
-@@ -855,8 +855,7 @@ class Browser : public TabStripModelObserver,
+@@ -852,8 +852,7 @@ class Browser : public TabStripModelObserver,
        content::SiteInstance* source_site_instance,
        content::mojom::WindowContainerType window_container_type,
        const GURL& opener_url,
@@ -246,10 +246,10 @@ index c6bd5c19f8a7ceec17c9e32af5296a9617f3a619..02199b439fba7fdc617b7f7980d958b7
    void AddNewContents(content::WebContents* source,
                        std::unique_ptr<content::WebContents> new_contents,
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index a2f1f72a30f694d53f28d38d823341e7b4f008e1..7ff6febe70e9ec82becfbe036883fbc7572b5b01 100644
+index 47b85a2bd890485dec96e23fb2cb8f8553f5c4e2..7f04a05eec8780e735e0458c75103d9f2e9b858b 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -3922,8 +3922,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
+@@ -3938,8 +3938,7 @@ FrameTree* WebContentsImpl::CreateNewWindow(
  
    if (delegate_ && delegate_->IsWebContentsCreationOverridden(
                         source_site_instance, params.window_container_type,

+ 1 - 1
patches/chromium/chrome_key_systems.patch

@@ -7,7 +7,7 @@ Disable persiste licence support check for widevine cdm,
 as its not supported in the current version of chrome.
 
 diff --git a/chrome/renderer/media/chrome_key_systems.cc b/chrome/renderer/media/chrome_key_systems.cc
-index 732260f0da15c50f660348e0c66e0b3098aa418f..0a0394a3607e9b955f9fc517e0814ac07b3ba67e 100644
+index 30da015cffeb945973d0045ce297467ab16d7db6..53e7bd0f7dbff8c620a5827abb3ba871703a4f06 100644
 --- a/chrome/renderer/media/chrome_key_systems.cc
 +++ b/chrome/renderer/media/chrome_key_systems.cc
 @@ -17,7 +17,9 @@

+ 2 - 2
patches/chromium/crash_allow_setting_more_options.patch

@@ -75,7 +75,7 @@ index 2532e99f00b39777cd9640c76704f7430d39502e..323e039e4591a4099b187f7a0097b4ee
    // 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 7159bea91a25700f0cb36c48cab62fe2d616b3bd..9bcc5ae7e870c27c3533534c06daa890de5a4816 100644
+index a80a792f1cb2c996b77443a3383663b4687ae044..2b1453353ce93632b378d4b25295b5cb14df9b2c 100644
 --- a/components/crash/core/app/crashpad_linux.cc
 +++ b/components/crash/core/app/crashpad_linux.cc
 @@ -170,6 +170,7 @@ bool PlatformCrashpadInitialization(
@@ -128,7 +128,7 @@ index dc041c43371fd58e3121ef6bc423aadb644bb8d0..a1fa566775724b4a1662a939fda3f0a5
          arguments.push_back("--monitor-self");
        }
 diff --git a/components/crash/core/app/crashpad_win.cc b/components/crash/core/app/crashpad_win.cc
-index ad401a7711ceff58abacb99a03fda258fccd12a0..de04f4df602e3a0b20af045111faf8a7bf8e9e28 100644
+index ae8801a7fc877241313de84a6ae0698d4f2adf69..9ae249bfe41da9743adc7f60d69be0f003ca31e2 100644
 --- a/components/crash/core/app/crashpad_win.cc
 +++ b/components/crash/core/app/crashpad_win.cc
 @@ -91,6 +91,7 @@ bool PlatformCrashpadInitialization(

+ 2 - 2
patches/chromium/disable-redraw-lock.patch

@@ -15,7 +15,7 @@ the redraw locking mechanism, which fixes these issues. The electron issue
 can be found at https://github.com/electron/electron/issues/1821
 
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 7438cdf5604e237b46a22a2dd808aa6d031aea5f..fe882b31026b527df28d384e6e7e7cccaee61d61 100644
+index 29e812d41d5c8b1384db2231c625a39579fed6dc..b0d12e9b64cc7aa5448e88f540e7a594fca3c80e 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
 @@ -309,6 +309,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
@@ -39,7 +39,7 @@ index 7438cdf5604e237b46a22a2dd808aa6d031aea5f..fe882b31026b527df28d384e6e7e7ccc
                       (!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) ||
                        !ui::win::IsAeroGlassEnabled())) {
      if (should_lock_)
-@@ -1052,6 +1057,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
+@@ -1053,6 +1058,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() {
    return scoped_enable;
  }
  

+ 7 - 7
patches/chromium/disable_color_correct_rendering.patch

@@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at
 https://crbug.com/634542 and https://crbug.com/711107.
 
 diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
-index 23c2ea10c648fd0f67f31118c0ae30c5647ce5e5..9fe5b106397e8b5a66bc4a10e874c5130e93e74d 100644
+index 5542037a338e34800d86c3ca9cbaf0511fa60570..e5011a2b9d2127c1e17730db54f9574f1ed1d287 100644
 --- a/cc/trees/layer_tree_host_impl.cc
 +++ b/cc/trees/layer_tree_host_impl.cc
-@@ -1866,6 +1866,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
+@@ -1873,6 +1873,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
  TargetColorParams LayerTreeHostImpl::GetTargetColorParams(
      gfx::ContentColorUsage content_color_usage) const {
    TargetColorParams params;
@@ -35,7 +35,7 @@ index 23c2ea10c648fd0f67f31118c0ae30c5647ce5e5..9fe5b106397e8b5a66bc4a10e874c513
    // If we are likely to software composite the resource, we use sRGB because
    // software compositing is unable to perform color conversion.
 diff --git a/cc/trees/layer_tree_settings.h b/cc/trees/layer_tree_settings.h
-index 5eaf2d9cab94def423be78b414179e6ccc596437..1ca8b5968350e88761d9ebc073fe8c573d0f3b5d 100644
+index 809fb46cc34db308e0ec73197859045ba639407c..9360695cd920de372529206212f795f299405fcf 100644
 --- a/cc/trees/layer_tree_settings.h
 +++ b/cc/trees/layer_tree_settings.h
 @@ -93,6 +93,8 @@ class CC_EXPORT LayerTreeSettings {
@@ -81,7 +81,7 @@ index 9d34ced366026eb7cdd00ce40a4eb1af56180d39..abf67f8246bfa37df08cd2216c388dd3
        !command_line->HasSwitch(switches::kUIDisablePartialSwap);
  
 diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
-index 4b3c2d088253e478005bd0d891dbd9c62be3fed7..187c2ae02479fa9605abc9587ff14363b1203c58 100644
+index 3f413731440ea6597001c8da03c1ac3c49bb60b2..fe1f2373f0b5f5e8eed2e0966910a6454db776d4 100644
 --- a/content/browser/gpu/gpu_process_host.cc
 +++ b/content/browser/gpu/gpu_process_host.cc
 @@ -228,6 +228,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
@@ -93,7 +93,7 @@ index 4b3c2d088253e478005bd0d891dbd9c62be3fed7..187c2ae02479fa9605abc9587ff14363
      sandbox::policy::switches::kGpuSandboxAllowSysVShm,
      sandbox::policy::switches::kGpuSandboxFailuresFatal,
 diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index 7bb696c3ad090828b2a7e3a9a648b75bbf39f844..81f0d154838bcf3d3b4e12780ca37bcf26423d0e 100644
+index 368d47247ced2320e0627e9cce3cf05e59ea9f39..c675f0f37fa75dd0a39d503564c7ac265614d4e9 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
 @@ -199,6 +199,7 @@
@@ -104,7 +104,7 @@ index 7bb696c3ad090828b2a7e3a9a648b75bbf39f844..81f0d154838bcf3d3b4e12780ca37bcf
  #include "ui/gl/gl_switches.h"
  #include "url/gurl.h"
  #include "url/origin.h"
-@@ -3195,6 +3196,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
+@@ -3205,6 +3206,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
    // Propagate the following switches to the renderer command line (along
    // with any associated values) if present in the browser command line.
    static const char* const kSwitchNames[] = {
@@ -156,7 +156,7 @@ index 75d7af9a79d4e7f2cd39e45496ab5fff66407638..35b0bb908245330fbdc5205caa3299bf
  }
  
 diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
-index 4f3b9b181b1998e0ebbd95955feeec28a5d6bcb7..00f2a213cded1985b3131fabf3560937c56f6ffd 100644
+index ba6ab6961dec25a3f9c572341d24f341c8f58358..ba8cfd2a2572368fc14073a53f8544f269089894 100644
 --- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
 +++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc
 @@ -24,6 +24,7 @@

+ 2 - 2
patches/chromium/disable_compositor_recycling.patch

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

+ 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 cfa45a1e4e65b26085694979ac34a8844643b9c7..25a80899f9ae533e2d84e99076696468cef6e56d 100644
+index 311dd906e497f5ba8a19037e629aa58c44773e67..457ba67603442e8ae9ea75be1cb3b4bf32ed4c4f 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
-@@ -809,6 +809,9 @@ void RenderWidgetHostImpl::WasHidden() {
+@@ -810,6 +810,9 @@ void RenderWidgetHostImpl::WasHidden() {
    if (is_hidden_)
      return;
  
@@ -20,10 +20,10 @@ index cfa45a1e4e65b26085694979ac34a8844643b9c7..25a80899f9ae533e2d84e99076696468
        blink::mojom::PointerLockResult::kWrongDocument);
  
 diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h
-index db807cca58eac2693aa4e8dabff7f3102c3ebaed..0646cecba3679dfa4cd04be093943545cade0e23 100644
+index 527463920c3d259ca0f30c70a5a860394d0cf4e9..2b50994469ee8ede3b4417650386e26553436e6e 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.h
 +++ b/content/browser/renderer_host/render_widget_host_impl.h
-@@ -881,6 +881,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
+@@ -883,6 +883,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl
  
    SiteInstanceGroup* GetSiteInstanceGroup();
  
@@ -34,10 +34,10 @@ index db807cca58eac2693aa4e8dabff7f3102c3ebaed..0646cecba3679dfa4cd04be093943545
    // |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 ea62c4a966dd76c1964b6d7f9053cb4fb73376f5..79253c9d5c8f4e71e5c0d0d87dd641feab901e51 100644
+index 9d1301a55acdc5f70550c7222cd31f8338f0e7f4..82e9c9ba7c7cade143aeffdd1e123131d7568698 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
-@@ -592,7 +592,7 @@ void RenderWidgetHostViewAura::HideImpl() {
+@@ -594,7 +594,7 @@ void RenderWidgetHostViewAura::HideImpl() {
    DCHECK(visibility_ == Visibility::HIDDEN ||
           visibility_ == Visibility::OCCLUDED);
  

+ 59 - 0
patches/chromium/disable_optimization_guide_for_preconnect_feature.patch

@@ -0,0 +1,59 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: John Kleinschmidt <[email protected]>
+Date: Thu, 1 Sep 2022 11:31:24 -0400
+Subject: disable optimization guide for preconnect feature
+
+The optimization guide component
+(https://source.chromium.org/chromium/chromium/src/+/main:components/optimization_guide/)
+is not enabled for Electron, but the preconnect feature uses the resource prefetch
+predictor code which includes this component.  This patch disables the optimization guide
+component code in the resource prefetch predictor code since it is unused and including
+it causes compilation problems on Windows.
+
+diff --git a/chrome/browser/predictors/resource_prefetch_predictor.cc b/chrome/browser/predictors/resource_prefetch_predictor.cc
+index c4b64a7812bac4534371887eb7e0a07ec9cab8ff..b827d69964d824540ea70f66c467e91be8391e6c 100644
+--- a/chrome/browser/predictors/resource_prefetch_predictor.cc
++++ b/chrome/browser/predictors/resource_prefetch_predictor.cc
+@@ -100,10 +100,12 @@ PreconnectPrediction& PreconnectPrediction::operator=(
+ PreconnectPrediction& PreconnectPrediction::operator=(
+     PreconnectPrediction&& other) = default;
+ 
++#if 0
+ OptimizationGuidePrediction::OptimizationGuidePrediction() = default;
+ OptimizationGuidePrediction::OptimizationGuidePrediction(
+     const OptimizationGuidePrediction& prediction) = default;
+ OptimizationGuidePrediction::~OptimizationGuidePrediction() = default;
++#endif
+ 
+ ////////////////////////////////////////////////////////////////////////////////
+ // ResourcePrefetchPredictor static functions.
+diff --git a/chrome/browser/predictors/resource_prefetch_predictor.h b/chrome/browser/predictors/resource_prefetch_predictor.h
+index 53a23990019accc0504a25dae935c53348c7eaa7..ef6667ce8bbc062dbfb8d2e2cdb6886b3e994b76 100644
+--- a/chrome/browser/predictors/resource_prefetch_predictor.h
++++ b/chrome/browser/predictors/resource_prefetch_predictor.h
+@@ -26,7 +26,9 @@
+ #include "components/history/core/browser/history_service_observer.h"
+ #include "components/history/core/browser/history_types.h"
+ #include "components/keyed_service/core/keyed_service.h"
++#if 0
+ #include "components/optimization_guide/content/browser/optimization_guide_decider.h"
++#endif
+ #include "components/sqlite_proto/key_value_data.h"
+ #include "net/base/network_isolation_key.h"
+ #include "services/network/public/mojom/fetch_api.mojom-forward.h"
+@@ -110,6 +112,7 @@ struct PreconnectPrediction {
+   std::vector<PrefetchRequest> prefetch_requests;
+ };
+ 
++#if 0
+ // Stores a result of a prediction from the optimization guide.
+ struct OptimizationGuidePrediction {
+   OptimizationGuidePrediction();
+@@ -121,6 +124,7 @@ struct OptimizationGuidePrediction {
+   std::vector<GURL> predicted_subresources;
+   absl::optional<base::TimeTicks> optimization_guide_prediction_arrived;
+ };
++#endif
+ 
+ // Contains logic for learning what can be prefetched and for kicking off
+ // speculative prefetching.

+ 1 - 1
patches/chromium/don_t_run_pcscan_notifythreadcreated_if_pcscan_is_disabled.patch

@@ -50,7 +50,7 @@ index 714232b0c2707d6c256e634ff784c18322bf0a85..48c8d0051c427954fe7265fee9cd0c6b
  #endif
  
 diff --git a/base/threading/platform_thread_win.cc b/base/threading/platform_thread_win.cc
-index 3327d353cd887d027cf1d9b483ebf6e6aaaef169..dab0d2cf3e87fc082f72f40d1d622efd390885d1 100644
+index 960d0100e1857592ee24b2da22e0253ab06098c1..dca9fb72fb69386ffb0910e13f841fa698250b66 100644
 --- a/base/threading/platform_thread_win.cc
 +++ b/base/threading/platform_thread_win.cc
 @@ -30,6 +30,7 @@

+ 2 - 2
patches/chromium/enable_reset_aspect_ratio.patch

@@ -19,10 +19,10 @@ index b6d243983474cfc2c314b555ccc1de4d833a7f00..2b1fa6a345247fdbb17bd2381ab9e74a
                                     aspect_ratio.height());
  }
 diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index fe882b31026b527df28d384e6e7e7cccaee61d61..82616ebcb1f56de12cbd932a4614bb3858e9bad9 100644
+index b0d12e9b64cc7aa5448e88f540e7a594fca3c80e..91e45df23e659d705839fa3798ad3452bac012e5 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -1002,8 +1002,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) {
+@@ -1003,8 +1003,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) {
  }
  
  void HWNDMessageHandler::SetAspectRatio(float aspect_ratio) {

+ 8 - 8
patches/chromium/expose_setuseragent_on_networkcontext.patch

@@ -33,7 +33,7 @@ index 14c71cc69388da46f62d9835e2a06fef0870da02..9481ea08401ae29ae9c1d960491b05b3
  
  }  // namespace net
 diff --git a/services/network/network_context.cc b/services/network/network_context.cc
-index 3e0ac81d77b3943a3021381e96f55059e4289a9b..ea7c2387bfc06d47cea6bd97d0b4b95f84811dde 100644
+index f25c1baa5142d53a882b864a67d94e9e0911f0bf..4dbbc74ddb359047f1dd9e158b8dcaf63bde3790 100644
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
 @@ -1412,6 +1412,13 @@ void NetworkContext::SetNetworkConditions(
@@ -51,22 +51,22 @@ index 3e0ac81d77b3943a3021381e96f55059e4289a9b..ea7c2387bfc06d47cea6bd97d0b4b95f
    // 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 07e6cb535bdc9fdc03ae8a115cc3b50d16d2c9b9..d4dd2699fa0876d374750135851e1e5325bf4e0d 100644
+index a9a1beed6c8e59abb9065701f34f155905781a2a..5ced53f2e875091cdaf6a38384de4f7890cd71e9 100644
 --- a/services/network/network_context.h
 +++ b/services/network/network_context.h
-@@ -296,6 +296,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -300,6 +300,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
    void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
                              mojom::NetworkConditionsPtr conditions) override;
 +  void SetUserAgent(const std::string& new_user_agent) override;
    void SetAcceptLanguage(const std::string& new_accept_language) override;
    void SetEnableReferrers(bool enable_referrers) override;
- #if BUILDFLAG(IS_CHROMEOS)
+   void SetEnablePreconnect(bool enable_preconnect) override;
 diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
-index bc63400c5143f13fa8108bc431e08e83725d3b0b..f995a7277f76e30309752e2c4c193529d3f603b3 100644
+index e47bbfac56cd6c787ba3e7c0518a5326386a19b6..105011c25861fe00cc8e72fe8f310ee5118725c3 100644
 --- a/services/network/public/mojom/network_context.mojom
 +++ b/services/network/public/mojom/network_context.mojom
-@@ -1103,6 +1103,9 @@ interface NetworkContext {
+@@ -1106,6 +1106,9 @@ interface NetworkContext {
    SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id,
                         NetworkConditions? conditions);
  
@@ -77,7 +77,7 @@ index bc63400c5143f13fa8108bc431e08e83725d3b0b..f995a7277f76e30309752e2c4c193529
    SetAcceptLanguage(string new_accept_language);
  
 diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h
-index 82edffa618da7e5954b0adeb4f933dfe4035b48a..92d3b15ff81eb2dbe9e7d1466fc4a18e6ee7916d 100644
+index 52f08526b9988beae7ec5b0fa44ced84d38f73ce..3f55bfcf0ed5dd83e73984cb3ba16cfa1fb7b685 100644
 --- a/services/network/test/test_network_context.h
 +++ b/services/network/test/test_network_context.h
 @@ -134,6 +134,7 @@ class TestNetworkContext : public mojom::NetworkContext {
@@ -87,4 +87,4 @@ index 82edffa618da7e5954b0adeb4f933dfe4035b48a..92d3b15ff81eb2dbe9e7d1466fc4a18e
 +  void SetUserAgent(const std::string& new_user_agent) override {}
    void SetAcceptLanguage(const std::string& new_accept_language) override {}
    void SetEnableReferrers(bool enable_referrers) override {}
- #if BUILDFLAG(IS_CHROMEOS)
+   void SetEnablePreconnect(bool enable_preconnect) override {}

+ 3 - 3
patches/chromium/extend_apply_webpreferences.patch

@@ -12,10 +12,10 @@ 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 38faafcc7432c2bedead647d4946b7183233b4bc..ff4fc53da0e14a58218c3cb39595b502b5d47996 100644
+index 40aa3b1a5c569e66b6f5d1630afe248c40d5715b..d61f63d5c16f3d93b301f1a338ae329b6f034753 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
-@@ -161,6 +161,7 @@
+@@ -164,6 +164,7 @@
  #include "third_party/blink/renderer/core/timing/window_performance.h"
  #include "third_party/blink/renderer/platform/fonts/font_cache.h"
  #include "third_party/blink/renderer/platform/fonts/generic_font_family_settings.h"
@@ -23,7 +23,7 @@ index 38faafcc7432c2bedead647d4946b7183233b4bc..ff4fc53da0e14a58218c3cb39595b502
  #include "third_party/blink/renderer/platform/graphics/image.h"
  #include "third_party/blink/renderer/platform/graphics/paint/cull_rect.h"
  #include "third_party/blink/renderer/platform/graphics/paint/paint_record_builder.h"
-@@ -1797,6 +1798,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
+@@ -1807,6 +1808,7 @@ void WebView::ApplyWebPreferences(const web_pref::WebPreferences& prefs,
  #if BUILDFLAG(IS_MAC)
    web_view_impl->SetMaximumLegibleScale(
        prefs.default_maximum_page_scale_factor);

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

@@ -13,11 +13,11 @@ other protocols to register their streaming behavior. MultibufferDataSource::Ass
 then refers to the list so that it can correctly determine the data source's settings.
 
 diff --git a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
-index 2879fec717b0b2bba66c599a063079b7ca8ce4b2..4bea0a1be7be5aa8c93a7a4d3cff0dc0ad1c2cd0 100644
+index c881e7951d10c48faac556661018423dff12b102..0f5408f3ddc65b856e62a05d3fe48a4397827cba 100644
 --- a/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
 +++ b/third_party/blink/renderer/platform/media/multi_buffer_data_source.cc
-@@ -10,8 +10,10 @@
- #include "base/callback_helpers.h"
+@@ -11,8 +11,10 @@
+ #include "base/containers/adapters.h"
  #include "base/cxx17_backports.h"
  #include "base/location.h"
 +#include "base/no_destructor.h"
@@ -27,7 +27,7 @@ index 2879fec717b0b2bba66c599a063079b7ca8ce4b2..4bea0a1be7be5aa8c93a7a4d3cff0dc0
  #include "media/base/media_log.h"
  #include "net/base/net_errors.h"
  #include "third_party/blink/renderer/platform/media/buffered_data_source_host_impl.h"
-@@ -60,8 +62,20 @@ const int kUpdateBufferSizeFrequency = 32;
+@@ -61,8 +63,20 @@ const int kUpdateBufferSizeFrequency = 32;
  // How long to we delay a seek after a read?
  constexpr base::TimeDelta kSeekDelay = base::Milliseconds(20);
  
@@ -48,7 +48,7 @@ index 2879fec717b0b2bba66c599a063079b7ca8ce4b2..4bea0a1be7be5aa8c93a7a4d3cff0dc0
  class MultiBufferDataSource::ReadOperation {
   public:
    ReadOperation() = delete;
-@@ -153,7 +167,14 @@ bool MultiBufferDataSource::media_has_played() const {
+@@ -154,7 +168,14 @@ bool MultiBufferDataSource::media_has_played() const {
  
  bool MultiBufferDataSource::AssumeFullyBuffered() const {
    DCHECK(url_data_);

+ 1 - 1
patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch

@@ -7,7 +7,7 @@ Subject: feat: allow embedders to add observers on created hunspell
 This patch is used by Electron to implement spellchecker events.
 
 diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc
-index db3c802746235c0dcfe7fe19ca4315ee77c96743..e9a7dfb8f3a4271d35ef1d33d2dd346c23d65b47 100644
+index bbc3ea681bfe0db0e122635db5442c447a30d387..26bc4ccfcc7583fd76cd290132b0729c1f01bae3 100644
 --- a/chrome/browser/spellchecker/spellcheck_service.cc
 +++ b/chrome/browser/spellchecker/spellcheck_service.cc
 @@ -467,6 +467,9 @@ void SpellcheckService::LoadDictionaries() {

+ 2 - 2
patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch

@@ -81,10 +81,10 @@ index 309422bcf85810db88a048bd0930c4072b41f234..759549f3046f4a897b597409b670bb1c
   private:
    const HWND hwnd_;
 diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
-index 90e1c4adeab61374adf9da5708497ea32a46c7f5..b812a22802c7c425ab259dfe5681cafe6ad758c8 100644
+index e3056ad83f954787f50c2507cb63659605c3dd3b..358eceadb8a3c2a6782f5fcd4b57630f87689c8b 100644
 --- a/components/viz/service/BUILD.gn
 +++ b/components/viz/service/BUILD.gn
-@@ -134,6 +134,8 @@ viz_component("service") {
+@@ -136,6 +136,8 @@ viz_component("service") {
      "display_embedder/skia_output_surface_impl_on_gpu.h",
      "display_embedder/skia_render_copy_results.cc",
      "display_embedder/skia_render_copy_results.h",

+ 2 - 2
patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch

@@ -103,7 +103,7 @@ index 3d2bcc3e81eb42f645fa4e8b1425cb5c54cfd3a1..4cdbe0e38609abfd0b0b5856deb8b2dd
    string mime_type;
  
 diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
-index bc7e0a4b2ae29ac40765a9339248d42d4d31713b..2e01e4898fd17cc96fab8c2a06d4d6aeacaf22f2 100644
+index 2e8a874bf93e03e7c194dc13555eead6fe1fcafa..5b28db971f8feebd36965ccafe8b1b957b3f1ede 100644
 --- a/services/network/url_loader.cc
 +++ b/services/network/url_loader.cc
 @@ -606,6 +606,7 @@ URLLoader::URLLoader(
@@ -123,7 +123,7 @@ index bc7e0a4b2ae29ac40765a9339248d42d4d31713b..2e01e4898fd17cc96fab8c2a06d4d6ae
      url_request_->SetResponseHeadersCallback(base::BindRepeating(
          &URLLoader::SetRawResponseHeaders, base::Unretained(this)));
    }
-@@ -1545,6 +1546,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
+@@ -1555,6 +1556,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) {
    }
  
    response_ = BuildResponseHead();

+ 2 - 2
patches/chromium/fix_allow_guest_webcontents_to_enter_fullscreen.patch

@@ -6,10 +6,10 @@ Subject: fix: allow guest webcontents to enter fullscreen
 This can be upstreamed, a guest webcontents can't technically become the focused webContents. This DCHECK should allow all guest webContents to request fullscreen entrance.
 
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 2a3c04df4f6f44d2cf75b661761c91d66cdc7ba4..fd6477ee04aee6a87dd33ea0e573eec3d7bba175 100644
+index 2aa24b773a974e7789c661a0ffa5e01715c6e229..74993d461cbd0885a709cf8b663b9c69650aa3cf 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -3453,7 +3453,7 @@ void WebContentsImpl::EnterFullscreenMode(
+@@ -3469,7 +3469,7 @@ void WebContentsImpl::EnterFullscreenMode(
    OPTIONAL_TRACE_EVENT0("content", "WebContentsImpl::EnterFullscreenMode");
    DCHECK(CanEnterFullscreenMode(requesting_frame, options));
    DCHECK(requesting_frame->IsActive());

+ 2 - 2
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 82616ebcb1f56de12cbd932a4614bb3858e9bad9..67871eec9821cf100acc719a1765be489dfbe7d8 100644
+index 91e45df23e659d705839fa3798ad3452bac012e5..2dbe61a4bdf6556f6db101e47d81d37417736bd1 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
-@@ -3702,6 +3702,21 @@ void HWNDMessageHandler::SizeWindowToAspectRatio(UINT param,
+@@ -3703,6 +3703,21 @@ 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);

+ 4 - 4
patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch

@@ -8,10 +8,10 @@ we invoke it in order to expose contents.decrementCapturerCount([stayHidden, sta
 to users. We should try to upstream this.
 
 diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
-index 864c0a9b7072b6c3ac6584ed35a833dd6afb9e34..214f387fa670926a4c14d39ed1be556c6935c90a 100644
+index 892efd5009b0a0ef00081bd765d20c46d68b2324..f40238dc39a017a07972c8fec48a802da8a2cad0 100644
 --- a/content/browser/web_contents/web_contents_impl.h
 +++ b/content/browser/web_contents/web_contents_impl.h
-@@ -1837,7 +1837,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
+@@ -1858,7 +1858,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
    // IncrementCapturerCount() is destructed.
    void DecrementCapturerCount(bool stay_hidden,
                                bool stay_awake,
@@ -21,10 +21,10 @@ index 864c0a9b7072b6c3ac6584ed35a833dd6afb9e34..214f387fa670926a4c14d39ed1be556c
    // Calculates the PageVisibilityState for |visibility|, taking the capturing
    // state into account.
 diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
-index f92bcc8f2a212e6cda464d9b6060a561d689f467..f9cb0eea11665148a4be669acaf5703cf9c0ea09 100644
+index a389a9c41f96ec3231b62510cde140c52dcdbe9e..25f7919970139baf58531a257f7a8c7184fef85a 100644
 --- a/content/public/browser/web_contents.h
 +++ b/content/public/browser/web_contents.h
-@@ -669,6 +669,10 @@ class WebContents : public PageNavigator,
+@@ -670,6 +670,10 @@ class WebContents : public PageNavigator,
        bool stay_awake,
        bool is_activity = true) = 0;
  

+ 31 - 32
patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch

@@ -7,11 +7,11 @@ This tweaks Chrome's Accessibility support at chrome://accessibility
 to make it usable from Electron by removing Profile references.
 
 diff --git a/chrome/browser/accessibility/accessibility_ui.cc b/chrome/browser/accessibility/accessibility_ui.cc
-index a1c0a809fee4ddbda55540139e866cfe494c5590..25888d4405b60925ef60726a0f486f6f21e88f30 100644
+index 28366584e6a3cc2655e5bc7417c4e52b9d0f4163..46894c02ca15f7091f280b2960f2ec628c500e53 100644
 --- a/chrome/browser/accessibility/accessibility_ui.cc
 +++ b/chrome/browser/accessibility/accessibility_ui.cc
-@@ -22,7 +22,10 @@
- #include "base/values.h"
+@@ -21,7 +21,10 @@
+ #include "base/trace_event/trace_event.h"
  #include "build/build_config.h"
  #include "build/chromeos_buildflags.h"
 +#if 0
@@ -21,7 +21,7 @@ index a1c0a809fee4ddbda55540139e866cfe494c5590..25888d4405b60925ef60726a0f486f6f
  #include "chrome/common/pref_names.h"
  #include "chrome/common/webui_url_constants.h"
  #include "chrome/grit/dev_ui_browser_resources.h"
-@@ -50,9 +53,11 @@
+@@ -49,9 +52,11 @@
  #include "ui/views/accessibility/view_accessibility.h"
  
  #if !BUILDFLAG(IS_ANDROID)
@@ -33,50 +33,49 @@ index a1c0a809fee4ddbda55540139e866cfe494c5590..25888d4405b60925ef60726a0f486f6f
  #include "ui/views/accessibility/widget_ax_tree_id_map.h"
  #include "ui/views/widget/widget.h"
  #include "ui/views/widget/widget_delegate.h"
-@@ -164,7 +169,7 @@ std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(
+@@ -162,7 +167,7 @@ base::Value::Dict BuildTargetDescriptor(content::RenderViewHost* rvh) {
                                 accessibility_mode);
  }
  
 -#if !BUILDFLAG(IS_ANDROID)
 +#if 0
- std::unique_ptr<base::DictionaryValue> BuildTargetDescriptor(Browser* browser) {
-   std::unique_ptr<base::DictionaryValue> target_data(
-       new base::DictionaryValue());
-@@ -203,7 +208,9 @@ void HandleAccessibilityRequestCallback(
+ base::Value::Dict BuildTargetDescriptor(Browser* browser) {
+   base::Value::Dict target_data;
+   target_data.Set(kSessionIdField, browser->session_id().id());
+@@ -196,7 +201,9 @@ void HandleAccessibilityRequestCallback(
    DCHECK(ShouldHandleAccessibilityRequestCallback(path));
  
-   base::DictionaryValue data;
+   base::Value::Dict data;
 +#if 0
    PrefService* pref = Profile::FromBrowserContext(current_context)->GetPrefs();
 +#endif
    ui::AXMode mode =
        content::BrowserAccessibilityState::GetInstance()->GetAccessibilityMode();
    bool is_native_enabled = content::BrowserAccessibilityState::GetInstance()
-@@ -237,7 +244,7 @@ void HandleAccessibilityRequestCallback(
-   data.SetBoolKey(kViewsAccessibility,
-                   features::IsAccessibilityTreeForViewsEnabled());
+@@ -228,7 +235,7 @@ void HandleAccessibilityRequestCallback(
+   // enabled.
+   data.Set(kViewsAccessibility, features::IsAccessibilityTreeForViewsEnabled());
  
 -  bool show_internal = pref->GetBoolean(prefs::kShowInternalAccessibilityTree);
 +  bool show_internal = true;
-   data.SetStringKey(kInternal, show_internal ? kOn : kOff);
+   data.Set(kInternal, show_internal ? kOn : kOff);
  
-   std::unique_ptr<base::ListValue> page_list(new base::ListValue());
-@@ -274,12 +281,12 @@ void HandleAccessibilityRequestCallback(
+   base::Value::List page_list;
+@@ -264,11 +271,11 @@ void HandleAccessibilityRequestCallback(
    data.Set(kPagesField, std::move(page_list));
  
-   std::unique_ptr<base::ListValue> browser_list(new base::ListValue());
+   base::Value::List browser_list;
 -#if !BUILDFLAG(IS_ANDROID)
 +#if 0
    for (Browser* browser : *BrowserList::GetInstance()) {
-     browser_list->Append(
-         base::Value::FromUniquePtrValue(BuildTargetDescriptor(browser)));
+     browser_list.Append(BuildTargetDescriptor(browser));
    }
 -#endif  // !BUILDFLAG(IS_ANDROID)
 +#endif // !BUILDFLAG(IS_ANDROID)
    data.Set(kBrowsersField, std::move(browser_list));
  
-   std::unique_ptr<base::ListValue> widgets_list(new base::ListValue());
-@@ -497,8 +504,10 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(
+   base::Value::List widgets_list;
+@@ -483,8 +490,10 @@ void AccessibilityUIMessageHandler::SetGlobalFlag(
  
    AllowJavascript();
    if (flag_name_str == kInternal) {
@@ -87,7 +86,7 @@ index a1c0a809fee4ddbda55540139e866cfe494c5590..25888d4405b60925ef60726a0f486f6f
      return;
    }
  
-@@ -605,10 +614,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
+@@ -588,10 +597,12 @@ void AccessibilityUIMessageHandler::RequestWebContentsTree(
                       AXPropertyFilter::ALLOW_EMPTY);
    AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
  
@@ -98,26 +97,26 @@ index a1c0a809fee4ddbda55540139e866cfe494c5590..25888d4405b60925ef60726a0f486f6f
    std::string accessibility_contents =
 -      web_contents->DumpAccessibilityTree(internal, property_filters);
 +      web_contents->DumpAccessibilityTree(true, property_filters);
-   result->SetStringKey(kTreeField, accessibility_contents);
-   FireWebUIListener(request_type, *(result.get()));
+   result.Set(kTreeField, accessibility_contents);
+   FireWebUIListener(request_type, result);
  }
-@@ -633,6 +644,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
+@@ -614,6 +625,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
                       AXPropertyFilter::ALLOW_EMPTY);
    AddPropertyFilters(property_filters, deny, AXPropertyFilter::DENY);
  
 +#if 0
    for (Browser* browser : *BrowserList::GetInstance()) {
      if (browser->session_id().id() == session_id) {
-       std::unique_ptr<base::DictionaryValue> result(
-@@ -647,6 +659,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
+       base::Value::Dict result = BuildTargetDescriptor(browser);
+@@ -626,6 +638,7 @@ void AccessibilityUIMessageHandler::RequestNativeUITree(
        return;
      }
    }
 +#endif
  #endif  // !BUILDFLAG(IS_ANDROID)
    // No browser with the specified |session_id| was found.
-   std::unique_ptr<base::DictionaryValue> result(new base::DictionaryValue());
-@@ -763,5 +776,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
+   base::Value::Dict result;
+@@ -738,5 +751,7 @@ void AccessibilityUIMessageHandler::RequestAccessibilityEvents(
  // static
  void AccessibilityUIMessageHandler::RegisterProfilePrefs(
      user_prefs::PrefRegistrySyncable* registry) {
@@ -126,10 +125,10 @@ index a1c0a809fee4ddbda55540139e866cfe494c5590..25888d4405b60925ef60726a0f486f6f
 +#endif
  }
 diff --git a/chrome/browser/accessibility/accessibility_ui.h b/chrome/browser/accessibility/accessibility_ui.h
-index 6bc5891205fc94377040d9195b0ee15a47a90382..16a25b6a5670a74cf260210b06bc9892431cd760 100644
+index 8ae101cdb4de8ea570e3af6e05e9124b51a9f14c..2706f8ad05a6bee71b68f59406eb0bd3391a3fcd 100644
 --- a/chrome/browser/accessibility/accessibility_ui.h
 +++ b/chrome/browser/accessibility/accessibility_ui.h
-@@ -25,6 +25,8 @@ struct AXEventNotificationDetails;
+@@ -22,6 +22,8 @@ struct AXEventNotificationDetails;
  class WebContents;
  }  // namespace content
  
@@ -138,7 +137,7 @@ index 6bc5891205fc94377040d9195b0ee15a47a90382..16a25b6a5670a74cf260210b06bc9892
  namespace user_prefs {
  class PrefRegistrySyncable;
  }  // namespace user_prefs
-@@ -66,6 +68,8 @@ class AccessibilityUIMessageHandler : public content::WebUIMessageHandler {
+@@ -63,6 +65,8 @@ class AccessibilityUIMessageHandler : public content::WebUIMessageHandler {
    static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
  
   private:

+ 198 - 0
patches/chromium/fix_return_v8_value_from_localframe_requestexecutescript.patch

@@ -0,0 +1,198 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Mon, 5 Sep 2022 19:07:54 +0900
+Subject: fix: return v8::Value from LocalFrame::RequestExecuteScript
+
+Allows api::WebFrame::ExecuteJavaScript(InIsolateWorld) to work with
+v8::Value instead of base::Value.
+Refs https://bugs.chromium.org/p/chromium/issues/detail?id=1323953
+
+diff --git a/extensions/renderer/script_injection.cc b/extensions/renderer/script_injection.cc
+index 032ef69a5b50cef88f341b8a7a3de0acef88898d..a425fe1fb6275afd8e25033932f6f444efd6f643 100644
+--- a/extensions/renderer/script_injection.cc
++++ b/extensions/renderer/script_injection.cc
+@@ -332,6 +332,7 @@ void ScriptInjection::InjectJs(std::set<std::string>* executing_scripts,
+       blink::mojom::LoadEventBlockingOption::kBlock,
+       base::BindOnce(&ScriptInjection::OnJsInjectionCompleted,
+                      weak_ptr_factory_.GetWeakPtr()),
++      base::NullCallback(),
+       blink::BackForwardCacheAware::kPossiblyDisallow,
+       injector_->ShouldWaitForPromise());
+ }
+diff --git a/third_party/blink/public/web/web_local_frame.h b/third_party/blink/public/web/web_local_frame.h
+index ba043cf658f568e4390db1619b1042749e430b2b..285d53074a0fcfb00caaec8c3f8a0bbebcd68953 100644
+--- a/third_party/blink/public/web/web_local_frame.h
++++ b/third_party/blink/public/web/web_local_frame.h
+@@ -424,6 +424,7 @@ class WebLocalFrame : public WebFrame {
+                                     mojom::EvaluationTiming,
+                                     mojom::LoadEventBlockingOption,
+                                     WebScriptExecutionCallback,
++                                    WebScriptExecutionCallbackUnmodified,
+                                     BackForwardCacheAware,
+                                     mojom::PromiseResultOption) = 0;
+ 
+diff --git a/third_party/blink/public/web/web_script_execution_callback.h b/third_party/blink/public/web/web_script_execution_callback.h
+index c37e7ef609c91e9b9107d7a6194b213039184fb9..3f2e27b4f51dc1d673883cf2bf75f596a952ac44 100644
+--- a/third_party/blink/public/web/web_script_execution_callback.h
++++ b/third_party/blink/public/web/web_script_execution_callback.h
+@@ -17,6 +17,12 @@ namespace base {
+ class TimeTicks;
+ }
+ 
++namespace v8 {
++class Value;
++template <class T>
++class Local;
++}
++
+ namespace blink {
+ 
+ template <typename T>
+@@ -26,6 +32,9 @@ using WebScriptExecutionCallback =
+     base::OnceCallback<void(const WebVector<v8::Local<v8::Value>>&,
+                             base::TimeTicks)>;
+ 
++using WebScriptExecutionCallbackUnmodified =
++    base::OnceCallback<void(const WebVector<v8::Local<v8::Value>>&)>;
++
+ }  // namespace blink
+ 
+ #endif  // THIRD_PARTY_BLINK_PUBLIC_WEB_WEB_SCRIPT_EXECUTION_CALLBACK_H_
+diff --git a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
+index 3891afe36284d033e3ba88ffda63545b07f6c718..69eb59439932887b34099f7cd3ebd51ecd4aa676 100644
+--- a/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
++++ b/third_party/blink/renderer/core/frame/local_frame_mojo_handler.cc
+@@ -1133,6 +1133,7 @@ void LocalFrameMojoHandler::JavaScriptExecuteRequestInIsolatedWorld(
+   auto* executor = MakeGarbageCollected<PausableScriptExecutor>(
+       DomWindow(), ToScriptState(frame_, *isolated_world),
+       execution_request->Callback(),
++      base::NullCallback(),
+       /*executor=*/execution_request);
+   executor->Run();
+ 
+diff --git a/third_party/blink/renderer/core/frame/pausable_script_executor.cc b/third_party/blink/renderer/core/frame/pausable_script_executor.cc
+index 4b2b8fc8e5b48948b36bfdc5b76ebeabe5c72606..90437b41b3e12309c194d9f3e94ac37603403227 100644
+--- a/third_party/blink/renderer/core/frame/pausable_script_executor.cc
++++ b/third_party/blink/renderer/core/frame/pausable_script_executor.cc
+@@ -262,7 +262,7 @@ void PausableScriptExecutor::CreateAndRun(LocalDOMWindow* window,
+   }
+   PausableScriptExecutor* executor =
+       MakeGarbageCollected<PausableScriptExecutor>(
+-          window, script_state, std::move(callback),
++          window, script_state, std::move(callback), base::NullCallback(),
+           MakeGarbageCollected<V8FunctionExecutor>(
+               window->GetIsolate(), function, receiver, argc, argv));
+   executor->Run();
+@@ -277,6 +277,14 @@ void PausableScriptExecutor::ContextDestroyed() {
+     ScriptState::Scope script_scope(script_state_);
+     std::move(callback_).Run(Vector<v8::Local<v8::Value>>(), {});
+   }
++  if (raw_callback_) {
++    // Though the context is (about to be) destroyed, the callback is invoked
++    // with a vector of v8::Local<>s, which implies that creating v8::Locals
++    // is permitted. Ensure a valid scope is present for the callback.
++    // See https://crbug.com/840719.
++    ScriptState::Scope script_scope(script_state_);
++    std::move(raw_callback_).Run(Vector<v8::Local<v8::Value>>());
++  }
+   Dispose();
+ }
+ 
+@@ -285,11 +293,12 @@ PausableScriptExecutor::PausableScriptExecutor(
+     scoped_refptr<DOMWrapperWorld> world,
+     Vector<WebScriptSource> sources,
+     mojom::blink::UserActivationOption user_gesture,
+-    WebScriptExecutionCallback callback)
++    WebScriptExecutionCallback callback,
++    WebScriptExecutionCallbackUnmodified raw_callback)
+     : PausableScriptExecutor(
+           window,
+           ToScriptState(window, *world),
+-          std::move(callback),
++          std::move(callback), std::move(raw_callback),
+           MakeGarbageCollected<WebScriptExecutor>(std::move(sources),
+                                                   world->GetWorldId(),
+                                                   user_gesture)) {}
+@@ -298,11 +307,12 @@ PausableScriptExecutor::PausableScriptExecutor(
+     LocalDOMWindow* window,
+     ScriptState* script_state,
+     WebScriptExecutionCallback callback,
++    WebScriptExecutionCallbackUnmodified raw_callback,
+     Executor* executor)
+     : ExecutionContextLifecycleObserver(window),
+       script_state_(script_state),
+       callback_(std::move(callback)),
+-      blocking_option_(mojom::blink::LoadEventBlockingOption::kDoNotBlock),
++      raw_callback_(std::move(raw_callback)),
+       executor_(executor) {
+   CHECK(script_state_);
+   CHECK(script_state_->ContextIsValid());
+@@ -388,6 +398,9 @@ void PausableScriptExecutor::HandleResults(
+   if (callback_)
+     std::move(callback_).Run(results, start_time_);
+ 
++  if (raw_callback_)
++    std::move(raw_callback_).Run(results);
++
+   Dispose();
+ }
+ 
+diff --git a/third_party/blink/renderer/core/frame/pausable_script_executor.h b/third_party/blink/renderer/core/frame/pausable_script_executor.h
+index 12a42ef52c2689a1c2d3029890fed8e12faa03aa..fe5bd4bee4f236f2958dcf03e1f644639afc4c75 100644
+--- a/third_party/blink/renderer/core/frame/pausable_script_executor.h
++++ b/third_party/blink/renderer/core/frame/pausable_script_executor.h
+@@ -48,10 +48,12 @@ class CORE_EXPORT PausableScriptExecutor final
+                          scoped_refptr<DOMWrapperWorld>,
+                          Vector<WebScriptSource>,
+                          mojom::blink::UserActivationOption,
+-                         WebScriptExecutionCallback);
++                         WebScriptExecutionCallback,
++                         WebScriptExecutionCallbackUnmodified);
+   PausableScriptExecutor(LocalDOMWindow*,
+                          ScriptState*,
+                          WebScriptExecutionCallback,
++                         WebScriptExecutionCallbackUnmodified,
+                          Executor*);
+   ~PausableScriptExecutor() override;
+ 
+@@ -75,6 +77,7 @@ class CORE_EXPORT PausableScriptExecutor final
+ 
+   Member<ScriptState> script_state_;
+   WebScriptExecutionCallback callback_;
++  WebScriptExecutionCallbackUnmodified raw_callback_;
+   base::TimeTicks start_time_;
+   mojom::blink::LoadEventBlockingOption blocking_option_;
+   TaskHandle task_handle_;
+diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+index a31fe747be3c228c4eec512835de6368d29516aa..4197391cb15a55eaca55eca2d3886ebcb8360e95 100644
+--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
++++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.cc
+@@ -1086,6 +1086,7 @@ void WebLocalFrameImpl::RequestExecuteScript(
+     mojom::blink::EvaluationTiming evaluation_timing,
+     mojom::blink::LoadEventBlockingOption blocking_option,
+     WebScriptExecutionCallback callback,
++    WebScriptExecutionCallbackUnmodified raw_callback,
+     BackForwardCacheAware back_forward_cache_aware,
+     mojom::blink::PromiseResultOption promise_behavior) {
+   DCHECK(GetFrame());
+@@ -1109,7 +1110,7 @@ void WebLocalFrameImpl::RequestExecuteScript(
+                         base::checked_cast<wtf_size_t>(sources.size()));
+   auto* executor = MakeGarbageCollected<PausableScriptExecutor>(
+       GetFrame()->DomWindow(), std::move(world), std::move(script_sources),
+-      user_gesture, std::move(callback));
++      user_gesture, std::move(callback), std::move(raw_callback));
+   executor->set_wait_for_promise(promise_behavior);
+   switch (evaluation_timing) {
+     case mojom::blink::EvaluationTiming::kAsynchronous:
+diff --git a/third_party/blink/renderer/core/frame/web_local_frame_impl.h b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+index 76cbde766ba8ebc1b503eea9a5b6335f775dc00c..ebb1084be8069251d8f568e7b9f30d3dc83b0a64 100644
+--- a/third_party/blink/renderer/core/frame/web_local_frame_impl.h
++++ b/third_party/blink/renderer/core/frame/web_local_frame_impl.h
+@@ -189,6 +189,7 @@ class CORE_EXPORT WebLocalFrameImpl final
+                             mojom::blink::EvaluationTiming,
+                             mojom::blink::LoadEventBlockingOption,
+                             WebScriptExecutionCallback,
++                            WebScriptExecutionCallbackUnmodified,
+                             BackForwardCacheAware back_forward_cache_aware,
+                             mojom::blink::PromiseResultOption) override;
+   void Alert(const WebString& message) override;

+ 3 - 3
patches/chromium/fix_revert_emulationhandler_update_functions_to_early_return.patch

@@ -18,10 +18,10 @@ fix this, we revert those state update calls to early returns.
 Upstreamed at https://chromium-review.googlesource.com/c/chromium/src/+/3856525
 
 diff --git a/content/browser/devtools/protocol/emulation_handler.cc b/content/browser/devtools/protocol/emulation_handler.cc
-index 84736afeb21d1deec0f4032ef6f3304075d8fffb..d023bb7b5a34c5c055d3d7cc5dc3e04ef43bcc3b 100644
+index 90c7fbebfcedd744163f8294be6de99db7b54aef..5c507f3aa02d918fc9c87ed3842f282f4545f0ff 100644
 --- a/content/browser/devtools/protocol/emulation_handler.cc
 +++ b/content/browser/devtools/protocol/emulation_handler.cc
-@@ -565,7 +565,9 @@ WebContentsImpl* EmulationHandler::GetWebContents() {
+@@ -588,7 +588,9 @@ WebContentsImpl* EmulationHandler::GetWebContents() {
  }
  
  void EmulationHandler::UpdateTouchEventEmulationState() {
@@ -32,7 +32,7 @@ index 84736afeb21d1deec0f4032ef6f3304075d8fffb..d023bb7b5a34c5c055d3d7cc5dc3e04e
    // We only have a single TouchEmulator for all frames, so let the main frame's
    // EmulationHandler enable/disable it.
    DCHECK(!host_->GetParentOrOuterDocument());
-@@ -585,7 +587,9 @@ void EmulationHandler::UpdateTouchEventEmulationState() {
+@@ -608,7 +610,9 @@ void EmulationHandler::UpdateTouchEventEmulationState() {
  }
  
  void EmulationHandler::UpdateDeviceEmulationState() {

+ 47 - 0
patches/chromium/fix_the_gn_gen_for_components_segmentation_platform.patch

@@ -0,0 +1,47 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Adam Kallai <[email protected]>
+Date: Mon, 22 Aug 2022 20:35:17 +0000
+Subject: Fix the gn gen for components/segmentation_platform
+
+'optimization_guide_segmentation_handler' dependency only available if
+the 'build_with_tflite_lib' condition is set.
+
+Change-Id: I4d13e1f17caaaa744b3c95e425466cf851edf613
+
+Bug: 1355185
+Change-Id: I4d13e1f17caaaa744b3c95e425466cf851edf613
+Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3845194
+Reviewed-by: Siddhartha S <[email protected]>
+Commit-Queue: Siddhartha S <[email protected]>
+Cr-Commit-Position: refs/heads/main@{#1037919}
+(cherry picked from commit 9352250ae5e5589a7484873d7efe66d708ba6ad6)
+
+diff --git a/components/segmentation_platform/embedder/BUILD.gn b/components/segmentation_platform/embedder/BUILD.gn
+index 385ab7e469f4e0c02500295edc7f24cedaf0ac6b..9bbac1528bcf0c7c1589c4962bee0ff9c5febaf7 100644
+--- a/components/segmentation_platform/embedder/BUILD.gn
++++ b/components/segmentation_platform/embedder/BUILD.gn
+@@ -2,6 +2,8 @@
+ # Use of this source code is governed by a BSD-style license that can be
+ # found in the LICENSE file.
+ 
++import("//components/optimization_guide/features.gni")
++
+ if (is_android) {
+   import("//build/config/android/config.gni")
+   import("//build/config/android/rules.gni")
+@@ -21,11 +23,14 @@ source_set("embedder") {
+     "//components/optimization_guide/core",
+     "//components/optimization_guide/core:features",
+     "//components/segmentation_platform/internal",
+-    "//components/segmentation_platform/internal:optimization_guide_segmentation_handler",
+     "//components/segmentation_platform/internal/proto",
+     "//components/segmentation_platform/public",
+     "//url",
+   ]
++
++  if (build_with_tflite_lib) {
++    deps += [ "//components/segmentation_platform/internal:optimization_guide_segmentation_handler" ]
++  }
+ }
+ 
+ source_set("unit_tests") {

+ 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 2ade1a0771a8f9c3c790492aadbd711b97a4613c..4a5f3bf210869e55dbc735b70b5d27548f6b62a7 100644
+index 569297aab0b4187afde801643957949216404082..a1e332ae2bcf2027019261e38bb82c8446e014d1 100644
 --- a/content/browser/renderer_host/render_frame_host_manager.cc
 +++ b/content/browser/renderer_host/render_frame_host_manager.cc
-@@ -3271,6 +3271,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
+@@ -3270,6 +3270,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
      request->ResetStateForSiteInstanceChange();
    }
  
@@ -20,10 +20,10 @@ index 2ade1a0771a8f9c3c790492aadbd711b97a4613c..4a5f3bf210869e55dbc735b70b5d2754
  }
  
 diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
-index f399bc59be5705542b34185e7fe7202a029c40ea..3293b6e035a6ea182504aa2700866fea8c213f4c 100644
+index 7eb47e0c73c7f0d8a0cadcf5b8163f8a5154faea..a699439c45bcfce66b697e2a97e6d1ae408cd343 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -270,6 +270,11 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -271,6 +271,11 @@ class CONTENT_EXPORT ContentBrowserClient {
  
    virtual ~ContentBrowserClient() = default;
  

+ 3 - 3
patches/chromium/gin_enable_disable_v8_platform.patch

@@ -38,10 +38,10 @@ index d7739924bc3c3daec848db52730bd60c72ff2d8a..78af701cb06f6cb1bdd9829b2fcc46c8
    // 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 ab2affbcab0ca7eea0b908fd1dd75f36ef095385..952b3ba6247935053d9a080bced30e3b3c640dd4 100644
+index cb3302bb2abb735609436bdf2a5d4d51cc4258ad..5530d975303cc96701e4b70ffbcaf6e7c02bb016 100644
 --- a/gin/v8_initializer.cc
 +++ b/gin/v8_initializer.cc
-@@ -362,7 +362,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
+@@ -368,7 +368,8 @@ void SetFlags(IsolateHolder::ScriptMode mode,
  // static
  void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
                                 const std::string js_command_line_flags,
@@ -51,7 +51,7 @@ index ab2affbcab0ca7eea0b908fd1dd75f36ef095385..952b3ba6247935053d9a080bced30e3b
    static bool v8_is_initialized = false;
    if (v8_is_initialized)
      return;
-@@ -372,7 +373,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
+@@ -378,7 +379,8 @@ void V8Initializer::Initialize(IsolateHolder::ScriptMode mode,
    // See https://crbug.com/v8/11043
    SetFlags(mode, js_command_line_flags);
  

+ 5 - 5
patches/chromium/gpu_notify_when_dxdiag_request_fails.patch

@@ -12,7 +12,7 @@ rendering and there is no signal from browser process on this event
 to identify it.
 
 diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
-index 650a9128d26ac6a745abfdaca93d21f19e60343a..9ccc48f79e9fe9541f9fcd7063b1f58ef31931ae 100644
+index 54cc8dc51d400a5738c7e3d63e6f368bead2a021..182ef4fde23a6afe2e9d8a8f02d8ccf6161c633e 100644
 --- a/content/browser/gpu/gpu_data_manager_impl.cc
 +++ b/content/browser/gpu/gpu_data_manager_impl.cc
 @@ -230,6 +230,11 @@ void GpuDataManagerImpl::TerminateInfoCollectionGpuProcess() {
@@ -28,7 +28,7 @@ index 650a9128d26ac6a745abfdaca93d21f19e60343a..9ccc48f79e9fe9541f9fcd7063b1f58e
  
  void GpuDataManagerImpl::UpdateDawnInfo(
 diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
-index 9f2b350bc160e01ae39becd405e8a7d99a9a8ec1..3601121e3290b7b3a71041ede93d8fb00a156332 100644
+index 1fc56c055d423ab074f8f4f90415e34593a04a18..c637247f003e1c6bfe073a43a09851682cd242cc 100644
 --- a/content/browser/gpu/gpu_data_manager_impl.h
 +++ b/content/browser/gpu/gpu_data_manager_impl.h
 @@ -125,6 +125,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
@@ -40,10 +40,10 @@ index 9f2b350bc160e01ae39becd405e8a7d99a9a8ec1..3601121e3290b7b3a71041ede93d8fb0
    void UpdateDawnInfo(const std::vector<std::string>& dawn_info_list);
  
 diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
-index 855bd71694c21353337090d049dfcfa20ebccea4..dbd0636107b1e66cb7993e29b8ed0e7f0c91ee61 100644
+index 526b9768da187b0f7d94b3500a63af8242d568af..01faafb23559dd13f5a770c1dd3864a2ea858321 100644
 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
 +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
-@@ -1209,6 +1209,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
+@@ -1199,6 +1199,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
    if (host)
      host->ForceShutdown();
  }
@@ -57,7 +57,7 @@ index 855bd71694c21353337090d049dfcfa20ebccea4..dbd0636107b1e66cb7993e29b8ed0e7f
  
  void GpuDataManagerImplPrivate::UpdateDawnInfo(
 diff --git a/content/browser/gpu/gpu_data_manager_impl_private.h b/content/browser/gpu/gpu_data_manager_impl_private.h
-index 1aff605f7c126104edc9e74adc80d56344177a80..93e589d1ede1fb33dde3b099d04540fef777e182 100644
+index af6dd8d8af99c5bd1e854c8cfbeb89e04476fefd..758adb66dff5aefad9f3c9f8c23de6fa9df33ef7 100644
 --- a/content/browser/gpu/gpu_data_manager_impl_private.h
 +++ b/content/browser/gpu/gpu_data_manager_impl_private.h
 @@ -87,6 +87,7 @@ class CONTENT_EXPORT GpuDataManagerImplPrivate {

+ 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 1bc95f7cab225ff4ff5d9819fa07d8a8cf7d9f9c..3631ccc4e41db1b6c9d3873f52cc3ff708b18d68 100644
+index d9ae17943b8fcfaa6026869328e60c8cc4057425..7d97829b1a0d2589607eb696bdde1fa72cc09424 100644
 --- a/tools/gritsettings/resource_ids.spec
 +++ b/tools/gritsettings/resource_ids.spec
-@@ -975,6 +975,11 @@
+@@ -984,6 +984,11 @@
      "includes": [4960],
    },
  

+ 2 - 2
patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch

@@ -11,10 +11,10 @@ If removing this patch causes no sync failures, it's safe to delete :+1:
 Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903
 
 diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py
-index f25be7d134b65a6caf65241a78111de145727fcd..4fcbd6e5fd6e0d692c3bad4232b37d2a95a7073f 100755
+index c8703580d32010666d81fc28ea7325ef0b292fec..a8c9e3af875586d041d58d6d70b5b81092139eed 100755
 --- a/tools/clang/scripts/update.py
 +++ b/tools/clang/scripts/update.py
-@@ -302,6 +302,8 @@ def GetDefaultHostOs():
+@@ -307,6 +307,8 @@ def GetDefaultHostOs():
        'win32': 'win',
    }
    default_host_os = _PLATFORM_HOST_OS_MAP.get(sys.platform, sys.platform)

+ 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 ed19f7f1a283da619c01e2dc476d9d1ace950dc7..ef51df5e85584329c9c02aa2b6b88ba9eadd1a31 100644
+index fb4af331fb38b9e431137fd2b3806be84175acbf..14ca983c91cfe495ebd2859866a7f434d0a9ab02 100644
 --- a/content/app/content_main_runner_impl.cc
 +++ b/content/app/content_main_runner_impl.cc
-@@ -251,11 +251,8 @@ void LoadV8SnapshotFile(const base::CommandLine& command_line) {
+@@ -253,11 +253,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 b54d534b4d408c30341b20409fec75d3a66ca519..d0a00518d06bbb0da228662924b2ab9e568ef940 100644
+index 34cbeddf6cabd78806304e45e25074d5d2ccd51e..db66cfa6313e805e91d9dbb189ae10b02792a112 100644
 --- a/content/app/content_main.cc
 +++ b/content/app/content_main.cc
-@@ -386,8 +386,12 @@ RunContentProcess(ContentMainParams params,
+@@ -413,8 +413,12 @@ RunContentProcess(ContentMainParams params,
  
  #if BUILDFLAG(IS_WIN)
      // Route stdio to parent console (if any) or create one.

+ 7 - 7
patches/chromium/mas_disable_custom_window_frame.patch

@@ -75,7 +75,7 @@ index 8416c7c6e052dafb2aad61c0bd3224c36e945d23..cd356beda023ab2409b16d58ca38c70b
 +
  @end
 diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
-index 77662e89cf2c6135b99b3905c20456f4da0a6e09..fea78cc7fa195f44d88ec08a027b8e90209ee47c 100644
+index cfbb9f03214084c5181e48e1b0d497ab0b5cf1b3..21fdd6e2e9fae08443ca74c49c1b6984ea0c3429 100644
 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
 +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.h
 @@ -17,6 +17,7 @@ class NativeWidgetNSWindowBridge;
@@ -95,10 +95,10 @@ index 77662e89cf2c6135b99b3905c20456f4da0a6e09..fea78cc7fa195f44d88ec08a027b8e90
  // The NSWindow used by BridgedNativeWidget. Provides hooks into AppKit that
  // can only be accomplished by overriding methods.
 diff --git a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
-index 18c63a44773700852365c508ee222232d0e5c8ec..8c644c4e16ce2305719caaa7d67dc583513ea8ec 100644
+index 8ffa07e273fc65d8d29e119bb7dd4114b5eba6f4..60de405c461ec05a7036025553b82dd18f2acd13 100644
 --- a/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
 +++ b/components/remote_cocoa/app_shim/native_widget_mac_nswindow.mm
-@@ -77,7 +77,9 @@ void OrderChildWindow(NSWindow* child_window,
+@@ -78,7 +78,9 @@ void OrderChildWindow(NSWindow* child_window,
  }  // namespace
  
  @interface NSWindow (Private)
@@ -108,7 +108,7 @@ index 18c63a44773700852365c508ee222232d0e5c8ec..8c644c4e16ce2305719caaa7d67dc583
  - (BOOL)hasKeyAppearance;
  - (long long)_resizeDirectionForMouseLocation:(CGPoint)location;
  - (BOOL)_isConsideredOpenForPersistentState;
-@@ -109,6 +111,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event {
+@@ -110,6 +112,8 @@ - (void)cr_mouseDownOnFrameView:(NSEvent*)event {
  }
  @end
  
@@ -117,7 +117,7 @@ index 18c63a44773700852365c508ee222232d0e5c8ec..8c644c4e16ce2305719caaa7d67dc583
  @implementation NativeWidgetMacNSWindowTitledFrame
  - (void)mouseDown:(NSEvent*)event {
    if (self.window.isMovable)
-@@ -135,6 +139,8 @@ - (BOOL)usesCustomDrawing {
+@@ -136,6 +140,8 @@ - (BOOL)usesCustomDrawing {
  }
  @end
  
@@ -126,7 +126,7 @@ index 18c63a44773700852365c508ee222232d0e5c8ec..8c644c4e16ce2305719caaa7d67dc583
  @implementation NativeWidgetMacNSWindow {
   @private
    base::scoped_nsobject<CommandDispatcher> _commandDispatcher;
-@@ -287,6 +293,8 @@ - (NSAccessibilityRole)accessibilityRole {
+@@ -285,6 +291,8 @@ - (NSAccessibilityRole)accessibilityRole {
  
  // NSWindow overrides.
  
@@ -135,7 +135,7 @@ index 18c63a44773700852365c508ee222232d0e5c8ec..8c644c4e16ce2305719caaa7d67dc583
  + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
    if (windowStyle & NSWindowStyleMaskTitled) {
      if (Class customFrame = [NativeWidgetMacNSWindowTitledFrame class])
-@@ -298,6 +306,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
+@@ -296,6 +304,8 @@ + (Class)frameViewClassForStyleMask:(NSWindowStyleMask)windowStyle {
    return [super frameViewClassForStyleMask:windowStyle];
  }
  

+ 17 - 17
patches/chromium/mas_disable_remote_accessibility.patch

@@ -44,7 +44,7 @@ index 306db835fe203f663b1d84dd3490b619eb3f60b2..7a41d7afe6197e0a78934206782b1063
  
  }  // namespace
 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 c8a108cd8d39bf5185db438092579f67d31938f1..7ceaca262d71b1738d1dc92421db5e94494d5a97 100644
+index 378cb463ff2ad323fe413d5ef40d6bd48659a5df..686527e081f1dc9bfa3cd8313ef818a05a4e5bfb 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
 @@ -583,10 +583,12 @@ NSUInteger CountBridgedWindows(NSArray* child_windows) {
@@ -61,10 +61,10 @@ index c8a108cd8d39bf5185db438092579f67d31938f1..7ceaca262d71b1738d1dc92421db5e94
    // Beware: This view was briefly removed (in favor of a bare CALayer) in
    // crrev/c/1236675. The ordering of unassociated layers relative to NSView
 diff --git a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
-index d6d48ab183ee32edc8c9c984673e050a2557950d..0022095c7ae81197ef5cdeddc62d8550fb973e03 100644
+index be7b05ee4f779ccc44e6eea7ff7fb3e8bd504d6f..3b3336913cf91c3b7f22cefb4139f82b882c97c9 100644
 --- a/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
 +++ b/content/app_shim_remote_cocoa/ns_view_bridge_factory_impl.mm
-@@ -76,8 +76,10 @@ id GetFocusedBrowserAccessibilityElement() override {
+@@ -77,8 +77,10 @@ id GetFocusedBrowserAccessibilityElement() override {
      return nil;
    }
    void SetAccessibilityWindow(NSWindow* window) override {
@@ -75,7 +75,7 @@ index d6d48ab183ee32edc8c9c984673e050a2557950d..0022095c7ae81197ef5cdeddc62d8550
    }
  
    void ForwardKeyboardEvent(const content::NativeWebKeyboardEvent& key_event,
-@@ -139,8 +141,10 @@ void SmartMagnify(const blink::WebGestureEvent& web_event) override {
+@@ -140,8 +142,10 @@ void SmartMagnify(const blink::WebGestureEvent& web_event) override {
  
    mojo::AssociatedRemote<mojom::RenderWidgetHostNSViewHost> host_;
    std::unique_ptr<RenderWidgetHostNSViewBridge> bridge_;
@@ -117,10 +117,10 @@ index 6c0700b182e9765afd60d8deec501d13432e1b0a..c85c024a5a5711471e24698f14dda21b
    return false;
  }
 diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h
-index a27ce05f20a8d645688c5bb920d36e76901e2b37..cb4238fe7d5f2d182c742532cf467880db7b309e 100644
+index 0549e3b400cb42e1a3491a2de9739c275ae006df..ab59ea7211b425e36d3d0fa673d8c09b99140716 100644
 --- a/content/browser/renderer_host/render_widget_host_view_mac.h
 +++ b/content/browser/renderer_host/render_widget_host_view_mac.h
-@@ -51,7 +51,9 @@ class ScopedPasswordInputEnabler;
+@@ -52,7 +52,9 @@ class ScopedPasswordInputEnabler;
  
  @protocol RenderWidgetHostViewMacDelegate;
  
@@ -130,7 +130,7 @@ index a27ce05f20a8d645688c5bb920d36e76901e2b37..cb4238fe7d5f2d182c742532cf467880
  @class RenderWidgetHostViewCocoa;
  
  namespace content {
-@@ -665,10 +667,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
+@@ -668,10 +670,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac
    // EnsureSurfaceSynchronizedForWebTest().
    uint32_t latest_capture_sequence_number_ = 0u;
  
@@ -144,10 +144,10 @@ index a27ce05f20a8d645688c5bb920d36e76901e2b37..cb4238fe7d5f2d182c742532cf467880
    // 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 9c42f305d30b1f1cafd72fd7326894819fa57ee7..54681d4aaaa52ee07fba0055a8411b8e19b4cc8c 100644
+index d460e055c8bc70845cdf89567e17a79da70fd9f1..f28dcfe0721239ca9341a0db80e8626a515c34d8 100644
 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
 +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
-@@ -258,8 +258,10 @@
+@@ -259,8 +259,10 @@
  void RenderWidgetHostViewMac::MigrateNSViewBridge(
      remote_cocoa::mojom::Application* remote_cocoa_application,
      uint64_t parent_ns_view_id) {
@@ -158,7 +158,7 @@ index 9c42f305d30b1f1cafd72fd7326894819fa57ee7..54681d4aaaa52ee07fba0055a8411b8e
  
    // Disconnect from the previous bridge (this will have the effect of
    // destroying the associated bridge), and close the receiver (to allow it
-@@ -1559,8 +1561,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
+@@ -1561,8 +1563,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
  
  gfx::NativeViewAccessible
  RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() {
@@ -169,7 +169,7 @@ index 9c42f305d30b1f1cafd72fd7326894819fa57ee7..54681d4aaaa52ee07fba0055a8411b8e
    return [GetInProcessNSView() window];
  }
  
-@@ -1604,9 +1608,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
+@@ -1606,9 +1610,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
  }
  
  void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) {
@@ -181,7 +181,7 @@ index 9c42f305d30b1f1cafd72fd7326894819fa57ee7..54681d4aaaa52ee07fba0055a8411b8e
  }
  
  bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame(
-@@ -2101,12 +2107,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
+@@ -2103,12 +2109,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback,
  
  void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken(
      const std::vector<uint8_t>& window_token) {
@@ -235,7 +235,7 @@ index e7adfee3210ec723c687adfcc4bee8827ef643e7..25a924a47eeb30d783ef83dbb4896c4b
 +
  #endif  // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_
 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 fc847f1ae010e4e0d69836f16d83515b8a92073a..a4bebe5078ace6c49cb34912813bbaf76b43b00c 100644
+index 5a09100094d0371a3e58db6c7626e06bdcdd17c3..1aa7bde93efdf198998ba4e6a97dcf2aadd9f4e9 100644
 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.h
 +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h
 @@ -32,7 +32,9 @@
@@ -248,7 +248,7 @@ index fc847f1ae010e4e0d69836f16d83515b8a92073a..a4bebe5078ace6c49cb34912813bbaf7
  @class NSView;
  
  namespace remote_cocoa {
-@@ -447,11 +449,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
+@@ -449,11 +451,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost
    mojo::AssociatedRemote<remote_cocoa::mojom::NativeWidgetNSWindow>
        remote_ns_window_remote_;
  
@@ -263,7 +263,7 @@ index fc847f1ae010e4e0d69836f16d83515b8a92073a..a4bebe5078ace6c49cb34912813bbaf7
    // 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 eaca66e6c854cf7c2ba57a988080d2dee03d08e7..88e75e76cc4accacfbe4e8a2a1934372424d0eb8 100644
+index cdaf472a02038e1fbcb15747dd1992e2ea0e998b..a9cb80cf7f3631eab7d0fcbcf685ee88af6d8972 100644
 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.mm
 +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.mm
 @@ -325,14 +325,22 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
@@ -289,7 +289,7 @@ index eaca66e6c854cf7c2ba57a988080d2dee03d08e7..88e75e76cc4accacfbe4e8a2a1934372
  }
  
  remote_cocoa::mojom::NativeWidgetNSWindow*
-@@ -1289,6 +1297,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
+@@ -1304,6 +1312,7 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
  void NativeWidgetMacNSWindowHost::SetRemoteAccessibilityTokens(
      const std::vector<uint8_t>& window_token,
      const std::vector<uint8_t>& view_token) {
@@ -297,7 +297,7 @@ index eaca66e6c854cf7c2ba57a988080d2dee03d08e7..88e75e76cc4accacfbe4e8a2a1934372
    remote_window_accessible_ =
        ui::RemoteAccessibility::GetRemoteElementFromToken(window_token);
    remote_view_accessible_ =
-@@ -1296,14 +1305,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
+@@ -1311,14 +1320,17 @@ void HandleAccelerator(const ui::Accelerator& accelerator,
    [remote_view_accessible_ setWindowUIElement:remote_window_accessible_.get()];
    [remote_view_accessible_
        setTopLevelUIElement:remote_window_accessible_.get()];

+ 1 - 1
patches/chromium/mas_no_private_api.patch

@@ -166,7 +166,7 @@ index 69e60d498941c34cfac9e79c7517765bf93849f5..b998ad7cf01c21e93c57e1283cfdcb1e
  
  void BluetoothAdapterMac::RemovePairingDelegateInternal(
 diff --git a/media/audio/BUILD.gn b/media/audio/BUILD.gn
-index 2a9cf9620bcc4453a24d48037f0092b6f270806a..6182aac37a7153b9a193565253fe77f9b72db55f 100644
+index d872796dee0dee4aa14c238f788b962b3f1c9311..4d5f74c18d773755d5d8f7223bc0d5c944467d69 100644
 --- a/media/audio/BUILD.gn
 +++ b/media/audio/BUILD.gn
 @@ -176,6 +176,12 @@ source_set("audio") {

+ 7 - 7
patches/chromium/network_service_allow_remote_certificate_verification_logic.patch

@@ -7,7 +7,7 @@ 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 33264a4ec00f67345bccbd59c042235a65fdded1..3e0ac81d77b3943a3021381e96f55059e4289a9b 100644
+index 3ee7e8145e8cd0a68680e2044f0fb44d314a4317..f25c1baa5142d53a882b864a67d94e9e0911f0bf 100644
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
 @@ -130,6 +130,11 @@
@@ -128,7 +128,7 @@ index 33264a4ec00f67345bccbd59c042235a65fdded1..3e0ac81d77b3943a3021381e96f55059
  void NetworkContext::CreateURLLoaderFactory(
      mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
      mojom::URLLoaderFactoryParamsPtr params) {
-@@ -2320,6 +2417,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
+@@ -2324,6 +2421,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
          std::move(cert_verifier));
      cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_.get());
  #endif  // BUILDFLAG(IS_CHROMEOS)
@@ -139,7 +139,7 @@ index 33264a4ec00f67345bccbd59c042235a65fdded1..3e0ac81d77b3943a3021381e96f55059
  
    builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier(
 diff --git a/services/network/network_context.h b/services/network/network_context.h
-index fe906c8374fee5a4afdd193b8d4a2462c28ce835..07e6cb535bdc9fdc03ae8a115cc3b50d16d2c9b9 100644
+index cc1c9079baed00f6327efe929ab9d004d2272cfb..a9a1beed6c8e59abb9065701f34f155905781a2a 100644
 --- a/services/network/network_context.h
 +++ b/services/network/network_context.h
 @@ -104,6 +104,7 @@ class URLMatcher;
@@ -150,7 +150,7 @@ index fe906c8374fee5a4afdd193b8d4a2462c28ce835..07e6cb535bdc9fdc03ae8a115cc3b50d
  class CookieManager;
  class ExpectCTReporter;
  class HostResolver;
-@@ -236,6 +237,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -240,6 +241,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    void CreateURLLoaderFactory(
        mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
        mojom::URLLoaderFactoryParamsPtr params) override;
@@ -159,7 +159,7 @@ index fe906c8374fee5a4afdd193b8d4a2462c28ce835..07e6cb535bdc9fdc03ae8a115cc3b50d
    void ResetURLLoaderFactories() override;
    void GetCookieManager(
        mojo::PendingReceiver<mojom::CookieManager> receiver) override;
-@@ -822,6 +825,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -827,6 +830,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    std::vector<base::OnceClosure> dismount_closures_;
  #endif  // BUILDFLAG(IS_DIRECTORY_TRANSFER_REQUIRED)
  
@@ -169,7 +169,7 @@ index fe906c8374fee5a4afdd193b8d4a2462c28ce835..07e6cb535bdc9fdc03ae8a115cc3b50d
    // CertNetFetcher is not used by the current platform, or if the actual
    // net::CertVerifier is instantiated outside of the network service.
 diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom
-index 99cd0107ab918600970055a542cb753b24264cba..bc63400c5143f13fa8108bc431e08e83725d3b0b 100644
+index e4eec4dde27862507252d6853ec3186400181c95..e47bbfac56cd6c787ba3e7c0518a5326386a19b6 100644
 --- a/services/network/public/mojom/network_context.mojom
 +++ b/services/network/public/mojom/network_context.mojom
 @@ -283,6 +283,17 @@ struct NetworkContextFilePaths {
@@ -190,7 +190,7 @@ index 99cd0107ab918600970055a542cb753b24264cba..bc63400c5143f13fa8108bc431e08e83
  // Parameters for constructing a network context.
  struct NetworkContextParams {
    // The user agent string.
-@@ -848,6 +859,9 @@ interface NetworkContext {
+@@ -851,6 +862,9 @@ interface NetworkContext {
    // Sets a client for this network context.
    SetClient(pending_remote<NetworkContextClient> client);
  

+ 6 - 6
patches/chromium/notification_provenance.patch

@@ -91,10 +91,10 @@ index 41fb02d532190e82d50286e2733a6c3627bf25c8..f19bb5dcb69233733125029d8f997f73
          /*weak_document_ptr=*/WeakDocumentPtr(),
          notification_service_remote_.BindNewPipeAndPassReceiver());
 diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc
-index 61ac1d7760432bd1a4118c0929a35168a3e26f49..e2ce4aa910053b1a4fb52fcc1197943af95b02f6 100644
+index fdd74853b9b277d9b47fb99311349b66f70dfa11..06d1f5a8cc7f0ff12e4a7d66b435a19369af126b 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() {
+@@ -283,6 +283,7 @@ void PlatformNotificationContextImpl::Shutdown() {
  
  void PlatformNotificationContextImpl::CreateService(
      RenderProcessHost* render_process_host,
@@ -102,7 +102,7 @@ index 61ac1d7760432bd1a4118c0929a35168a3e26f49..e2ce4aa910053b1a4fb52fcc1197943a
      const url::Origin& origin,
      const GURL& document_url,
      const WeakDocumentPtr& weak_document_ptr,
-@@ -289,7 +290,8 @@ void PlatformNotificationContextImpl::CreateService(
+@@ -290,7 +291,8 @@ 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 424fae79eb1c93f1fac293ae8fdeb6d067f523cc..6a2f074ad981deb15b46bd91b6d7eb5d
        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 f4d1b2317145ecd14b58bd52cff9de0645b37044..d2fbb44deef7a63cc1f5296d338d518bccab6a7c 100644
+index 18ad9b07e8d6ce33e4f5497aed48269ea49e2b9e..161aefa1d91923be35046dfe735071c687710deb 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -2073,8 +2073,9 @@ void RenderProcessHostImpl::CreateNotificationService(
+@@ -2075,8 +2075,9 @@ void RenderProcessHostImpl::CreateNotificationService(
    // For workers:
    if (render_frame_id == MSG_ROUTING_NONE) {
      storage_partition_impl_->GetPlatformNotificationContext()->CreateService(
@@ -148,7 +148,7 @@ index f4d1b2317145ecd14b58bd52cff9de0645b37044..d2fbb44deef7a63cc1f5296d338d518b
      return;
    }
  
-@@ -2082,7 +2083,7 @@ void RenderProcessHostImpl::CreateNotificationService(
+@@ -2084,7 +2085,7 @@ void RenderProcessHostImpl::CreateNotificationService(
    RenderFrameHost* rfh = RenderFrameHost::FromID(GetID(), render_frame_id);
    CHECK(rfh);
    storage_partition_impl_->GetPlatformNotificationContext()->CreateService(

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

@@ -113,7 +113,7 @@ index b2b178ccadce82f8d4ec8e5a6dafe1c67bcecd74..603d82a461c4c443ac26c85a46fbd866
    // OverlayWindowViews
    bool ControlsHitTestContainsPoint(const gfx::Point& point) override;
 diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc
-index 55b53039e4db6afa197fbb61c40d0a21095c5bf9..9dfdd0288391aac31556c716d24c66d123fbd783 100644
+index 590d247e1136b9ac5f766a613e8d91916eb0dda4..453c358d210d48d21a237654143439f2065e98fe 100644
 --- a/chrome/browser/ui/views/overlay/overlay_window_views.cc
 +++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc
 @@ -14,9 +14,11 @@
@@ -126,9 +126,9 @@ index 55b53039e4db6afa197fbb61c40d0a21095c5bf9..9dfdd0288391aac31556c716d24c66d1
  #include "chrome/browser/ui/browser_finder.h"
 +#endif
  #include "chrome/grit/generated_resources.h"
+ #include "chromeos/ui/base/chromeos_ui_constants.h"
  #include "components/vector_icons/vector_icons.h"
- #include "content/public/browser/picture_in_picture_window_controller.h"
-@@ -36,7 +38,7 @@
+@@ -37,7 +39,7 @@
  #include "ui/aura/window.h"
  #endif
  

+ 1 - 1
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 277c93b46025fc5efa7c9462222bf3704172e035..6683578241804b9634965f96d0d1c1a317b94643 100644
+index 401c319799f6bc97845bd88a3f0211d2d6511274..db0d729b22b8ae22781b15de00507f14cc669b83 100644
 --- a/ui/color/color_id.h
 +++ b/ui/color/color_id.h
 @@ -129,6 +129,16 @@

+ 59 - 59
patches/chromium/printing.patch

@@ -11,10 +11,10 @@ majority of changes originally come from these PRs:
 This patch also fixes callback for manual user cancellation and success.
 
 diff --git a/BUILD.gn b/BUILD.gn
-index 32902c0b0c7fa1f1b4371f1bee24c364a4ff89e2..0c9b25af67c7b44b8e839e8839a3ea0ca8b03202 100644
+index 645819d78ca8526340714f05acc9f1819e72c4e3..86f6cfd19586f1d352d6a91c3d76b7323ccf26fe 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
-@@ -973,7 +973,6 @@ if (is_win) {
+@@ -987,7 +987,6 @@ if (is_win) {
        "//media:media_unittests",
        "//media/midi:midi_unittests",
        "//net:net_unittests",
@@ -22,7 +22,7 @@ index 32902c0b0c7fa1f1b4371f1bee24c364a4ff89e2..0c9b25af67c7b44b8e839e8839a3ea0c
        "//sql:sql_unittests",
        "//third_party/breakpad:symupload($host_toolchain)",
        "//ui/base:ui_base_unittests",
-@@ -982,6 +981,10 @@ if (is_win) {
+@@ -996,6 +995,10 @@ if (is_win) {
        "//ui/views:views_unittests",
        "//url:url_unittests",
      ]
@@ -78,7 +78,7 @@ index 331a084371402b5a2440b5d60feac8f0189e84b9..6755d1f497cef4deea6b83df1d8720dc
                 : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
    }
 diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
-index ab2f824eb77ae4c8a916d57914120544bec70ec5..8eef429cf3ea613e83dc408d93faa8d2661cf5db 100644
+index f0d4596f0e95391e752c48dc6ac12f76397c27f1..b7313ce8037c88aa5b8826dc2edcb0dfa4ebee46 100644
 --- a/chrome/browser/printing/print_job_worker.cc
 +++ b/chrome/browser/printing/print_job_worker.cc
 @@ -20,7 +20,6 @@
@@ -97,7 +97,7 @@ index ab2f824eb77ae4c8a916d57914120544bec70ec5..8eef429cf3ea613e83dc408d93faa8d2
  #include "printing/backend/print_backend.h"
  #include "printing/buildflags/buildflags.h"
  #include "printing/mojom/print.mojom.h"
-@@ -209,16 +209,19 @@ void PrintJobWorker::SetSettings(base::Value::Dict new_settings,
+@@ -208,16 +208,19 @@ void PrintJobWorker::SetSettings(base::Value::Dict new_settings,
  #endif  // BUILDFLAG(IS_LINUX) && defined(USE_CUPS)
    }
  
@@ -134,7 +134,7 @@ index 398d59a0ebad165981e9e96b29ffc672e4b841eb..e420d87ef0e90cddb740ac4b24f92519
  
  void PrintJobWorkerOop::UnregisterServiceManagerClient() {
 diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
-index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212b98a2b15 100644
+index 8f4cb7f50dd34c4ef49022242c4b93d703a508a2..d9183b6c1d84a4685f38e84071eb25f26cd28867 100644
 --- a/chrome/browser/printing/print_view_manager_base.cc
 +++ b/chrome/browser/printing/print_view_manager_base.cc
 @@ -30,8 +30,6 @@
@@ -146,7 +146,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  #include "chrome/common/pref_names.h"
  #include "chrome/grit/generated_resources.h"
  #include "components/prefs/pref_service.h"
-@@ -86,10 +84,23 @@ namespace printing {
+@@ -82,10 +80,23 @@ namespace printing {
  
  namespace {
  
@@ -170,7 +170,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    // Runs always on the UI thread.
    static bool is_dialog_shown = false;
    if (is_dialog_shown)
-@@ -98,6 +109,7 @@ void ShowWarningMessageBox(const std::u16string& message) {
+@@ -94,6 +105,7 @@ void ShowWarningMessageBox(const std::u16string& message) {
    base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
  
    chrome::ShowWarningMessageBox(nullptr, std::u16string(), message);
@@ -178,7 +178,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  }
  
  void OnDidGetDefaultPrintSettings(
-@@ -147,7 +159,9 @@ void OnDidUpdatePrintSettings(
+@@ -143,7 +155,9 @@ void OnDidUpdatePrintSettings(
    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
    DCHECK(printer_query);
    mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
@@ -189,7 +189,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
      RenderParamsFromPrintSettings(printer_query->settings(),
                                    params->params.get());
      params->params->document_cookie = printer_query->cookie();
-@@ -175,6 +189,7 @@ void OnDidScriptedPrint(
+@@ -171,6 +185,7 @@ void OnDidScriptedPrint(
      mojom::PrintManagerHost::ScriptedPrintCallback callback) {
    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
    mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
@@ -197,7 +197,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    if (printer_query->last_status() == mojom::ResultCode::kSuccess &&
        printer_query->settings().dpi()) {
      RenderParamsFromPrintSettings(printer_query->settings(),
-@@ -184,7 +199,8 @@ void OnDidScriptedPrint(
+@@ -180,7 +195,8 @@ void OnDidScriptedPrint(
    }
    bool has_valid_cookie = params->params->document_cookie;
    bool has_dpi = !params->params->dpi.IsEmpty();
@@ -207,7 +207,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  
    if (has_dpi && has_valid_cookie) {
      queue->QueuePrinterQuery(std::move(printer_query));
-@@ -199,12 +215,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
+@@ -195,12 +211,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
      : PrintManager(web_contents),
        queue_(g_browser_process->print_job_manager()->queue()) {
    DCHECK(queue_);
@@ -222,7 +222,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  }
  
  PrintViewManagerBase::~PrintViewManagerBase() {
-@@ -212,7 +230,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
+@@ -208,7 +226,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
    DisconnectFromCurrentPrintJob();
  }
  
@@ -234,17 +234,17 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    // Remember the ID for `rfh`, to enable checking that the `RenderFrameHost`
    // is still valid after a possible inner message loop runs in
    // `DisconnectFromCurrentPrintJob()`.
-@@ -240,6 +261,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
+@@ -236,6 +257,9 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
  #endif
  
    SetPrintingRFH(rfh);
 +  callback_ = std::move(callback);
 +
 +  GetPrintRenderFrame(rfh)->PrintRequestedPages(silent, std::move(settings));
- 
- #if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
-   enterprise_connectors::ContentAnalysisDelegate::Data scanning_data;
-@@ -452,7 +476,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
+   CompletePrintNow(rfh);
+   return true;
+ }
+@@ -395,7 +419,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
  void PrintViewManagerBase::ScriptedPrintReply(
      ScriptedPrintCallback callback,
      int process_id,
@@ -254,7 +254,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
  
  #if BUILDFLAG(ENABLE_OOP_PRINTING)
-@@ -467,8 +492,11 @@ void PrintViewManagerBase::ScriptedPrintReply(
+@@ -410,8 +435,11 @@ void PrintViewManagerBase::ScriptedPrintReply(
      return;
    }
  
@@ -267,7 +267,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  }
  
  void PrintViewManagerBase::UpdatePrintingEnabled() {
-@@ -476,8 +504,7 @@ void PrintViewManagerBase::UpdatePrintingEnabled() {
+@@ -419,8 +447,7 @@ void PrintViewManagerBase::UpdatePrintingEnabled() {
    // The Unretained() is safe because ForEachRenderFrameHost() is synchronous.
    web_contents()->GetPrimaryMainFrame()->ForEachRenderFrameHost(
        base::BindRepeating(&PrintViewManagerBase::SendPrintingEnabled,
@@ -277,7 +277,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  }
  
  void PrintViewManagerBase::NavigationStopped() {
-@@ -593,11 +620,14 @@ void PrintViewManagerBase::DidPrintDocument(
+@@ -536,11 +563,14 @@ void PrintViewManagerBase::DidPrintDocument(
  void PrintViewManagerBase::GetDefaultPrintSettings(
      GetDefaultPrintSettingsCallback callback) {
    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -292,7 +292,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  #if BUILDFLAG(ENABLE_OOP_PRINTING)
    if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
        !service_manager_client_id_.has_value()) {
-@@ -635,18 +665,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
+@@ -578,18 +608,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
      base::Value::Dict job_settings,
      UpdatePrintSettingsCallback callback) {
    DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
@@ -314,7 +314,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    content::BrowserContext* context =
        web_contents() ? web_contents()->GetBrowserContext() : nullptr;
    PrefService* prefs =
-@@ -656,6 +688,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
+@@ -599,6 +631,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
      if (value > 0)
        job_settings.Set(kSettingRasterizePdfDpi, value);
    }
@@ -322,7 +322,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  
    auto callback_wrapper =
        base::BindOnce(&PrintViewManagerBase::UpdatePrintSettingsReply,
-@@ -687,14 +720,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
+@@ -630,14 +663,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
      // didn't happen for some reason.
      bad_message::ReceivedBadMessage(
          render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME);
@@ -339,7 +339,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
      return;
    }
  #endif
-@@ -732,7 +765,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
+@@ -675,7 +708,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
    PrintManager::PrintingFailed(cookie, reason);
  
  #if !BUILDFLAG(IS_ANDROID)  // Android does not implement this function.
@@ -347,7 +347,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  #endif
  
    ReleasePrinterQuery();
-@@ -747,6 +779,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
+@@ -690,6 +722,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
  }
  
  void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
@@ -359,7 +359,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    base::ThreadTaskRunnerHandle::Get()->PostTask(
        FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
                                  l10n_util::GetStringUTF16(
-@@ -757,10 +794,12 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
+@@ -700,10 +737,12 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
      content::RenderFrameHost* render_frame_host,
      content::RenderFrameHost::LifecycleState /*old_state*/,
      content::RenderFrameHost::LifecycleState new_state) {
@@ -372,7 +372,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
  }
  
  void PrintViewManagerBase::DidStartLoading() {
-@@ -821,7 +860,12 @@ void PrintViewManagerBase::OnJobDone() {
+@@ -759,7 +798,12 @@ void PrintViewManagerBase::OnJobDone() {
    // Printing is done, we don't need it anymore.
    // print_job_->is_job_pending() may still be true, depending on the order
    // of object registration.
@@ -386,7 +386,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    ReleasePrintJob();
  }
  
-@@ -835,7 +879,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
+@@ -773,7 +817,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
  
    // Is the document already complete?
    if (print_job_->document() && print_job_->document()->IsComplete()) {
@@ -395,7 +395,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
      return true;
    }
  
-@@ -883,7 +927,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
+@@ -821,7 +865,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
  
    // Disconnect the current `print_job_`.
    auto weak_this = weak_ptr_factory_.GetWeakPtr();
@@ -407,7 +407,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    if (!weak_this)
      return false;
  
-@@ -904,7 +951,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
+@@ -842,7 +889,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
  #endif
    print_job_->AddObserver(*this);
  
@@ -416,7 +416,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    return true;
  }
  
-@@ -964,6 +1011,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
+@@ -902,6 +949,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
    }
  #endif
  
@@ -428,7 +428,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    if (!print_job_)
      return;
  
-@@ -971,7 +1023,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
+@@ -909,7 +961,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
      // printing_rfh_ should only ever point to a RenderFrameHost with a live
      // RenderFrame.
      DCHECK(rfh->IsRenderFrameLive());
@@ -437,7 +437,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    }
  
    print_job_->RemoveObserver(*this);
-@@ -1013,7 +1065,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
+@@ -951,7 +1003,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
  }
  
  bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@@ -446,7 +446,7 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
      return true;
  
    if (!cookie) {
-@@ -1121,7 +1173,7 @@ void PrintViewManagerBase::SendPrintingEnabled(bool enabled,
+@@ -1059,7 +1111,7 @@ void PrintViewManagerBase::SendPrintingEnabled(bool enabled,
  }
  
  void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
@@ -456,10 +456,10 @@ index 8a17d3bf5a7fe924d5e562589864747e294931d1..5b270a41efb53bef55cbcb65ca655212
    for (auto& observer : GetObservers())
      observer.OnPrintNow(rfh);
 diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
-index f146d74541cae93a957c5b2596a005e25c20f7cf..120f2bb8b27f814c4f7dc93cef7fb187845e6a75 100644
+index 871e00c49028ccf58d207f904c22e0107f3c2b65..c9b136ab165410eb533f84254454dac0b6674f14 100644
 --- a/chrome/browser/printing/print_view_manager_base.h
 +++ b/chrome/browser/printing/print_view_manager_base.h
-@@ -43,6 +43,8 @@ namespace printing {
+@@ -42,6 +42,8 @@ namespace printing {
  class PrintQueriesQueue;
  class PrinterQuery;
  
@@ -468,7 +468,7 @@ index f146d74541cae93a957c5b2596a005e25c20f7cf..120f2bb8b27f814c4f7dc93cef7fb187
  // Base class for managing the print commands for a WebContents.
  class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
   public:
-@@ -70,7 +72,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
+@@ -65,7 +67,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
    // Prints the current document immediately. Since the rendering is
    // asynchronous, the actual printing will not be completed on the return of
    // this function. Returns false if printing is impossible at the moment.
@@ -480,7 +480,7 @@ index f146d74541cae93a957c5b2596a005e25c20f7cf..120f2bb8b27f814c4f7dc93cef7fb187
  
  #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
    // Prints the document in `print_data` with settings specified in
-@@ -128,6 +133,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
+@@ -123,6 +128,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
    void ShowInvalidPrinterSettingsError() override;
    void PrintingFailed(int32_t cookie,
                        mojom::PrintFailureReason reason) override;
@@ -488,7 +488,7 @@ index f146d74541cae93a957c5b2596a005e25c20f7cf..120f2bb8b27f814c4f7dc93cef7fb187
  
    // Adds and removes observers for `PrintViewManagerBase` events. The order in
    // which notifications are sent to observers is undefined. Observers must be
-@@ -135,6 +141,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
+@@ -130,6 +136,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
    void AddObserver(Observer& observer);
    void RemoveObserver(Observer& observer);
  
@@ -503,7 +503,7 @@ index f146d74541cae93a957c5b2596a005e25c20f7cf..120f2bb8b27f814c4f7dc93cef7fb187
   protected:
    explicit PrintViewManagerBase(content::WebContents* web_contents);
  
-@@ -256,7 +270,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
+@@ -251,7 +265,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
    // Runs `callback` with `params` to reply to ScriptedPrint().
    void ScriptedPrintReply(ScriptedPrintCallback callback,
                            int process_id,
@@ -513,7 +513,7 @@ index f146d74541cae93a957c5b2596a005e25c20f7cf..120f2bb8b27f814c4f7dc93cef7fb187
  
    // Requests the RenderView to render all the missing pages for the print job.
    // No-op if no print job is pending. Returns true if at least one page has
-@@ -336,8 +351,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
+@@ -324,8 +339,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
    // The current RFH that is printing with a system printing dialog.
    raw_ptr<content::RenderFrameHost> printing_rfh_ = nullptr;
  
@@ -575,7 +575,7 @@ index 95d9f19082978772297cff1bcd9c5f73db50bd62..96fe7fbb54fe0908e2153d901c130b6a
    // Tells the browser that there are invalid printer settings.
    ShowInvalidPrinterSettingsError();
 diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
-index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86bc0e0f90 100644
+index 2331b4db94bb6397616dc230498960860554787f..ade741255b9e0274252121ecc2ec68697429c8ad 100644
 --- a/components/printing/renderer/print_render_frame_helper.cc
 +++ b/components/printing/renderer/print_render_frame_helper.cc
 @@ -42,6 +42,7 @@
@@ -586,7 +586,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
  #include "printing/units.h"
  #include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
  #include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
-@@ -1282,7 +1283,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
+@@ -1283,7 +1284,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
      if (!weak_this)
        return;
  
@@ -596,7 +596,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
      if (!weak_this)
        return;
  
-@@ -1313,7 +1315,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
+@@ -1314,7 +1316,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
    receivers_.Add(this, std::move(receiver));
  }
  
@@ -605,7 +605,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
    ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
    if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
      return;
-@@ -1328,7 +1330,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
+@@ -1329,7 +1331,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
    // plugin node and print that instead.
    auto plugin = delegate_->GetPdfElement(frame);
  
@@ -614,7 +614,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
  
    if (!render_frame_gone_)
      frame->DispatchAfterPrintEvent();
-@@ -1405,7 +1407,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
+@@ -1406,7 +1408,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
    }
  
    Print(frame, print_preview_context_.source_node(),
@@ -624,7 +624,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
    if (!render_frame_gone_)
      print_preview_context_.DispatchAfterPrintEvent();
    // WARNING: |this| may be gone at this point. Do not do any more work here and
-@@ -1454,6 +1457,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
+@@ -1455,6 +1458,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
    if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
      return;
  
@@ -633,7 +633,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
    print_preview_context_.OnPrintPreview();
  
  #if BUILDFLAG(IS_CHROMEOS_ASH)
-@@ -2066,7 +2071,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
+@@ -2067,7 +2072,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
        return;
  
      Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
@@ -643,7 +643,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
      // Check if |this| is still valid.
      if (!weak_this)
        return;
-@@ -2081,7 +2087,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
+@@ -2082,7 +2088,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
  
  void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
                                     const blink::WebNode& node,
@@ -654,7 +654,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
    // If still not finished with earlier print request simply ignore.
    if (prep_frame_view_)
      return;
-@@ -2089,7 +2097,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
+@@ -2090,7 +2098,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
    FrameReference frame_ref(frame);
  
    uint32_t expected_page_count = 0;
@@ -663,7 +663,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
      DidFinishPrinting(FAIL_PRINT_INIT);
      return;  // Failed to init print page settings.
    }
-@@ -2108,8 +2116,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
+@@ -2109,8 +2117,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
          print_pages_params_->params->print_scaling_option;
  
      auto self = weak_ptr_factory_.GetWeakPtr();
@@ -680,7 +680,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
      // Check if |this| is still valid.
      if (!self)
        return;
-@@ -2374,36 +2389,52 @@ void PrintRenderFrameHelper::IPCProcessed() {
+@@ -2375,36 +2390,52 @@ void PrintRenderFrameHelper::IPCProcessed() {
    }
  }
  
@@ -745,7 +745,7 @@ index fe8cd8bc27b1e955b177c7952ccb862faf0f228b..d5a2a9a8452b925a693335547d193a86
      notify_browser_of_print_failure_ = false;
      GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
      return false;
-@@ -2528,7 +2559,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
+@@ -2529,7 +2560,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
        std::move(params),
        base::BindOnce(
            [](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output,
@@ -796,10 +796,10 @@ index 66026548181a897c161d7202646f33fd8847ccb8..113a8165b5db6294087773e5a4b2f003
  #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
    // Set options for print preset from source PDF document.
 diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
-index 0704a34a2fc4afdf618004d5bee69a7777cc3491..47edb94bd9078364fb03f35849b389a6b2992922 100644
+index 993ec8acd401d5ccb1e07652c28f6f0a1d89c6bc..638dbd46cb572274a17b0c06ed3db0cf7b614b7f 100644
 --- a/content/browser/BUILD.gn
 +++ b/content/browser/BUILD.gn
-@@ -2783,8 +2783,9 @@ source_set("browser") {
+@@ -2802,8 +2802,9 @@ source_set("browser") {
        "//ppapi/shared_impl",
      ]
  
@@ -812,7 +812,7 @@ index 0704a34a2fc4afdf618004d5bee69a7777cc3491..47edb94bd9078364fb03f35849b389a6
      if (is_chromeos) {
        sources += [
 diff --git a/content/browser/utility_sandbox_delegate_win.cc b/content/browser/utility_sandbox_delegate_win.cc
-index 2ae5fc805ccbd81448d3b9d5aa482bcfd7a747f8..b2ed764463f977bd242d9da79270244062c210d6 100644
+index e7f5b062791f6b2b94943c88d487757f2d77c7c5..f69ed3d412caa7254cfbea85a5448770a42b537d 100644
 --- a/content/browser/utility_sandbox_delegate_win.cc
 +++ b/content/browser/utility_sandbox_delegate_win.cc
 @@ -95,6 +95,7 @@ bool NetworkPreSpawnTarget(sandbox::TargetPolicy* policy) {
@@ -828,9 +828,9 @@ index 2ae5fc805ccbd81448d3b9d5aa482bcfd7a747f8..b2ed764463f977bd242d9da792702440
    return true;
  }
 +#endif
- }  // namespace
  
- std::string UtilitySandboxedProcessLauncherDelegate::GetSandboxTag() {
+ std::string UtilityAppContainerId(base::CommandLine& cmd_line) {
+   return base::WideToUTF8(cmd_line.GetProgram().value());
 diff --git a/printing/printing_context.cc b/printing/printing_context.cc
 index 6cca846b9831da669ca52aff776caf5a23f6f4d1..39d1032f276181a535de9fba89c2246c7a9814d7 100644
 --- a/printing/printing_context.cc

+ 2 - 2
patches/chromium/process_singleton.patch

@@ -24,10 +24,10 @@ This patch adds a few changes to the Chromium code:
    before the browser thread is ready.
 
 diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
-index aca2f19f53657fc2b944b69418e099b056c8e734..e43b0d89e2e6ad0bcb2c34bfacc4ef3b59eaaab1 100644
+index c29925908862930061f63e9f02d614b8a8a7980d..5ce3a8dd6366093ac5d09bab8b1774b8771faea8 100644
 --- a/chrome/browser/chrome_browser_main.cc
 +++ b/chrome/browser/chrome_browser_main.cc
-@@ -1424,7 +1424,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
+@@ -1421,7 +1421,6 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
    switch (notify_result_) {
      case ProcessSingleton::PROCESS_NONE:
        // No process already running, fall through to starting a new one.

+ 7 - 7
patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch

@@ -30,10 +30,10 @@ index bdad25cd2c823fa2125fc523c400479882735ae6..bf2ddb136274eb3e4e597ed3060aabca
    // 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 25a80899f9ae533e2d84e99076696468cef6e56d..e8a3a0525bea6185f4d7ef94edc99d5e6f060787 100644
+index 457ba67603442e8ae9ea75be1cb3b4bf32ed4c4f..50680346b1db4c687d9d956fd3a13adbbd27e65a 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
-@@ -2075,6 +2075,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
+@@ -2076,6 +2076,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) {
  void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) {
    if (view_)
      view_->UpdateCursor(WebCursor(cursor));
@@ -43,10 +43,10 @@ index 25a80899f9ae533e2d84e99076696468cef6e56d..e8a3a0525bea6185f4d7ef94edc99d5e
  
  void RenderWidgetHostImpl::ShowContextMenuAtPoint(
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 9a0edcadef1bc60b035ca67df5082a7d06dd4436..a2f1f72a30f694d53f28d38d823341e7b4f008e1 100644
+index 2b393e7e7089d17a0906610c3c8979c20928a5f6..47b85a2bd890485dec96e23fb2cb8f8553f5c4e2 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -4593,6 +4593,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
+@@ -4609,6 +4609,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() {
    return text_input_manager_.get();
  }
  
@@ -59,10 +59,10 @@ index 9a0edcadef1bc60b035ca67df5082a7d06dd4436..a2f1f72a30f694d53f28d38d823341e7
      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 3221d31d311c74f32f77fed34d53721017cac5e3..864c0a9b7072b6c3ac6584ed35a833dd6afb9e34 100644
+index 91dd718d313ee66bfeea3c0a08e5d2ec3e38b133..892efd5009b0a0ef00081bd765d20c46d68b2324 100644
 --- a/content/browser/web_contents/web_contents_impl.h
 +++ b/content/browser/web_contents/web_contents_impl.h
-@@ -967,6 +967,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
+@@ -974,6 +974,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
    void SendScreenRects() override;
    void SendActiveState(bool active) override;
    TextInputManager* GetTextInputManager() override;
@@ -71,7 +71,7 @@ index 3221d31d311c74f32f77fed34d53721017cac5e3..864c0a9b7072b6c3ac6584ed35a833dd
        RenderWidgetHostImpl* render_widget_host) override;
    bool IsShowingContextMenuOnPage() const override;
 diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h
-index af8a777096c1202b3742d328c02e9e957389fc1e..3a3359865bcedecfa946d517dd50b299172958c9 100644
+index bea8d6a0d6ac44c56132bc7e3745c5c154a02e79..e3fc1e633a9803eee837acbf6434fc6471d5c067 100644
 --- a/content/public/browser/web_contents_observer.h
 +++ b/content/public/browser/web_contents_observer.h
 @@ -13,6 +13,7 @@

+ 6 - 6
patches/chromium/render_widget_host_view_base.patch

@@ -6,10 +6,10 @@ Subject: render_widget_host_view_base.patch
 ... something to do with OSR? and maybe <webview> as well? terrifying.
 
 diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc
-index eefdd87f1f85ac62079e97f1a7736234952d419c..f2b1959f7650ecd98ed2db870d1c723a78f6e1c1 100644
+index 999eeb6fc817a3898b2227fd58aa1ecc660f21a3..8c51cd22fef29fe3e647b80e951af4cf7d9e4637 100644
 --- a/content/browser/renderer_host/render_widget_host_view_base.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_base.cc
-@@ -703,6 +703,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
+@@ -705,6 +705,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor(
    return false;
  }
  
@@ -24,7 +24,7 @@ index eefdd87f1f85ac62079e97f1a7736234952d419c..f2b1959f7650ecd98ed2db870d1c723a
      const blink::WebMouseEvent& event,
      const ui::LatencyInfo& latency) {
 diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h
-index 4174581cda568c887e34c2e2b29edf5ef6e2a092..770599358ca8badf180e249410ba71016d60ab99 100644
+index f3a4f3961b543be0787b9f6ace585ce614e3c23e..5f112610fa0815f58436c54c9631b59ddf8606db 100644
 --- a/content/browser/renderer_host/render_widget_host_view_base.h
 +++ b/content/browser/renderer_host/render_widget_host_view_base.h
 @@ -26,8 +26,10 @@
@@ -38,7 +38,7 @@ index 4174581cda568c887e34c2e2b29edf5ef6e2a092..770599358ca8badf180e249410ba7101
  #include "content/public/browser/render_widget_host_view.h"
  #include "content/public/common/page_visibility_state.h"
  #include "content/public/common/widget_type.h"
-@@ -67,9 +69,11 @@ class CursorManager;
+@@ -68,9 +70,11 @@ class CursorManager;
  class MouseWheelPhaseHandler;
  class RenderWidgetHostImpl;
  class RenderWidgetHostViewBaseObserver;
@@ -50,7 +50,7 @@ index 4174581cda568c887e34c2e2b29edf5ef6e2a092..770599358ca8badf180e249410ba7101
  class WebCursor;
  class WebContentsAccessibility;
  class DelegatedFrameHost;
-@@ -146,6 +150,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
+@@ -147,6 +151,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
        const gfx::Rect& keyboard_rect) override {}
    bool IsHTMLFormPopup() const override;
  
@@ -60,7 +60,7 @@ index 4174581cda568c887e34c2e2b29edf5ef6e2a092..770599358ca8badf180e249410ba7101
    // This only needs to be overridden by RenderWidgetHostViewBase subclasses
    // that handle content embedded within other RenderWidgetHostViews.
    gfx::PointF TransformPointToRootCoordSpaceF(
-@@ -308,6 +315,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
+@@ -315,6 +322,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {
    virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,
                                     const ui::LatencyInfo& latency);
  

+ 6 - 6
patches/chromium/render_widget_host_view_mac.patch

@@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`.
 Additionally, disables usage of some private APIs in MAS builds.
 
 diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
-index e4246c858efdd4d0a6060fd497081e0895a46e20..3f489f6563407ed484df1526bcec35b3b7e5c7a7 100644
+index e26ed62d252e27792d3f2813b502ac93f723a5c2..87b977a5da2334c1494402f81588d0a3fcd8c7a0 100644
 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
 +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm
 @@ -157,6 +157,15 @@ void ExtractUnderlines(NSAttributedString* string,
@@ -29,7 +29,7 @@ index e4246c858efdd4d0a6060fd497081e0895a46e20..3f489f6563407ed484df1526bcec35b3
  // RenderWidgetHostViewCocoa ---------------------------------------------------
  
  // Private methods:
-@@ -597,6 +606,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
+@@ -598,6 +607,9 @@ - (BOOL)acceptsMouseEventsWhenInactive {
  }
  
  - (BOOL)acceptsFirstMouse:(NSEvent*)theEvent {
@@ -39,7 +39,7 @@ index e4246c858efdd4d0a6060fd497081e0895a46e20..3f489f6563407ed484df1526bcec35b3
    return [self acceptsMouseEventsWhenInactive];
  }
  
-@@ -673,6 +685,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
+@@ -674,6 +686,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent {
    // its parent view.
    BOOL hitSelf = NO;
    while (view) {
@@ -50,7 +50,7 @@ index e4246c858efdd4d0a6060fd497081e0895a46e20..3f489f6563407ed484df1526bcec35b3
      if (view == self)
        hitSelf = YES;
      if ([view isKindOfClass:[self class]] && ![view isEqual:self] &&
-@@ -992,6 +1008,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
+@@ -993,6 +1009,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv {
                                eventType == NSEventTypeKeyDown &&
                                !(modifierFlags & NSEventModifierFlagCommand);
  
@@ -61,7 +61,7 @@ index e4246c858efdd4d0a6060fd497081e0895a46e20..3f489f6563407ed484df1526bcec35b3
    // We only handle key down events and just simply forward other events.
    if (eventType != NSEventTypeKeyDown) {
      _hostHelper->ForwardKeyboardEvent(event, latency_info);
-@@ -1812,9 +1832,11 @@ - (NSAccessibilityRole)accessibilityRole {
+@@ -1813,9 +1833,11 @@ - (NSAccessibilityRole)accessibilityRole {
  // Since this implementation doesn't have to wait any IPC calls, this doesn't
  // make any key-typing jank. --hbono 7/23/09
  //
@@ -73,7 +73,7 @@ index e4246c858efdd4d0a6060fd497081e0895a46e20..3f489f6563407ed484df1526bcec35b3
  
  - (NSArray*)validAttributesForMarkedText {
    // This code is just copied from WebKit except renaming variables.
-@@ -1823,7 +1845,10 @@ - (NSArray*)validAttributesForMarkedText {
+@@ -1824,7 +1846,10 @@ - (NSArray*)validAttributesForMarkedText {
          initWithObjects:NSUnderlineStyleAttributeName,
                          NSUnderlineColorAttributeName,
                          NSMarkedClauseSegmentAttributeName,

+ 3 - 3
patches/chromium/resource_file_conflict.patch

@@ -52,10 +52,10 @@ 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 6042493f09bfefb8b0eaad16588acbae984a3dad..31d63709bd68819a439901823b6649e4328244f8 100644
+index aee9abd99a03ad2266e2fcd15c680ae3b97e9dc3..0223183c4e869e835429a52ad7d9eb381a2d21f5 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
-@@ -1546,7 +1546,7 @@ if (is_chrome_branded && !is_android) {
+@@ -1547,7 +1547,7 @@ if (is_chrome_branded && !is_android) {
    }
  }
  
@@ -64,7 +64,7 @@ index 6042493f09bfefb8b0eaad16588acbae984a3dad..31d63709bd68819a439901823b6649e4
    chrome_paks("packed_resources") {
      if (is_mac) {
        output_dir = "$root_gen_dir/repack"
-@@ -1575,6 +1575,12 @@ if (!is_android) {
+@@ -1576,6 +1576,12 @@ if (!is_android) {
    }
  }
  

+ 2 - 2
patches/chromium/revert_spellcheck_fully_launch_spell_check_delayed_initialization.patch

@@ -10,10 +10,10 @@ can be reverted when those failures are addressed. It's unlikely
 that this patch will be upstreamed.
 
 diff --git a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc
-index 72f8e9251df63db8ebebad9a5b682add91340e79..89361e9e8ea4e73c571d3960123030c0011a129d 100644
+index 328574de32fb02f014433b1005d5aa625e498d9f..5cdc5a8c67688747ff3b5323c42e4605ab613347 100644
 --- a/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc
 +++ b/chrome/browser/extensions/api/language_settings_private/language_settings_private_api_unittest.cc
-@@ -302,26 +302,7 @@ TEST_F(LanguageSettingsPrivateApiTest, GetNeverTranslateLanguagesListTest) {
+@@ -297,26 +297,7 @@ TEST_F(LanguageSettingsPrivateApiTest, GetNeverTranslateLanguagesListTest) {
    }
  }
  

+ 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 14985e39b792e931a9884ae95b8d550776520478..d6c104b05471161901e76051e6ec0d1059aa2dd1 100644
+index a15cfb291dea69d78bad2b4726b013d8a636a361..50c1d506d20be94d89f7c33fe3efb4bd30fb2305 100644
 --- a/content/renderer/render_thread_impl.cc
 +++ b/content/renderer/render_thread_impl.cc
-@@ -1282,7 +1282,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
+@@ -1285,7 +1285,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() {
  }
  
  bool RenderThreadImpl::IsElasticOverscrollEnabled() {

+ 28 - 29
patches/chromium/short-circuit_permissions_checks_in_mediastreamdevicescontroller.patch

@@ -15,26 +15,25 @@ short-circuit all the permissions checks in MSDC for now to allow us to
 unduplicate this code.
 
 diff --git a/components/webrtc/media_stream_devices_controller.cc b/components/webrtc/media_stream_devices_controller.cc
-index 13bbeaac938b27446d5b62eb92ca761487db5fef..4cfe57a6356bbc2492f59957a0dfcf63052b7ee8 100644
+index 71eb2eda28d4d0d5dd9a1ad37309dd27caa69ccf..88a1d29ded5630a484106e6638921c6d279778d7 100644
 --- a/components/webrtc/media_stream_devices_controller.cc
 +++ b/components/webrtc/media_stream_devices_controller.cc
-@@ -93,11 +93,14 @@ void MediaStreamDevicesController::RequestPermissions(
+@@ -92,10 +92,12 @@ void MediaStreamDevicesController::RequestPermissions(
  
    std::vector<blink::PermissionType> permission_types;
  
 +#if 0
-   permissions::PermissionManager* permission_manager =
-       permissions::PermissionsClient::Get()->GetPermissionManager(
-           web_contents->GetBrowserContext());
+   content::PermissionController* permission_controller =
+       web_contents->GetBrowserContext()->GetPermissionController();
+-
 +#endif
- 
    if (controller->ShouldRequestAudio()) {
 +#if 0
-     permissions::PermissionResult permission_status =
-         permission_manager->GetPermissionStatusForCurrentDocument(
-             ContentSettingsType::MEDIASTREAM_MIC, rfh);
-@@ -109,10 +112,12 @@ void MediaStreamDevicesController::RequestPermissions(
-           permissions::PermissionStatusSource::FEATURE_POLICY);
+     content::PermissionResult permission_status =
+         permission_controller->GetPermissionResultForCurrentDocument(
+             blink::PermissionType::AUDIO_CAPTURE, rfh);
+@@ -106,10 +108,12 @@ void MediaStreamDevicesController::RequestPermissions(
+                               content::PermissionStatusSource::FEATURE_POLICY);
        return;
      }
 +#endif
@@ -43,26 +42,26 @@ index 13bbeaac938b27446d5b62eb92ca761487db5fef..4cfe57a6356bbc2492f59957a0dfcf63
    }
    if (controller->ShouldRequestVideo()) {
 +#if 0
-     permissions::PermissionResult permission_status =
-         permission_manager->GetPermissionStatusForCurrentDocument(
-             ContentSettingsType::MEDIASTREAM_CAMERA, rfh);
-@@ -124,6 +129,7 @@ void MediaStreamDevicesController::RequestPermissions(
-           permissions::PermissionStatusSource::FEATURE_POLICY);
+     content::PermissionResult permission_status =
+         permission_controller->GetPermissionResultForCurrentDocument(
+             blink::PermissionType::VIDEO_CAPTURE, rfh);
+@@ -120,6 +124,7 @@ void MediaStreamDevicesController::RequestPermissions(
+                               content::PermissionStatusSource::FEATURE_POLICY);
        return;
      }
 +#endif
  
      permission_types.push_back(blink::PermissionType::VIDEO_CAPTURE);
  
-@@ -135,6 +141,7 @@ void MediaStreamDevicesController::RequestPermissions(
+@@ -131,6 +136,7 @@ void MediaStreamDevicesController::RequestPermissions(
      // pan-tilt-zoom permission and there are suitable PTZ capable devices
      // available.
      if (request.request_pan_tilt_zoom_permission && has_pan_tilt_zoom_camera) {
 +#if 0
        permission_status =
-           permission_manager->GetPermissionStatusForCurrentDocument(
-               ContentSettingsType::CAMERA_PAN_TILT_ZOOM, rfh);
-@@ -144,6 +151,7 @@ void MediaStreamDevicesController::RequestPermissions(
+           permission_controller->GetPermissionResultForCurrentDocument(
+               blink::PermissionType::CAMERA_PAN_TILT_ZOOM, rfh);
+@@ -140,6 +146,7 @@ void MediaStreamDevicesController::RequestPermissions(
          controller->RunCallback(/*blocked_by_permissions_policy=*/false);
          return;
        }
@@ -70,16 +69,16 @@ index 13bbeaac938b27446d5b62eb92ca761487db5fef..4cfe57a6356bbc2492f59957a0dfcf63
  
        permission_types.push_back(blink::PermissionType::CAMERA_PAN_TILT_ZOOM);
      }
-@@ -417,6 +425,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
-   if (rfh->GetLastCommittedOrigin().GetURL() != request_.security_origin) {
-     return false;
-   }
+@@ -428,6 +435,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
+ 
+   // TODO(raymes): This function wouldn't be needed if
+   // PermissionManager::RequestPermissions returned a denial reason.
 +#if 0
-   permissions::PermissionResult result =
-       permissions::PermissionsClient::Get()
-           ->GetPermissionManager(web_contents_->GetBrowserContext())
-@@ -425,6 +434,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
-     DCHECK_EQ(CONTENT_SETTING_BLOCK, result.content_setting);
+   content::PermissionResult result =
+       web_contents_->GetBrowserContext()
+           ->GetPermissionController()
+@@ -436,6 +444,7 @@ bool MediaStreamDevicesController::PermissionIsBlockedForReason(
+     DCHECK_EQ(blink::mojom::PermissionStatus::DENIED, result.status);
      return true;
    }
 +#endif

+ 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 d2fbb44deef7a63cc1f5296d338d518bccab6a7c..7bb696c3ad090828b2a7e3a9a648b75bbf39f844 100644
+index 161aefa1d91923be35046dfe735071c687710deb..368d47247ced2320e0627e9cce3cf05e59ea9f39 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
-@@ -1762,9 +1762,15 @@ bool RenderProcessHostImpl::Init() {
+@@ -1764,9 +1764,15 @@ bool RenderProcessHostImpl::Init() {
      std::unique_ptr<SandboxedProcessLauncherDelegate> sandbox_delegate =
          std::make_unique<RendererSandboxedProcessLauncherDelegateWin>(
              cmd_line.get(), IsJitDisabled());

+ 1 - 1
patches/chromium/sysroot.patch

@@ -7,7 +7,7 @@ Make chrome's install-sysroot scripts point to our custom sysroot builds,
 which include extra deps that Electron needs (e.g. libnotify)
 
 diff --git a/build/linux/sysroot_scripts/install-sysroot.py b/build/linux/sysroot_scripts/install-sysroot.py
-index eaa1c2edfd6fba471312fdb4eb3917b50e38e018..74140d29ed56ce54e39940e7bffa3778db983f27 100755
+index abd7eb4a8d116075751bcf6e44f872bac83431ef..54c01f56ac3f17b4534b6e89d9f8c4ba3bd79bf9 100755
 --- a/build/linux/sysroot_scripts/install-sysroot.py
 +++ b/build/linux/sysroot_scripts/install-sysroot.py
 @@ -41,9 +41,11 @@ except ImportError:

+ 5 - 5
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 7ff6febe70e9ec82becfbe036883fbc7572b5b01..2a3c04df4f6f44d2cf75b661761c91d66cdc7ba4 100644
+index 7f04a05eec8780e735e0458c75103d9f2e9b858b..2aa24b773a974e7789c661a0ffa5e01715c6e229 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -3073,6 +3073,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
+@@ -3089,6 +3089,13 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
        site_instance.get(), params.renderer_initiated_creation,
        params.main_frame_name, GetOpener(), primary_main_frame_policy);
  
@@ -26,7 +26,7 @@ index 7ff6febe70e9ec82becfbe036883fbc7572b5b01..2a3c04df4f6f44d2cf75b661761c91d6
    std::unique_ptr<WebContentsViewDelegate> delegate =
        GetContentClient()->browser()->GetWebContentsViewDelegate(this);
  
-@@ -3083,6 +3090,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
+@@ -3099,6 +3106,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params,
      view_ = CreateWebContentsView(this, std::move(delegate),
                                    &render_view_host_delegate_view_);
    }
@@ -35,7 +35,7 @@ index 7ff6febe70e9ec82becfbe036883fbc7572b5b01..2a3c04df4f6f44d2cf75b661761c91d6
    CHECK(view_.get());
  
 diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
-index f07dd54c9498e677e4b3e6a24cb9d794f4465e93..f92bcc8f2a212e6cda464d9b6060a561d689f467 100644
+index 024cd37e818e1c508cf2a8e324478235444f16ed..a389a9c41f96ec3231b62510cde140c52dcdbe9e 100644
 --- a/content/public/browser/web_contents.h
 +++ b/content/public/browser/web_contents.h
 @@ -94,10 +94,13 @@ class BrowserContext;
@@ -52,7 +52,7 @@ index f07dd54c9498e677e4b3e6a24cb9d794f4465e93..f92bcc8f2a212e6cda464d9b6060a561
  class WebUI;
  struct DropData;
  struct MHTMLGenerationParams;
-@@ -236,6 +239,10 @@ class WebContents : public PageNavigator,
+@@ -237,6 +240,10 @@ class WebContents : public PageNavigator,
      network::mojom::WebSandboxFlags starting_sandbox_flags =
          network::mojom::WebSandboxFlags::kNone;
  

+ 2 - 2
patches/chromium/webview_cross_drag.patch

@@ -8,10 +8,10 @@ This allows dragging and dropping between <webview>s.
 Originally landed in https://github.com/electron/libchromiumcontent/pull/267
 
 diff --git a/content/browser/web_contents/web_contents_view_aura.cc b/content/browser/web_contents/web_contents_view_aura.cc
-index 7f60d038fb9c2bc8364c580bc9c7684d97fbbcfb..b1eddf20c22edf974375b8a04d70fca72f7834af 100644
+index 3e2342d28760172bcfd765f7ac3733b4d89a1445..351bee9cfcc31dc6ca06f1fc502b70617105191a 100644
 --- a/content/browser/web_contents/web_contents_view_aura.cc
 +++ b/content/browser/web_contents/web_contents_view_aura.cc
-@@ -900,10 +900,7 @@ bool WebContentsViewAura::IsValidDragTarget(
+@@ -916,10 +916,7 @@ bool WebContentsViewAura::IsValidDragTarget(
    // for the outermost view. Inner `WebContents` will have a
    // `WebContentsViewChildFrame` so when dragging between an inner
    // `WebContents` and its embedder the view IDs will be the same.

+ 2 - 2
patches/chromium/webview_fullscreen.patch

@@ -14,10 +14,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 115dab63efa4b90f37609a9a0a363ad75a0ff582..324232704f0bc0db6c20031cc0a2217b35667c3d 100644
+index e815010dcb9437727f32b12f0d47a31384e24677..bb1ffcd003807084b970e11a1b464e5f72142c53 100644
 --- a/content/browser/renderer_host/render_frame_host_impl.cc
 +++ b/content/browser/renderer_host/render_frame_host_impl.cc
-@@ -6579,6 +6579,17 @@ void RenderFrameHostImpl::EnterFullscreen(
+@@ -6567,6 +6567,17 @@ void RenderFrameHostImpl::EnterFullscreen(
      }
    }
  

+ 9 - 9
patches/chromium/worker_context_will_destroy.patch

@@ -10,10 +10,10 @@ An attempt to upstream this was made, but rejected:
 https://chromium-review.googlesource.com/c/chromium/src/+/1954347
 
 diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
-index d1fa110e7ccdcf496fe5e967cdb85b5fa0e54301..b2f206ed814e43e04815d1247ba4c6aa27f7084d 100644
+index a9146ec6c85b3dfa854d764e8010124f76cd3fc7..e0b308051be9b34ce26b65f6cd582beb7743662d 100644
 --- a/content/public/renderer/content_renderer_client.h
 +++ b/content/public/renderer/content_renderer_client.h
-@@ -360,6 +360,11 @@ class CONTENT_EXPORT ContentRendererClient {
+@@ -365,6 +365,11 @@ class CONTENT_EXPORT ContentRendererClient {
    virtual void DidInitializeWorkerContextOnWorkerThread(
        v8::Local<v8::Context> context) {}
  
@@ -26,10 +26,10 @@ index d1fa110e7ccdcf496fe5e967cdb85b5fa0e54301..b2f206ed814e43e04815d1247ba4c6aa
    // 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 8077fb82bc4bb6594c4676db12223d43bf650688..c05cc4f60a97f10cb0ed194267d6c81a0b50cc7c 100644
+index b822b43d0a2398689120a87b6dbd5f1c5f0f4ee3..53b42b67823474fc5c688654da280cde82faea87 100644
 --- a/content/renderer/renderer_blink_platform_impl.cc
 +++ b/content/renderer/renderer_blink_platform_impl.cc
-@@ -869,6 +869,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
+@@ -860,6 +860,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
    WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread();
  }
  
@@ -43,10 +43,10 @@ index 8077fb82bc4bb6594c4676db12223d43bf650688..c05cc4f60a97f10cb0ed194267d6c81a
      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 8f4b58da709ba6e6a89b3d35d6eae5c23ee19389..7aa2a565643c27d946588bfc5212b3df39eb9d82 100644
+index 9718602c31f866b668cd211ff4fd72f69de1cd42..8f80fb04990c3e2820dcbc9b89dc0255c9c49d30 100644
 --- a/content/renderer/renderer_blink_platform_impl.h
 +++ b/content/renderer/renderer_blink_platform_impl.h
-@@ -182,6 +182,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
+@@ -180,6 +180,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 8f4b58da709ba6e6a89b3d35d6eae5c23ee19389..7aa2a565643c27d946588bfc5212b3df
        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 b3845ea3620684e3a89f9c2a99fb9c8505f942e2..d7fed3409f1846d9655aa2b4adc89768af8ba22f 100644
+index ad34b6230f57ad906bae515aa73ea2aaf1bfeede..b5cff1fee2d14c02f2d67cf012b7ba24fc3a7a06 100644
 --- a/third_party/blink/public/platform/platform.h
 +++ b/third_party/blink/public/platform/platform.h
-@@ -638,6 +638,7 @@ class BLINK_PLATFORM_EXPORT Platform {
+@@ -625,6 +625,7 @@ class BLINK_PLATFORM_EXPORT Platform {
    virtual void DidStartWorkerThread() {}
    virtual void WillStopWorkerThread() {}
    virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
@@ -67,7 +67,7 @@ index b3845ea3620684e3a89f9c2a99fb9c8505f942e2..d7fed3409f1846d9655aa2b4adc89768
        const WebSecurityOrigin& script_origin) {
      return false;
 diff --git a/third_party/blink/renderer/core/workers/worker_thread.cc b/third_party/blink/renderer/core/workers/worker_thread.cc
-index 91fd003fe648c8ac854843922714f30434e3663f..f67fbdd1c9eda7feb9f171fa8482c1d5cc29d508 100644
+index 20d674166c78e316751bfa3ec7aed74656eea9b4..d289cfca8d8a9b093d8d30427e594c46b2f56c79 100644
 --- a/third_party/blink/renderer/core/workers/worker_thread.cc
 +++ b/third_party/blink/renderer/core/workers/worker_thread.cc
 @@ -744,6 +744,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {

+ 8 - 8
patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch

@@ -19,10 +19,10 @@ that clearly establishes the worker script is ready for evaluation with the scop
 initialized.
 
 diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
-index b2f206ed814e43e04815d1247ba4c6aa27f7084d..62c1555386315e00bdf7f677eb85f04ecd9f05d8 100644
+index e0b308051be9b34ce26b65f6cd582beb7743662d..857d5eb211890b10e143f54662636f2ba522b698 100644
 --- a/content/public/renderer/content_renderer_client.h
 +++ b/content/public/renderer/content_renderer_client.h
-@@ -360,6 +360,11 @@ class CONTENT_EXPORT ContentRendererClient {
+@@ -365,6 +365,11 @@ class CONTENT_EXPORT ContentRendererClient {
    virtual void DidInitializeWorkerContextOnWorkerThread(
        v8::Local<v8::Context> context) {}
  
@@ -35,10 +35,10 @@ index b2f206ed814e43e04815d1247ba4c6aa27f7084d..62c1555386315e00bdf7f677eb85f04e
    // 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 c05cc4f60a97f10cb0ed194267d6c81a0b50cc7c..f7b7c348509c775c8877058aa525c5900fc9aec3 100644
+index 53b42b67823474fc5c688654da280cde82faea87..db175070bdcefc84f1d6001568941a9f4f14789c 100644
 --- a/content/renderer/renderer_blink_platform_impl.cc
 +++ b/content/renderer/renderer_blink_platform_impl.cc
-@@ -881,6 +881,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
+@@ -872,6 +872,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated(
        worker);
  }
  
@@ -52,10 +52,10 @@ index c05cc4f60a97f10cb0ed194267d6c81a0b50cc7c..f7b7c348509c775c8877058aa525c590
      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 7aa2a565643c27d946588bfc5212b3df39eb9d82..488d24afedf147307cb71480f5e6f1716318f0d2 100644
+index 8f80fb04990c3e2820dcbc9b89dc0255c9c49d30..f16af9a3e4027066cddbd5082998adc837e9b5dc 100644
 --- a/content/renderer/renderer_blink_platform_impl.h
 +++ b/content/renderer/renderer_blink_platform_impl.h
-@@ -182,6 +182,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
+@@ -180,6 +180,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 7aa2a565643c27d946588bfc5212b3df39eb9d82..488d24afedf147307cb71480f5e6f171
    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 d7fed3409f1846d9655aa2b4adc89768af8ba22f..169916298918d19f23f4e4dce5a306e94d640226 100644
+index b5cff1fee2d14c02f2d67cf012b7ba24fc3a7a06..765c0882406fa0ab7ae3d0460ff9a9814f60db0a 100644
 --- a/third_party/blink/public/platform/platform.h
 +++ b/third_party/blink/public/platform/platform.h
-@@ -638,6 +638,8 @@ class BLINK_PLATFORM_EXPORT Platform {
+@@ -625,6 +625,8 @@ class BLINK_PLATFORM_EXPORT Platform {
    virtual void DidStartWorkerThread() {}
    virtual void WillStopWorkerThread() {}
    virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}

+ 1 - 3
patches/config.json

@@ -21,7 +21,5 @@
 
   "src/electron/patches/Mantle": "src/third_party/squirrel.mac/vendor/Mantle",
 
-  "src/electron/patches/ReactiveObjC": "src/third_party/squirrel.mac/vendor/ReactiveObjC",
-
-  "src/electron/patches/lss": "src/third_party/lss"
+  "src/electron/patches/ReactiveObjC": "src/third_party/squirrel.mac/vendor/ReactiveObjC"
 }

+ 0 - 1
patches/lss/.patches

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

+ 0 - 24
patches/lss/fix_cast_pwrite64_arg_to_long_for_arm.patch

@@ -1,24 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: VerteDinde <[email protected]>
-Date: Tue, 9 Aug 2022 14:05:55 -0700
-Subject: fix: cast pwrite64 arg to long for arm
-
-This patch cases pwrite64 arg to a long in order to avoid a
-compilation error on arm. This patch can be eliminated when the
-upstream patch is merged into chromium main:
-
-https://chromium-review.googlesource.com/c/linux-syscall-support/+/3786946
-
-diff --git a/linux_syscall_support.h b/linux_syscall_support.h
-index e4e816f4bd001a6de7b98972d1cbaec9aaa8f821..5ea1295f8e9bb5312469dbc1aadb67dd620d35d3 100644
---- a/linux_syscall_support.h
-+++ b/linux_syscall_support.h
-@@ -4842,7 +4842,7 @@ struct kernel_statfs {
-                            unsigned, o2)
-       LSS_INLINE _syscall5(ssize_t, _pwrite64,       int,         f,
-                            const void *,   b, size_t, c, unsigned, o1,
--                           long, o2)
-+                           unsigned, o2)
-       LSS_INLINE _syscall4(int, _readahead,          int,         f,
-                            unsigned,       o1, unsigned, o2, size_t, c)
-     #endif

+ 2 - 0
patches/node/.patches

@@ -47,3 +47,5 @@ build_ensure_v8_pointer_compression_sandbox_is_enabled_on_64bit.patch
 build_ensure_native_module_compilation_fails_if_not_using_a_new.patch
 fix_override_createjob_in_node_platform.patch
 buffer_fix_atob_input_validation.patch
+v8_api_advance_api_deprecation.patch
+enable_-wunqualified-std-cast-call.patch

+ 21 - 0
patches/node/enable_-wunqualified-std-cast-call.patch

@@ -0,0 +1,21 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Fri, 26 Aug 2022 00:10:16 +0900
+Subject: Enable -Wunqualified-std-cast-call
+
+Refs https://chromium-review.googlesource.com/c/chromium/src/+/3825237
+Should be upstreamed.
+
+diff --git a/src/node_http2.cc b/src/node_http2.cc
+index ca82da47b4b160af0b1c11f9d162919272666cdb..e60036bb9cc07c5a87c2a017507c3533e229f14f 100644
+--- a/src/node_http2.cc
++++ b/src/node_http2.cc
+@@ -645,7 +645,7 @@ void Http2Stream::EmitStatistics() {
+           duration,
+           statistics_);
+ 
+-  env()->SetImmediate([entry = move(entry)](Environment* env) {
++  env()->SetImmediate([entry = std::move(entry)](Environment* env) {
+     if (HasHttp2Observer(env))
+       entry->Notify(env);
+   });

+ 22 - 0
patches/node/v8_api_advance_api_deprecation.patch

@@ -0,0 +1,22 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Fri, 26 Aug 2022 00:03:44 +0900
+Subject: v8: [api] Advance API deprecation
+
+Refs https://chromium-review.googlesource.com/c/v8/v8/+/3702449
+Should be upstreamed.
+
+diff --git a/src/inspector_agent.cc b/src/inspector_agent.cc
+index 2c36a0b132cf1b21595ac39619b99d316ad81d9e..3dfea77eab2ff880508eda95a5dff80a6564251f 100644
+--- a/src/inspector_agent.cc
++++ b/src/inspector_agent.cc
+@@ -217,7 +217,8 @@ class ChannelImpl final : public v8_inspector::V8Inspector::Channel,
+                        bool prevent_shutdown)
+       : delegate_(std::move(delegate)), prevent_shutdown_(prevent_shutdown),
+         retaining_context_(false) {
+-    session_ = inspector->connect(CONTEXT_GROUP_ID, this, StringView());
++    session_ = inspector->connect(
++        CONTEXT_GROUP_ID, this, StringView(),V8Inspector::kFullyTrusted);
+     node_dispatcher_ = std::make_unique<protocol::UberDispatcher>(this);
+     tracing_agent_ =
+         std::make_unique<protocol::TracingAgent>(env, main_thread_);

+ 3 - 3
patches/v8/build_gn.patch

@@ -9,10 +9,10 @@ necessary for native modules to load.
 Also, some fixes relating to mksnapshot on ARM.
 
 diff --git a/BUILD.gn b/BUILD.gn
-index 0c1a72dfd2a3cb95004de7b32fc35ac982c5f927..f359ea10d6e83f94b698d9d728147944ea566018 100644
+index 83082271b8b76179b41e943190303e31fa639a95..0a23171a391606bb3408dcf8a488d075a148443a 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
-@@ -650,7 +650,7 @@ config("internal_config") {
+@@ -663,7 +663,7 @@ config("internal_config") {
      ":cppgc_header_features",
    ]
  
@@ -21,7 +21,7 @@ index 0c1a72dfd2a3cb95004de7b32fc35ac982c5f927..f359ea10d6e83f94b698d9d728147944
      defines += [ "BUILDING_V8_SHARED" ]
    }
  
-@@ -6124,7 +6124,7 @@ if (current_toolchain == v8_generator_toolchain) {
+@@ -6166,7 +6166,7 @@ if (current_toolchain == v8_generator_toolchain) {
        "src/interpreter/bytecodes.h",
      ]
  

+ 2 - 19
patches/v8/dcheck.patch

@@ -6,10 +6,10 @@ Subject: dcheck.patch
 https://github.com/auchenberg/volkswagen
 
 diff --git a/src/api/api.cc b/src/api/api.cc
-index 0b6bdbc0328dfc979531dbbb25c5fc7b02f661bd..191ee0bb424471c1240835dedc7f25b84221f3b1 100644
+index 353fa739d89bf85d6dbb202d62b3ddab9b0a899e..ae6d7c8548c1cb336e07dcfe7507f7919eb85845 100644
 --- a/src/api/api.cc
 +++ b/src/api/api.cc
-@@ -9181,7 +9181,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
+@@ -9171,7 +9171,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
  }
  
  void Isolate::PerformMicrotaskCheckpoint() {
@@ -18,20 +18,3 @@ index 0b6bdbc0328dfc979531dbbb25c5fc7b02f661bd..191ee0bb424471c1240835dedc7f25b8
    i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(this);
    i_isolate->default_microtask_queue()->PerformCheckpoint(this);
  }
-diff --git a/src/heap/heap.cc b/src/heap/heap.cc
-index 41f2378ba770a96d9722b8d50d28f3562ebf5101..59338d1d293d5325e89052dd226a9ad4f9e8b46a 100644
---- a/src/heap/heap.cc
-+++ b/src/heap/heap.cc
-@@ -6165,9 +6165,9 @@ void Heap::TearDown() {
- void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback,
-                                  GCType gc_type, void* data) {
-   DCHECK_NOT_NULL(callback);
--  DCHECK(gc_prologue_callbacks_.end() ==
--         std::find(gc_prologue_callbacks_.begin(), gc_prologue_callbacks_.end(),
--                   GCCallbackTuple(callback, gc_type, data)));
-+  // DCHECK(gc_prologue_callbacks_.end() ==
-+  //        std::find(gc_prologue_callbacks_.begin(), gc_prologue_callbacks_.end(),
-+  //                  GCCallbackTuple(callback, gc_type, data)));
-   gc_prologue_callbacks_.emplace_back(callback, gc_type, data);
- }
- 

+ 2 - 2
patches/v8/do_not_export_private_v8_symbols_on_windows.patch

@@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not
 contain any standard C++ library exports (e.g. `std::ostringstream`).
 
 diff --git a/BUILD.gn b/BUILD.gn
-index 09c3dc73292e2778baba3a0f7f1a02d875845d34..cf9dff8346bbe086464391758a5c11f228b3898c 100644
+index b0c6d08bf50a3443e2589f09b6f1f5b7734c000c..7728123805054064d5acecacf6cbf8d1fe4a56c1 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
-@@ -650,6 +650,10 @@ config("internal_config") {
+@@ -663,6 +663,10 @@ config("internal_config") {
      ":cppgc_header_features",
    ]
  

+ 2 - 2
patches/v8/export_symbols_needed_for_windows_build.patch

@@ -6,10 +6,10 @@ Subject: Export symbols needed for Windows build
 These symbols are required to build v8 with BUILD_V8_SHARED on Windows.
 
 diff --git a/src/objects/objects.h b/src/objects/objects.h
-index fbdf5f029f19d8c231e70593e4860f8949e66e45..f98808fa74d79f8492f5a9aac92783b0775bfdf6 100644
+index ced30839aa8627b9b21eabea1a4a3b2574a906d8..f038aea4e2e105b711f4530a1c40d63ee340724f 100644
 --- a/src/objects/objects.h
 +++ b/src/objects/objects.h
-@@ -930,7 +930,7 @@ enum AccessorComponent { ACCESSOR_GETTER, ACCESSOR_SETTER };
+@@ -928,7 +928,7 @@ enum AccessorComponent { ACCESSOR_GETTER, ACCESSOR_SETTER };
  // Utility superclass for stack-allocated objects that must be updated
  // on gc.  It provides two ways for the gc to update instances, either
  // iterating or updating after gc.

+ 2 - 2
patches/v8/expose_mksnapshot.patch

@@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch
 Needed in order to target mksnapshot for mksnapshot zip.
 
 diff --git a/BUILD.gn b/BUILD.gn
-index f359ea10d6e83f94b698d9d728147944ea566018..09c3dc73292e2778baba3a0f7f1a02d875845d34 100644
+index 0a23171a391606bb3408dcf8a488d075a148443a..b0c6d08bf50a3443e2589f09b6f1f5b7734c000c 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
-@@ -6136,7 +6136,6 @@ if (current_toolchain == v8_generator_toolchain) {
+@@ -6178,7 +6178,6 @@ if (current_toolchain == v8_generator_toolchain) {
  
  if (current_toolchain == v8_snapshot_toolchain) {
    v8_executable("mksnapshot") {

+ 4 - 4
patches/v8/revert_runtime_dhceck_terminating_exception_in_microtasks.patch

@@ -18,10 +18,10 @@ index ca4b1dc557f573bfcde200201cbd2f05e3c6b530..9edc8ce00c524a63cb23911a474f1904
    StoreRoot(RootIndex::kCurrentMicrotask, microtask);
    TNode<IntPtrT> saved_entered_context_count = GetEnteredContextCount();
 diff --git a/src/codegen/code-stub-assembler.cc b/src/codegen/code-stub-assembler.cc
-index fe435ad067837df7f1ebc971083b6585952903f5..34660673e239cbc49e749732e95d16c20982a675 100644
+index 9a12cfdd9d02624a6fbbf5b10da958a6024b0857..01acdbcd633e9f11e6bd0673ed33eed5ce4f61fa 100644
 --- a/src/codegen/code-stub-assembler.cc
 +++ b/src/codegen/code-stub-assembler.cc
-@@ -6124,12 +6124,6 @@ void CodeStubAssembler::SetPendingMessage(TNode<HeapObject> message) {
+@@ -6139,12 +6139,6 @@ void CodeStubAssembler::SetPendingMessage(TNode<HeapObject> message) {
    StoreFullTaggedNoWriteBarrier(pending_message, message);
  }
  
@@ -35,10 +35,10 @@ index fe435ad067837df7f1ebc971083b6585952903f5..34660673e239cbc49e749732e95d16c2
                                                    int type) {
    return Word32Equal(instance_type, Int32Constant(type));
 diff --git a/src/codegen/code-stub-assembler.h b/src/codegen/code-stub-assembler.h
-index c4878044b149ec23f4ac9198f402ccc5114e219e..ba9be792cbcce3cbc85062daa524010dced2cfeb 100644
+index 5c89a2ac9de2db35c4b5c326a02269203bb0ce46..ecc20c69e8f72179d32ce53e68bc463105907d11 100644
 --- a/src/codegen/code-stub-assembler.h
 +++ b/src/codegen/code-stub-assembler.h
-@@ -2533,7 +2533,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
+@@ -2538,7 +2538,6 @@ class V8_EXPORT_PRIVATE CodeStubAssembler
  
    TNode<HeapObject> GetPendingMessage();
    void SetPendingMessage(TNode<HeapObject> message);

+ 3 - 3
patches/v8/workaround_an_undefined_symbol_error.patch

@@ -12,10 +12,10 @@ By moving some functions out of the the arm64-assembler header file,
 this error no longer seems to happen.
 
 diff --git a/src/codegen/arm64/assembler-arm64.cc b/src/codegen/arm64/assembler-arm64.cc
-index 818af524388b1aba51e984b7ff7f7b856d1e590b..7ba8a0e9bc11a65e72e66aebd87e19359ba5594e 100644
+index 0110e903fd9c3681dca9921d4ad26fa47c38886a..18be54526bc11a4b285d9e0ab1873d587f11899d 100644
 --- a/src/codegen/arm64/assembler-arm64.cc
 +++ b/src/codegen/arm64/assembler-arm64.cc
-@@ -3630,6 +3630,22 @@ void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift,
+@@ -3627,6 +3627,22 @@ void Assembler::MoveWide(const Register& rd, uint64_t imm, int shift,
         ImmMoveWide(static_cast<int>(imm)) | ShiftMoveWide(shift));
  }
  
@@ -39,7 +39,7 @@ index 818af524388b1aba51e984b7ff7f7b856d1e590b..7ba8a0e9bc11a65e72e66aebd87e1935
                         const Operand& operand, FlagsUpdate S, AddSubOp op) {
    DCHECK_EQ(rd.SizeInBits(), rn.SizeInBits());
 diff --git a/src/codegen/arm64/assembler-arm64.h b/src/codegen/arm64/assembler-arm64.h
-index e3d8eb27dea2d241933bcb597bef35b46fcd2a09..0a752245ec25c80d5ed34b1a858fa43cc0d6dd40 100644
+index f26054a12ee493fc82cc5285de96da3b5aa149b2..23d8ead77dc4cde1da093510353cc93c14ce4fe0 100644
 --- a/src/codegen/arm64/assembler-arm64.h
 +++ b/src/codegen/arm64/assembler-arm64.h
 @@ -2120,11 +2120,7 @@ class V8_EXPORT_PRIVATE Assembler : public AssemblerBase {

+ 1 - 0
shell/browser/api/electron_api_web_contents.cc

@@ -1286,6 +1286,7 @@ void WebContents::UpdateExclusiveAccessExitBubbleContent(
     const GURL& url,
     ExclusiveAccessBubbleType bubble_type,
     ExclusiveAccessBubbleHideCallback bubble_first_hide_callback,
+    bool notify_download,
     bool force_update) {}
 
 void WebContents::OnExclusiveAccessUserInput() {}

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

@@ -664,6 +664,7 @@ class WebContents : public ExclusiveAccessContext,
       const GURL& url,
       ExclusiveAccessBubbleType bubble_type,
       ExclusiveAccessBubbleHideCallback bubble_first_hide_callback,
+      bool notify_download,
       bool force_update) override;
   void OnExclusiveAccessUserInput() override;
   content::WebContents* GetActiveWebContents() override;

+ 49 - 43
shell/browser/electron_browser_client.cc

@@ -1572,56 +1572,61 @@ void ElectronBrowserClient::
     if (render_frame_host.GetFrameTreeNodeId() ==
             contents->GetPrimaryMainFrame()->GetFrameTreeNodeId() ||
         (prefs && prefs->AllowsNodeIntegrationInSubFrames())) {
-      associated_registry.AddInterface(base::BindRepeating(
+      associated_registry.AddInterface<mojom::ElectronApiIPC>(
+          base::BindRepeating(
+              [](content::RenderFrameHost* render_frame_host,
+                 mojo::PendingAssociatedReceiver<mojom::ElectronApiIPC>
+                     receiver) {
+                ElectronApiIPCHandlerImpl::Create(render_frame_host,
+                                                  std::move(receiver));
+              },
+              &render_frame_host));
+    }
+  }
+
+  associated_registry.AddInterface<mojom::ElectronWebContentsUtility>(
+      base::BindRepeating(
           [](content::RenderFrameHost* render_frame_host,
-             mojo::PendingAssociatedReceiver<electron::mojom::ElectronApiIPC>
+             mojo::PendingAssociatedReceiver<mojom::ElectronWebContentsUtility>
                  receiver) {
-            ElectronApiIPCHandlerImpl::Create(render_frame_host,
-                                              std::move(receiver));
+            ElectronWebContentsUtilityHandlerImpl::Create(render_frame_host,
+                                                          std::move(receiver));
           },
           &render_frame_host));
-    }
-  }
-
-  associated_registry.AddInterface(base::BindRepeating(
-      [](content::RenderFrameHost* render_frame_host,
-         mojo::PendingAssociatedReceiver<
-             electron::mojom::ElectronWebContentsUtility> receiver) {
-        ElectronWebContentsUtilityHandlerImpl::Create(render_frame_host,
-                                                      std::move(receiver));
-      },
-      &render_frame_host));
 
-  associated_registry.AddInterface(base::BindRepeating(
-      [](content::RenderFrameHost* render_frame_host,
-         mojo::PendingAssociatedReceiver<mojom::ElectronAutofillDriver>
-             receiver) {
-        AutofillDriverFactory::BindAutofillDriver(std::move(receiver),
-                                                  render_frame_host);
-      },
-      &render_frame_host));
+  associated_registry.AddInterface<mojom::ElectronAutofillDriver>(
+      base::BindRepeating(
+          [](content::RenderFrameHost* render_frame_host,
+             mojo::PendingAssociatedReceiver<mojom::ElectronAutofillDriver>
+                 receiver) {
+            AutofillDriverFactory::BindAutofillDriver(std::move(receiver),
+                                                      render_frame_host);
+          },
+          &render_frame_host));
 #if BUILDFLAG(ENABLE_PRINTING)
-  associated_registry.AddInterface(base::BindRepeating(
-      [](content::RenderFrameHost* render_frame_host,
-         mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost>
-             receiver) {
-        PrintViewManagerElectron::BindPrintManagerHost(std::move(receiver),
-                                                       render_frame_host);
-      },
-      &render_frame_host));
+  associated_registry.AddInterface<printing::mojom::PrintManagerHost>(
+      base::BindRepeating(
+          [](content::RenderFrameHost* render_frame_host,
+             mojo::PendingAssociatedReceiver<printing::mojom::PrintManagerHost>
+                 receiver) {
+            PrintViewManagerElectron::BindPrintManagerHost(std::move(receiver),
+                                                           render_frame_host);
+          },
+          &render_frame_host));
 #endif
 #if BUILDFLAG(ENABLE_EXTENSIONS)
-  associated_registry.AddInterface(base::BindRepeating(
-      [](content::RenderFrameHost* render_frame_host,
-         mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>
-             receiver) {
-        extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
-            std::move(receiver), render_frame_host);
-      },
-      &render_frame_host));
+  associated_registry.AddInterface<extensions::mojom::LocalFrameHost>(
+      base::BindRepeating(
+          [](content::RenderFrameHost* render_frame_host,
+             mojo::PendingAssociatedReceiver<extensions::mojom::LocalFrameHost>
+                 receiver) {
+            extensions::ExtensionWebContentsObserver::BindLocalFrameHost(
+                std::move(receiver), render_frame_host);
+          },
+          &render_frame_host));
 #endif
 #if BUILDFLAG(ENABLE_PDF_VIEWER)
-  associated_registry.AddInterface(base::BindRepeating(
+  associated_registry.AddInterface<pdf::mojom::PdfService>(base::BindRepeating(
       [](content::RenderFrameHost* render_frame_host,
          mojo::PendingAssociatedReceiver<pdf::mojom::PdfService> receiver) {
         pdf::PDFWebContentsHelper::BindPdfService(std::move(receiver),
@@ -1697,9 +1702,10 @@ void ElectronBrowserClient::ExposeInterfacesToRenderer(
     blink::AssociatedInterfaceRegistry* associated_registry,
     content::RenderProcessHost* render_process_host) {
 #if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
-  associated_registry->AddInterface(base::BindRepeating(
-      &extensions::EventRouter::BindForRenderer, render_process_host->GetID()));
-  associated_registry->AddInterface(
+  associated_registry->AddInterface<extensions::mojom::EventRouter>(
+      base::BindRepeating(&extensions::EventRouter::BindForRenderer,
+                          render_process_host->GetID()));
+  associated_registry->AddInterface<extensions::mojom::GuestView>(
       base::BindRepeating(&extensions::ExtensionsGuestView::CreateForExtensions,
                           render_process_host->GetID()));
 #endif

+ 7 - 0
shell/browser/electron_browser_context.cc

@@ -389,6 +389,13 @@ ElectronBrowserContext::GetStorageNotificationService() {
   return nullptr;
 }
 
+content::ReduceAcceptLanguageControllerDelegate*
+ElectronBrowserContext::GetReduceAcceptLanguageControllerDelegate() {
+  // Needs implementation
+  // Refs https://chromium-review.googlesource.com/c/chromium/src/+/3687391
+  return nullptr;
+}
+
 ResolveProxyHelper* ElectronBrowserContext::GetResolveProxyHelper() {
   if (!resolve_proxy_helper_) {
     resolve_proxy_helper_ = base::MakeRefCounted<ResolveProxyHelper>(this);

+ 2 - 0
shell/browser/electron_browser_context.h

@@ -118,6 +118,8 @@ class ElectronBrowserContext : public content::BrowserContext {
   content::ClientHintsControllerDelegate* GetClientHintsControllerDelegate()
       override;
   content::StorageNotificationService* GetStorageNotificationService() override;
+  content::ReduceAcceptLanguageControllerDelegate*
+  GetReduceAcceptLanguageControllerDelegate() override;
 
   CookieChangeNotifier* cookie_change_notifier() const {
     return cookie_change_notifier_.get();

+ 10 - 0
shell/browser/electron_permission_manager.cc

@@ -253,6 +253,16 @@ blink::mojom::PermissionStatus ElectronPermissionManager::GetPermissionStatus(
                  : blink::mojom::PermissionStatus::DENIED;
 }
 
+content::PermissionResult
+ElectronPermissionManager::GetPermissionResultForOriginWithoutContext(
+    blink::PermissionType permission,
+    const url::Origin& origin) {
+  blink::mojom::PermissionStatus status =
+      GetPermissionStatus(permission, origin.GetURL(), origin.GetURL());
+  return content::PermissionResult(
+      status, content::PermissionStatusSource::UNSPECIFIED);
+}
+
 ElectronPermissionManager::SubscriptionId
 ElectronPermissionManager::SubscribePermissionStatusChange(
     blink::PermissionType permission,

+ 7 - 4
shell/browser/electron_permission_manager.h

@@ -73,6 +73,7 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
                           const GURL& requesting_origin,
                           bool user_gesture,
                           StatusesCallback callback) override;
+
   void RequestPermissionsWithDetails(
       const std::vector<blink::PermissionType>& permissions,
       content::RenderFrameHost* render_frame_host,
@@ -80,10 +81,6 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
       base::Value::Dict details,
       StatusesCallback callback);
 
-  blink::mojom::PermissionStatus GetPermissionStatusForCurrentDocument(
-      blink::PermissionType permission,
-      content::RenderFrameHost* render_frame_host) override;
-
   bool CheckPermissionWithDetails(blink::PermissionType permission,
                                   content::RenderFrameHost* render_frame_host,
                                   const GURL& requesting_origin,
@@ -124,6 +121,12 @@ class ElectronPermissionManager : public content::PermissionControllerDelegate {
       base::OnceCallback<
           void(const std::vector<blink::mojom::PermissionStatus>&)> callback)
       override;
+  content::PermissionResult GetPermissionResultForOriginWithoutContext(
+      blink::PermissionType permission,
+      const url::Origin& origin) override;
+  blink::mojom::PermissionStatus GetPermissionStatusForCurrentDocument(
+      blink::PermissionType permission,
+      content::RenderFrameHost* render_frame_host) override;
   blink::mojom::PermissionStatus GetPermissionStatusForWorker(
       blink::PermissionType permission,
       content::RenderProcessHost* render_process_host,

+ 7 - 7
shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc

@@ -246,7 +246,7 @@ void DesktopNotificationController::AnimateAll() {
         break;
       }
 
-      it = move(it2);
+      it = std::move(it2);
     }
   }
 
@@ -280,12 +280,12 @@ DesktopNotificationController::AddNotification(std::u16string caption,
                                                HBITMAP image) {
   auto data = std::make_shared<NotificationData>();
   data->controller = this;
-  data->caption = move(caption);
-  data->body_text = move(body_text);
+  data->caption = std::move(caption);
+  data->body_text = std::move(body_text);
   data->image = CopyBitmap(image);
 
   // Enqueue new notification
-  Notification ret{*queue_.insert(queue_.end(), move(data))};
+  Notification ret{*queue_.insert(queue_.end(), std::move(data))};
   CheckQueue();
   return ret;
 }
@@ -311,7 +311,7 @@ void DesktopNotificationController::CloseNotification(
 
 void DesktopNotificationController::CheckQueue() {
   while (instances_.size() < instances_.capacity() && !queue_.empty()) {
-    CreateToast(move(queue_.front()));
+    CreateToast(std::move(queue_.front()));
     queue_.pop_front();
   }
 }
@@ -409,8 +409,8 @@ void DesktopNotificationController::Notification::Set(std::u16string caption,
   if (data_->image)
     DeleteBitmap(data_->image);
 
-  data_->caption = move(caption);
-  data_->body_text = move(body_text);
+  data_->caption = std::move(caption);
+  data_->body_text = std::move(body_text);
   data_->image = CopyBitmap(image);
 
   auto* hwnd = data_->controller->GetToast(data_.get());

+ 4 - 4
shell/browser/ui/devtools_ui.cc

@@ -31,8 +31,8 @@ std::string PathWithoutParams(const std::string& path) {
       .substr(1);
 }
 
-std::string GetMimeTypeForPath(const std::string& path) {
-  std::string filename = PathWithoutParams(path);
+std::string GetMimeTypeForUrl(const GURL& url) {
+  std::string filename = url.ExtractFileName();
   if (base::EndsWith(filename, ".html", base::CompareCase::INSENSITIVE_ASCII)) {
     return "text/html";
   } else if (base::EndsWith(filename, ".css",
@@ -95,8 +95,8 @@ class BundledDataSource : public content::URLDataSource {
     std::move(callback).Run(nullptr);
   }
 
-  std::string GetMimeType(const std::string& path) override {
-    return GetMimeTypeForPath(path);
+  std::string GetMimeType(const GURL& url) override {
+    return GetMimeTypeForUrl(url);
   }
 
   bool ShouldAddContentSecurityPolicy() override { return false; }

+ 26 - 36
shell/browser/zoom_level_delegate.cc

@@ -6,12 +6,12 @@
 
 #include <functional>
 #include <memory>
+#include <utility>
 #include <vector>
 
 #include "base/bind.h"
 #include "base/files/file_path.h"
 #include "base/strings/string_number_conversions.h"
-#include "base/values.h"
 #include "components/prefs/json_pref_store.h"
 #include "components/prefs/pref_filter.h"
 #include "components/prefs/pref_registry_simple.h"
@@ -63,18 +63,11 @@ void ZoomLevelDelegate::SetDefaultZoomLevelPref(double level) {
 }
 
 double ZoomLevelDelegate::GetDefaultZoomLevelPref() const {
-  double default_zoom_level = 0.0;
-
-  const base::Value* default_zoom_level_dictionary =
-      pref_service_->GetDictionary(kPartitionDefaultZoomLevel);
+  const base::Value::Dict& default_zoom_level_dictionary =
+      pref_service_->GetValueDict(kPartitionDefaultZoomLevel);
   // If no default has been previously set, the default returned is the
   // value used to initialize default_zoom_level in this function.
-  absl::optional<double> maybe_default_zoom_level =
-      default_zoom_level_dictionary->FindDoubleKey(partition_key_);
-  if (maybe_default_zoom_level.has_value())
-    default_zoom_level = maybe_default_zoom_level.value();
-
-  return default_zoom_level;
+  return default_zoom_level_dictionary.FindDouble(partition_key_).value_or(0.0);
 }
 
 void ZoomLevelDelegate::OnZoomLevelChanged(
@@ -84,35 +77,33 @@ void ZoomLevelDelegate::OnZoomLevelChanged(
 
   double level = change.zoom_level;
   DictionaryPrefUpdate update(pref_service_, kPartitionPerHostZoomLevels);
-  base::Value* host_zoom_dictionaries = update.Get();
-  DCHECK(host_zoom_dictionaries);
+  base::Value* host_zoom_update = update.Get();
+  DCHECK(host_zoom_update);
+  base::Value::Dict& host_zoom_dictionaries = host_zoom_update->GetDict();
 
   bool modification_is_removal =
       blink::PageZoomValuesEqual(level, host_zoom_map_->GetDefaultZoomLevel());
 
-  base::Value* host_zoom_dictionary =
-      host_zoom_dictionaries->FindDictKey(partition_key_);
+  base::Value::Dict* host_zoom_dictionary =
+      host_zoom_dictionaries.FindDict(partition_key_);
   if (!host_zoom_dictionary) {
-    host_zoom_dictionaries->SetKey(partition_key_,
-                                   base::Value(base::Value::Type::DICTIONARY));
-    host_zoom_dictionary = host_zoom_dictionaries->FindDictKey(partition_key_);
+    base::Value::Dict dict;
+    host_zoom_dictionaries.Set(partition_key_, std::move(dict));
+    host_zoom_dictionary = host_zoom_dictionaries.FindDict(partition_key_);
   }
 
   if (modification_is_removal)
-    host_zoom_dictionary->RemoveKey(change.host);
+    host_zoom_dictionary->Remove(change.host);
   else
-    host_zoom_dictionary->SetKey(change.host, base::Value(level));
+    host_zoom_dictionary->Set(change.host, base::Value(level));
 }
 
 void ZoomLevelDelegate::ExtractPerHostZoomLevels(
-    const base::DictionaryValue* host_zoom_dictionary) {
+    const base::Value::Dict& host_zoom_dictionary) {
   std::vector<std::string> keys_to_remove;
-  std::unique_ptr<base::DictionaryValue> host_zoom_dictionary_copy =
-      host_zoom_dictionary->DeepCopyWithoutEmptyChildren();
-  for (base::DictionaryValue::Iterator i(*host_zoom_dictionary_copy);
-       !i.IsAtEnd(); i.Advance()) {
-    const std::string& host(i.key());
-    const absl::optional<double> zoom_level = i.value().GetIfDouble();
+  base::Value::Dict host_zoom_dictionary_copy = host_zoom_dictionary.Clone();
+  for (auto [host, value] : host_zoom_dictionary_copy) {
+    const absl::optional<double> zoom_level = value.GetIfDouble();
 
     // Filter out A) the empty host, B) zoom levels equal to the default; and
     // remember them, so that we can later erase them from Prefs.
@@ -120,14 +111,14 @@ void ZoomLevelDelegate::ExtractPerHostZoomLevels(
     // level was set to its current value. In either case, SetZoomLevelForHost
     // will ignore type B values, thus, to have consistency with HostZoomMap's
     // internal state, these values must also be removed from Prefs.
-    if (host.empty() || !zoom_level ||
-        blink::PageZoomValuesEqual(*zoom_level,
+    if (host.empty() || !zoom_level.has_value() ||
+        blink::PageZoomValuesEqual(zoom_level.value(),
                                    host_zoom_map_->GetDefaultZoomLevel())) {
       keys_to_remove.push_back(host);
       continue;
     }
 
-    host_zoom_map_->SetZoomLevelForHost(host, *zoom_level);
+    host_zoom_map_->SetZoomLevelForHost(host, zoom_level.value());
   }
 
   // Sanitize prefs to remove entries that match the default zoom level and/or
@@ -155,16 +146,15 @@ void ZoomLevelDelegate::InitHostZoomMap(content::HostZoomMap* host_zoom_map) {
 
   // Initialize the HostZoomMap with per-host zoom levels from the persisted
   // zoom-level preference values.
-  const base::Value* host_zoom_dictionaries =
-      pref_service_->GetDictionary(kPartitionPerHostZoomLevels);
-  const base::Value* host_zoom_dictionary =
-      host_zoom_dictionaries->FindDictKey(partition_key_);
+  const base::Value::Dict& host_zoom_dictionaries =
+      pref_service_->GetValueDict(kPartitionPerHostZoomLevels);
+  const base::Value::Dict* host_zoom_dictionary =
+      host_zoom_dictionaries.FindDict(partition_key_);
   if (host_zoom_dictionary) {
     // Since we're calling this before setting up zoom_subscription_ below we
     // don't need to worry that host_zoom_dictionary is indirectly affected
     // by calls to HostZoomMap::SExtractPerHostZoomLevelsetZoomLevelForHost().
-    ExtractPerHostZoomLevels(
-        &base::Value::AsDictionaryValue(*host_zoom_dictionary));
+    ExtractPerHostZoomLevels(*host_zoom_dictionary);
   }
   zoom_subscription_ =
       host_zoom_map_->AddZoomLevelChangedCallback(base::BindRepeating(

+ 2 - 3
shell/browser/zoom_level_delegate.h

@@ -7,12 +7,12 @@
 
 #include <string>
 
+#include "base/values.h"
 #include "components/prefs/pref_service.h"
 #include "content/public/browser/host_zoom_map.h"
 #include "content/public/browser/zoom_level_delegate.h"
 
 namespace base {
-class DictionaryValue;
 class FilePath;
 }  // namespace base
 
@@ -45,8 +45,7 @@ class ZoomLevelDelegate : public content::ZoomLevelDelegate {
   void InitHostZoomMap(content::HostZoomMap* host_zoom_map) override;
 
  private:
-  void ExtractPerHostZoomLevels(
-      const base::DictionaryValue* host_zoom_dictionary);
+  void ExtractPerHostZoomLevels(const base::Value::Dict& host_zoom_dictionary);
 
   // This is a callback function that receives notifications from HostZoomMap
   // when per-host zoom levels change. It is used to update the per-host

+ 5 - 0
shell/common/extensions/electron_extensions_client.cc

@@ -67,6 +67,7 @@ base::LazyInstance<ElectronPermissionMessageProvider>::DestructorAtExit
 
 ElectronExtensionsClient::ElectronExtensionsClient()
     : webstore_base_url_(extension_urls::kChromeWebstoreBaseURL),
+      new_webstore_base_url_(extension_urls::kNewChromeWebstoreBaseURL),
       webstore_update_url_(extension_urls::kChromeWebstoreUpdateURL) {
   AddAPIProvider(std::make_unique<extensions::CoreExtensionsAPIProvider>());
   AddAPIProvider(std::make_unique<ElectronExtensionsAPIProvider>());
@@ -127,6 +128,10 @@ const GURL& ElectronExtensionsClient::GetWebstoreBaseURL() const {
   return webstore_base_url_;
 }
 
+const GURL& ElectronExtensionsClient::GetNewWebstoreBaseURL() const {
+  return new_webstore_base_url_;
+}
+
 const GURL& ElectronExtensionsClient::GetWebstoreUpdateURL() const {
   return webstore_update_url_;
 }

+ 2 - 0
shell/common/extensions/electron_extensions_client.h

@@ -52,11 +52,13 @@ class ElectronExtensionsClient : public extensions::ExtensionsClient {
   const GURL& GetWebstoreBaseURL() const override;
   const GURL& GetWebstoreUpdateURL() const override;
   bool IsBlocklistUpdateURL(const GURL& url) const override;
+  const GURL& GetNewWebstoreBaseURL() const override;
 
  private:
   ScriptingAllowlist scripting_allowlist_;
 
   const GURL webstore_base_url_;
+  const GURL new_webstore_base_url_;
   const GURL webstore_update_url_;
 };
 

+ 39 - 37
shell/renderer/api/electron_api_web_frame.cc

@@ -23,6 +23,7 @@
 #include "shell/common/gin_converters/blink_converter.h"
 #include "shell/common/gin_converters/callback_converter.h"
 #include "shell/common/gin_converters/file_path_converter.h"
+#include "shell/common/gin_converters/value_converter.h"
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/gin_helper/error_thrower.h"
 #include "shell/common/gin_helper/function_template_extensions.h"
@@ -56,27 +57,6 @@
 
 namespace gin {
 
-template <>
-struct Converter<blink::WebLocalFrame::ScriptExecutionType> {
-  static bool FromV8(v8::Isolate* isolate,
-                     v8::Local<v8::Value> val,
-                     blink::WebLocalFrame::ScriptExecutionType* out) {
-    std::string execution_type;
-    if (!ConvertFromV8(isolate, val, &execution_type))
-      return false;
-    if (execution_type == "asynchronous") {
-      *out = blink::WebLocalFrame::kAsynchronous;
-    } else if (execution_type == "asynchronousBlockingOnload") {
-      *out = blink::WebLocalFrame::kAsynchronousBlockingOnload;
-    } else if (execution_type == "synchronous") {
-      *out = blink::WebLocalFrame::kSynchronous;
-    } else {
-      return false;
-    }
-    return true;
-  }
-};
-
 template <>
 struct Converter<blink::WebCssOrigin> {
   static bool FromV8(v8::Isolate* isolate,
@@ -132,7 +112,7 @@ bool SpellCheckWord(content::RenderFrame* render_frame,
 
 #endif
 
-class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {
+class ScriptExecutionCallback {
  public:
   // for compatibility with the older version of this, error is after result
   using CompletionCallback =
@@ -144,7 +124,7 @@ class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {
       CompletionCallback callback)
       : promise_(std::move(promise)), callback_(std::move(callback)) {}
 
-  ~ScriptExecutionCallback() override = default;
+  ~ScriptExecutionCallback() = default;
 
   // disable copy
   ScriptExecutionCallback(const ScriptExecutionCallback&) = delete;
@@ -193,8 +173,7 @@ class ScriptExecutionCallback : public blink::WebScriptExecutionCallback {
     }
   }
 
-  void Completed(
-      const blink::WebVector<v8::Local<v8::Value>>& result) override {
+  void Completed(const blink::WebVector<v8::Local<v8::Value>>& result) {
     v8::Isolate* isolate = promise_.isolate();
     if (!result.empty()) {
       if (!result[0].IsEmpty()) {
@@ -660,13 +639,20 @@ class WebFrameRenderer : public gin::Wrappable<WebFrameRenderer>,
     ScriptExecutionCallback::CompletionCallback completion_callback;
     args->GetNext(&completion_callback);
 
+    auto* self = new ScriptExecutionCallback(std::move(promise),
+                                             std::move(completion_callback));
+
     render_frame->GetWebFrame()->RequestExecuteScript(
         blink::DOMWrapperWorld::kMainWorldId, base::make_span(&source, 1),
-        has_user_gesture, blink::WebLocalFrame::kSynchronous,
-        new ScriptExecutionCallback(std::move(promise),
-                                    std::move(completion_callback)),
+        has_user_gesture ? blink::mojom::UserActivationOption::kActivate
+                         : blink::mojom::UserActivationOption::kDoNotActivate,
+        blink::mojom::EvaluationTiming::kSynchronous,
+        blink::mojom::LoadEventBlockingOption::kDoNotBlock,
+        base::NullCallback(),
+        base::BindOnce(&ScriptExecutionCallback::Completed,
+                       base::Unretained(self)),
         blink::BackForwardCacheAware::kAllow,
-        blink::WebLocalFrame::PromiseBehavior::kDontWait);
+        blink::mojom::PromiseResultOption::kDoNotWait);
 
     return handle;
   }
@@ -692,9 +678,19 @@ class WebFrameRenderer : public gin::Wrappable<WebFrameRenderer>,
     bool has_user_gesture = false;
     args->GetNext(&has_user_gesture);
 
-    blink::WebLocalFrame::ScriptExecutionType scriptExecutionType =
-        blink::WebLocalFrame::kSynchronous;
-    args->GetNext(&scriptExecutionType);
+    blink::mojom::EvaluationTiming script_execution_type =
+        blink::mojom::EvaluationTiming::kSynchronous;
+    blink::mojom::LoadEventBlockingOption load_blocking_option =
+        blink::mojom::LoadEventBlockingOption::kDoNotBlock;
+    std::string execution_type;
+    args->GetNext(&execution_type);
+
+    if (execution_type == "asynchronous") {
+      script_execution_type = blink::mojom::EvaluationTiming::kAsynchronous;
+    } else if (execution_type == "asynchronousBlockingOnload") {
+      script_execution_type = blink::mojom::EvaluationTiming::kAsynchronous;
+      load_blocking_option = blink::mojom::LoadEventBlockingOption::kBlock;
+    }
 
     ScriptExecutionCallback::CompletionCallback completion_callback;
     args->GetNext(&completion_callback);
@@ -724,13 +720,19 @@ class WebFrameRenderer : public gin::Wrappable<WebFrameRenderer>,
                            blink::WebURL(GURL(url)));
     }
 
+    // Deletes itself.
+    auto* self = new ScriptExecutionCallback(std::move(promise),
+                                             std::move(completion_callback));
+
     render_frame->GetWebFrame()->RequestExecuteScript(
-        world_id, base::make_span(sources), has_user_gesture,
-        scriptExecutionType,
-        new ScriptExecutionCallback(std::move(promise),
-                                    std::move(completion_callback)),
+        world_id, base::make_span(sources),
+        has_user_gesture ? blink::mojom::UserActivationOption::kActivate
+                         : blink::mojom::UserActivationOption::kDoNotActivate,
+        script_execution_type, load_blocking_option, base::NullCallback(),
+        base::BindOnce(&ScriptExecutionCallback::Completed,
+                       base::Unretained(self)),
         blink::BackForwardCacheAware::kPossiblyDisallow,
-        blink::WebLocalFrame::PromiseBehavior::kDontWait);
+        blink::mojom::PromiseResultOption::kDoNotWait);
 
     return handle;
   }

+ 2 - 2
shell/renderer/electron_api_service_impl.cc

@@ -107,8 +107,8 @@ ElectronApiServiceImpl::ElectronApiServiceImpl(
     RendererClientBase* renderer_client)
     : content::RenderFrameObserver(render_frame),
       renderer_client_(renderer_client) {
-  registry_.AddInterface(base::BindRepeating(&ElectronApiServiceImpl::BindTo,
-                                             base::Unretained(this)));
+  registry_.AddInterface<mojom::ElectronRenderer>(base::BindRepeating(
+      &ElectronApiServiceImpl::BindTo, base::Unretained(this)));
 }
 
 void ElectronApiServiceImpl::BindTo(

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