Browse Source

chore: bump chromium to 85.0.4183.19 (10-x-y) (#24299)

* chore: bump chromium in DEPS to 85.0.4182.1

* chore: bump chromium in DEPS to 85.0.4183.2

* chore: bump chromium in DEPS to 85.0.4183.4

* chore: bump chromium in DEPS to 85.0.4183.5

* update patches

* chore: bump chromium in DEPS to 85.0.4183.6

* chore: bump chromium in DEPS to 85.0.4183.7

* update patches

* chore: bump chromium in DEPS to 85.0.4183.8

* remove chromeos-only TtsControllerDelegate

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2255314
(cherry picked from commit f975f84a3c63204b3b20fe90e7f38731b59b0aef)

* rename GetHighContrastColorScheme -> GetPlatformHighContrastColorScheme

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2250224
(cherry picked from commit 014b4872584a0f6da4ab982255def175522cbe75)

* add max_xcode_version build var

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2264867
(cherry picked from commit 2c3b94f4973697b8017c601e1008393cc9442f87)

* add empty floc blocklist to BrowserProcessImpl

Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2240873
(cherry picked from commit 3cdaae146df155cc00a95e71922a6fdc5a449bf1)

* Move zygote from //services/service_manager back to //content

https://chromium-review.googlesource.com/c/chromium/src/+/2252466
(cherry picked from commit e0d6dbcf1e2f87ca5a3a02b89b8fdbf4d64a29e1)

* Reland "[base] Stop including check.h, notreached.h, etc. in logging.h"

https://chromium-review.googlesource.com/c/chromium/src/+/2264297
(cherry picked from commit 1407040133c1279c4eb3cf59192070e44b64db4f)

* Update mas private api patch

* Reland "Reland "New toolchain for Windows 10 19041 SDK""

https://chromium-review.googlesource.com/c/chromium/src/+/2255527
(cherry picked from commit 8101d956f50c222f8527f8aece885d2a1a22ac56)

* [XProto] Remove usage of Shape extension

https://chromium-review.googlesource.com/c/chromium/src/+/2262113
(cherry picked from commit 72b6f11958ed931420c28e10640f2bcd87f0cf22)

* chore: bump chromium in DEPS to 85.0.4183.9

* chore: bump chromium in DEPS to 85.0.4183.10

* chore: bump chromium in DEPS to 85.0.4183.11

* chore: bump chromium in DEPS to 85.0.4183.12

* chore: bump chromium in DEPS to 85.0.4183.13

* update patches

* fixup! add empty floc blocklist to BrowserProcessImpl

(cherry picked from commit 07b0b65c1d2fb3945ffebb934e7ba222cc248c50)

* fixup! Reland "[base] Stop including check.h, notreached.h, etc. in logging.h"

(cherry picked from commit f91c1ab1628a60695f59e542920f2ff4ef8084fb)

* Check for GDI exhaustion if window creation fails

https://chromium-review.googlesource.com/c/chromium/src/+/2244124
(cherry picked from commit 3d45d7b78c0f1492aba0ccf626b10c9f47736c5a)

* chore: bump chromium in DEPS to 85.0.4183.14

* Fixup lint issue

* update patches

* fix: include missing header file

* chore: bump chromium in DEPS to 85.0.4183.19

* update patches

* refactor: match upstream print preview handling (#24452)

(cherry picked from commit 004e29ad334c41cf9a653a195da820db9443e7ea)

* use PrintHostMsg_DidPreviewPage_Params

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

Co-authored-by: Andy Locascio <[email protected]>
Co-authored-by: Electron Bot <[email protected]>
Co-authored-by: deepak1556 <[email protected]>
Co-authored-by: John Kleinschmidt <[email protected]>
Co-authored-by: Shelley Vohr <[email protected]>
Electron Bot 4 years ago
parent
commit
d608a30015
77 changed files with 482 additions and 410 deletions
  1. 5 2
      DEPS
  2. 1 1
      appveyor.yml
  3. 0 7
      chromium_src/BUILD.gn
  4. 6 3
      docs/api/web-contents.md
  5. 9 2
      lib/browser/api/web-contents.js
  6. 1 5
      patches/chromium/.patches
  7. 2 2
      patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
  8. 9 9
      patches/chromium/add_didinstallconditionalfeatures.patch
  9. 6 6
      patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch
  10. 5 5
      patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch
  11. 5 5
      patches/chromium/allow_setting_secondary_label_via_simplemenumodel.patch
  12. 1 1
      patches/chromium/blink_local_frame.patch
  13. 1 1
      patches/chromium/blink_world_context.patch
  14. 1 1
      patches/chromium/build_gn.patch
  15. 16 16
      patches/chromium/can_create_window.patch
  16. 2 2
      patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch
  17. 2 2
      patches/chromium/content_browser_main_loop.patch
  18. 5 5
      patches/chromium/dcheck.patch
  19. 6 6
      patches/chromium/delay_lock_the_protocol_scheme_registry.patch
  20. 2 2
      patches/chromium/disable-redraw-lock.patch
  21. 22 22
      patches/chromium/disable_color_correct_rendering.patch
  22. 0 28
      patches/chromium/disable_dcheck_that_fails_with_software_compositing.patch
  23. 1 1
      patches/chromium/disable_hidden.patch
  24. 4 4
      patches/chromium/expose_setuseragent_on_networkcontext.patch
  25. 3 3
      patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch
  26. 8 8
      patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
  27. 4 4
      patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch
  28. 0 23
      patches/chromium/fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
  29. 0 28
      patches/chromium/fix_handling_non_client_pointer_events_from_pen_on_windows_10.patch
  30. 30 0
      patches/chromium/fix_include_missing_header_file.patch
  31. 1 1
      patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
  32. 11 11
      patches/chromium/frame_host_manager.patch
  33. 2 2
      patches/chromium/gpu_notify_when_dxdiag_request_fails.patch
  34. 2 2
      patches/chromium/gritsettings_resource_ids.patch
  35. 3 3
      patches/chromium/mas_disable_custom_window_frame.patch
  36. 1 1
      patches/chromium/mas_disable_remote_accessibility.patch
  37. 4 4
      patches/chromium/mas_disable_remote_layer.patch
  38. 80 31
      patches/chromium/mas_no_private_api.patch
  39. 10 10
      patches/chromium/network_service_allow_remote_certificate_verification_logic.patch
  40. 1 1
      patches/chromium/notification_provenance.patch
  41. 4 4
      patches/chromium/printing.patch
  42. 3 3
      patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
  43. 0 20
      patches/chromium/remove_menu_window_task_item.patch
  44. 3 3
      patches/chromium/resource_file_conflict.patch
  45. 7 7
      patches/chromium/revert_remove_contentrendererclient_shouldfork.patch
  46. 2 2
      patches/chromium/scroll_bounce_flag.patch
  47. 2 2
      patches/chromium/support_mixed_sandbox_with_zygote.patch
  48. 0 30
      patches/chromium/tts.patch
  49. 1 1
      patches/chromium/ui_gtk_public_header.patch
  50. 2 2
      patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch
  51. 1 1
      patches/chromium/use_electron_resources_in_pdf_util.patch
  52. 1 1
      patches/chromium/web_contents.patch
  53. 2 2
      patches/chromium/webview_cross_drag.patch
  54. 8 8
      patches/chromium/worker_context_will_destroy.patch
  55. 3 3
      patches/v8/add_realloc.patch
  56. 1 1
      patches/v8/build_gn.patch
  57. 4 4
      patches/v8/dcheck.patch
  58. 1 1
      patches/v8/do_not_export_private_v8_symbols_on_windows.patch
  59. 1 1
      patches/v8/expose_mksnapshot.patch
  60. 2 2
      shell/browser/api/electron_api_native_theme.cc
  61. 2 1
      shell/browser/api/electron_api_power_monitor_win.cc
  62. 2 2
      shell/browser/api/electron_api_system_preferences.cc
  63. 2 1
      shell/browser/api/electron_api_system_preferences_win.cc
  64. 6 0
      shell/browser/browser_process_impl.cc
  65. 1 0
      shell/browser/browser_process_impl.h
  66. 3 10
      shell/browser/electron_browser_client.cc
  67. 2 1
      shell/browser/electron_browser_client.h
  68. 15 8
      shell/browser/native_window_views.cc
  69. 1 0
      shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc
  70. 1 1
      shell/browser/notifications/win/win32_desktop_notifications/toast.h
  71. 3 0
      shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc
  72. 89 13
      shell/browser/printing/print_preview_message_handler.cc
  73. 16 1
      shell/browser/printing/print_preview_message_handler.h
  74. 2 1
      shell/browser/ui/win/notify_icon_host.cc
  75. 1 1
      shell/common/node_includes.h
  76. 1 0
      shell/common/v8_value_converter.cc
  77. 15 2
      spec-main/api-web-contents-spec.ts

+ 5 - 2
DEPS

@@ -8,12 +8,13 @@ gclient_gn_args = [
   'checkout_pgo_profiles',
   'checkout_oculus_sdk',
   'checkout_openxr',
-  'checkout_google_benchmark'
+  'checkout_google_benchmark',
+  'mac_xcode_version',
 ]
 
 vars = {
   'chromium_version':
-    '85.0.4181.1',
+    '85.0.4183.19',
   'node_version':
     'v12.16.3',
   'nan_version':
@@ -51,6 +52,8 @@ vars = {
   # Python "requests" module is used for releases only.
   'checkout_requests': False,
 
+  'mac_xcode_version': 'default',
+
   # To allow running hooks without parsing the DEPS tree
   'process_deps': True,
 

+ 1 - 1
appveyor.yml

@@ -29,7 +29,7 @@
 
 version: 1.0.{build}
 build_cloud: electron-16-core
-image: vs2019bt-16.4.0
+image: vs2019bt-16.6.2
 environment:
   GIT_CACHE_PATH: C:\Users\electron\libcc_cache
   ELECTRON_OUT_DIR: Default

+ 0 - 7
chromium_src/BUILD.gn

@@ -161,13 +161,6 @@ static_library("chrome") {
     }
   }
 
-  if (enable_tts) {
-    sources += [
-      "//chrome/browser/speech/tts_controller_delegate_impl.cc",
-      "//chrome/browser/speech/tts_controller_delegate_impl.h",
-    ]
-  }
-
   if (enable_widevine) {
     sources += [
       "//chrome/renderer/media/chrome_key_systems.cc",

+ 6 - 3
docs/api/web-contents.md

@@ -1371,6 +1371,8 @@ An example of `webContents.printToPDF`:
 ```javascript
 const { BrowserWindow } = require('electron')
 const fs = require('fs')
+const path = require('path')
+const os = require('os')
 
 let win = new BrowserWindow({ width: 800, height: 600 })
 win.loadURL('http://github.com')
@@ -1378,12 +1380,13 @@ win.loadURL('http://github.com')
 win.webContents.on('did-finish-load', () => {
   // Use default printing options
   win.webContents.printToPDF({}).then(data => {
-    fs.writeFile('/tmp/print.pdf', data, (error) => {
+    const pdfPath = path.join(os.homedir(), 'Desktop', 'temp.pdf')
+    fs.writeFile(pdfPath, data, (error) => {
       if (error) throw error
-      console.log('Write PDF successfully.')
+      console.log(`Wrote PDF successfully to ${pdfPath}`)
     })
   }).catch(error => {
-    console.log(error)
+    console.log(`Failed to write PDF to ${pdfPath}: `, error)
   })
 })
 ```

+ 9 - 2
lib/browser/api/web-contents.js

@@ -215,7 +215,9 @@ WebContents.prototype.executeJavaScriptInIsolatedWorld = async function (code, h
 };
 
 // Translate the options of printToPDF.
-WebContents.prototype.printToPDF = function (options) {
+
+let pendingPromise;
+WebContents.prototype.printToPDF = async function (options) {
   const printSettings = {
     ...defaultPrintingSetting,
     requestID: getNextId()
@@ -341,7 +343,12 @@ WebContents.prototype.printToPDF = function (options) {
   // PrinterType enum from //printing/print_job_constants.h
   printSettings.printerType = 2;
   if (this._printToPDF) {
-    return this._printToPDF(printSettings);
+    if (pendingPromise) {
+      pendingPromise = pendingPromise.then(() => this._printToPDF(printSettings));
+    } else {
+      pendingPromise = this._printToPDF(printSettings);
+    }
+    return pendingPromise;
   } else {
     const error = new Error('Printing feature is disabled');
     return Promise.reject(error);

+ 1 - 5
patches/chromium/.patches

@@ -44,7 +44,6 @@ notification_provenance.patch
 content_browser_main_loop.patch
 dump_syms.patch
 command-ismediakey.patch
-tts.patch
 printing.patch
 support_mixed_sandbox_with_zygote.patch
 fix_disable_usage_of_abort_report_np_in_mas_builds.patch
@@ -84,7 +83,6 @@ delay_lock_the_protocol_scheme_registry.patch
 gpu_notify_when_dxdiag_request_fails.patch
 feat_allow_embedders_to_add_observers_on_created_hunspell.patch
 feat_add_onclose_to_messageport.patch
-fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
 web_contents.patch
 ui_gtk_public_header.patch
 crash_allow_setting_more_options.patch
@@ -96,7 +94,5 @@ fix_swap_global_proxies_before_initializing_the_windows_proxies.patch
 allow_setting_secondary_label_via_simplemenumodel.patch
 refactor_expose_cursor_changes_to_the_webcontentsobserver.patch
 disable_unnecessary_ischromefirstrun_check.patch
-disable_dcheck_that_fails_with_software_compositing.patch
-fix_handling_non_client_pointer_events_from_pen_on_windows_10.patch
-remove_menu_window_task_item.patch
 use_electron_resources_in_icon_reader_service.patch
+fix_include_missing_header_file.patch

+ 2 - 2
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 b502af8bb93dd45b5de046850f69ef34f9d04732..a6c84cd7909c6a1c70f3f4b5bd65531bf26f1a94 100644
+index 82f55455fe365f54bdc3eefac8bd538af13f642d..5da552f02472299e09bc33c5ab0aa184b62953a4 100644
 --- a/content/gpu/gpu_main.cc
 +++ b/content/gpu/gpu_main.cc
 @@ -255,6 +255,10 @@ int GpuMain(const MainFunctionParams& parameters) {
@@ -24,7 +24,7 @@ index b502af8bb93dd45b5de046850f69ef34f9d04732..a6c84cd7909c6a1c70f3f4b5bd65531b
    // 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
-@@ -373,7 +377,6 @@ int GpuMain(const MainFunctionParams& parameters) {
+@@ -389,7 +393,6 @@ int GpuMain(const MainFunctionParams& parameters) {
    }
  #endif
  

+ 9 - 9
patches/chromium/add_didinstallconditionalfeatures.patch

@@ -23,10 +23,10 @@ index 4e195f960d7b9bf50f6784ce380a84a10867914f..dbf85ffe8504bdbab1c4c29f085e5307
                                          int32_t world_id) {}
    virtual void DidClearWindowObject() {}
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index 5586d724ef30e8183787c1cbba21fe9741d587c5..a5a95523e16fd35018f9646ae4a4d51e5ca626c0 100644
+index 74e98485b4646b5e91ff2c15e85d85205df2851c..55af1205b90a1fce035a6b7abf1797fe20ea1f7b 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -4735,6 +4735,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
+@@ -4741,6 +4741,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
      observer.DidCreateScriptContext(context, world_id);
  }
  
@@ -40,10 +40,10 @@ index 5586d724ef30e8183787c1cbba21fe9741d587c5..a5a95523e16fd35018f9646ae4a4d51e
                                                 int world_id) {
    for (auto& observer : observers_)
 diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
-index 745610204f08a39912b92f8b8ba9028465c9c57f..ddc571fbec08a38ada5c84acdadd618f1b349bed 100644
+index c6d8de45561cbcb6beeb6a28ce0517587b72a030..aef52b00d00392490d43cf7b7ef96ebad7b227e4 100644
 --- a/content/renderer/render_frame_impl.h
 +++ b/content/renderer/render_frame_impl.h
-@@ -721,6 +721,8 @@ class CONTENT_EXPORT RenderFrameImpl
+@@ -719,6 +719,8 @@ class CONTENT_EXPORT RenderFrameImpl
    bool ShouldTrackUseCounter(const blink::WebURL& url) override;
    void DidCreateScriptContext(v8::Local<v8::Context> context,
                                int world_id) override;
@@ -53,10 +53,10 @@ index 745610204f08a39912b92f8b8ba9028465c9c57f..ddc571fbec08a38ada5c84acdadd618f
                                  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 902504b8399c53fee972fe5549a4dbd39274a3c8..ddf6b6b696f7d990b7455ac6c9b8156a733b6c07 100644
+index f0a05ead42b7a5eb70fc4e5cae13710391f14b5c..b1bbdcf6f69128b9943001a2b64e8a92e5148ab1 100644
 --- a/third_party/blink/public/web/web_local_frame_client.h
 +++ b/third_party/blink/public/web/web_local_frame_client.h
-@@ -542,6 +542,9 @@ class BLINK_EXPORT WebLocalFrameClient {
+@@ -550,6 +550,9 @@ class BLINK_EXPORT WebLocalFrameClient {
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) {}
  
@@ -79,7 +79,7 @@ index 5ac9a7ed3d0f91764452579992471c83104de64f..15ac214bc9177f2fc228cf93c459a7b3
    if (World().IsMainWorld()) {
      GetFrame()->Loader().DispatchDidClearWindowObjectInMainWorld();
 diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
-index f9d867fb84e544a2705d22c9fef1f04e639c052b..9b26988f4c7dd96269fd44c57dc9632f47ec409f 100644
+index adc00866f436b59bd50881949379014222d71a50..71631b77c13ea1e6e8a4f558ef5ac5a09886218d 100644
 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
 +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
 @@ -363,6 +363,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -97,7 +97,7 @@ index f9d867fb84e544a2705d22c9fef1f04e639c052b..9b26988f4c7dd96269fd44c57dc9632f
      v8::Local<v8::Context> context,
      int32_t world_id) {
 diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.h b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
-index 183a009cf58399966c9002786ede3d540aa068cb..dbe445cf40ec53e4b36e4a323334662c70359a38 100644
+index 23a196c72164b41bfff97d105957889cce3a7fbe..c702d1dc09b5026ab77a0ba8ec03c4d0cc7c2d67 100644
 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.h
 +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.h
 @@ -78,6 +78,8 @@ class CORE_EXPORT LocalFrameClientImpl final : public LocalFrameClient {
@@ -110,7 +110,7 @@ index 183a009cf58399966c9002786ede3d540aa068cb..dbe445cf40ec53e4b36e4a323334662c
                                  int32_t world_id) override;
  
 diff --git a/third_party/blink/renderer/core/frame/local_frame_client.h b/third_party/blink/renderer/core/frame/local_frame_client.h
-index a8443a8bfc2542ffad472206214279c1223d493f..8c7a4dec19d6fbca615b7bc282b0388189eef886 100644
+index 27ab3b3056c81ca367f45e0a1f7bd74a153353c4..790f7fac77677aad8c1d69c287273a9bf9436ac2 100644
 --- a/third_party/blink/renderer/core/frame/local_frame_client.h
 +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
 @@ -297,6 +297,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {

+ 6 - 6
patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch

@@ -49,10 +49,10 @@ index 6d15b6b5ff7b36b85f6b8200b76a32b285f0e675..c21234572976a6de7db5b0f2f7f44ec7
    // the per-context allow patterns that is managed via NetworkContext
    // interface. This still respects the per-context block lists.
 diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
-index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fbd24e112d 100644
+index 628b38e9db47f9730aebd5dfe9c785ceea28ea0a..6007a8f2d350b8951ba5f2ce910813f044bcf381 100644
 --- a/services/network/url_loader.cc
 +++ b/services/network/url_loader.cc
-@@ -437,6 +437,7 @@ URLLoader::URLLoader(
+@@ -470,6 +470,7 @@ URLLoader::URLLoader(
      base::WeakPtr<KeepaliveStatisticsRecorder> keepalive_statistics_recorder,
      base::WeakPtr<NetworkUsageAccumulator> network_usage_accumulator,
      mojom::TrustedURLLoaderHeaderClient* url_loader_header_client,
@@ -60,7 +60,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
      mojom::OriginPolicyManager* origin_policy_manager,
      std::unique_ptr<TrustTokenRequestHelperFactory> trust_token_helper_factory,
      mojo::PendingRemote<mojom::CookieAccessObserver> cookie_observer)
-@@ -497,6 +498,11 @@ URLLoader::URLLoader(
+@@ -533,6 +534,11 @@ URLLoader::URLLoader(
      header_client_.set_disconnect_handler(
          base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
    }
@@ -72,7 +72,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
    if (want_raw_headers_) {
      options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
                  mojom::kURLLoadOptionSendSSLInfoForCertificateError;
-@@ -1016,7 +1022,7 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
+@@ -1056,7 +1062,7 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
      // |this| may have been deleted.
      return;
    }
@@ -81,7 +81,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
      OnAuthCredentials(base::nullopt);
      return;
    }
-@@ -1032,11 +1038,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
+@@ -1072,11 +1078,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
    if (url_request->response_headers())
      head->headers = url_request->response_headers();
    head->auth_challenge_info = auth_info;
@@ -108,7 +108,7 @@ index 80dc1f91fd4051dc054f1c9e9a5ab0087c4d66fd..4eec90182ae4944f219e12ff2673d0fb
    auth_challenge_responder_receiver_.set_disconnect_handler(
        base::BindOnce(&URLLoader::DeleteSelf, base::Unretained(this)));
 diff --git a/services/network/url_loader.h b/services/network/url_loader.h
-index f5436f10a312c713e95fac4670eab3edf048a742..02212de14459ee6cd15492e7b35cd2791f48205c 100644
+index 33e6b100ef3ebfea62a9445bb8aa4b45034f7f25..b70780428d056e5306e215ba7d86a2e729ffaeda 100644
 --- a/services/network/url_loader.h
 +++ b/services/network/url_loader.h
 @@ -115,6 +115,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader

+ 5 - 5
patches/chromium/allow_new_privileges_in_unsandboxed_child_processes.patch

@@ -6,19 +6,19 @@ Subject: allow new privileges in unsandboxed child processes
 This allows unsandboxed renderers to launch setuid processes on Linux.
 
 diff --git a/content/browser/child_process_launcher_helper_linux.cc b/content/browser/child_process_launcher_helper_linux.cc
-index e53e60ef146f8024e503f9ffad663a4d2dbc4f80..cee204cf6447c4b2a8cfd9c4ca257fe46af3e2e9 100644
+index e63dfcf43147c7174942277b2c129675014c9e59..7121ec638809c5964d22af496559cb7f46c794ef 100644
 --- a/content/browser/child_process_launcher_helper_linux.cc
 +++ b/content/browser/child_process_launcher_helper_linux.cc
-@@ -54,6 +54,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
+@@ -53,6 +53,18 @@ bool ChildProcessLauncherHelper::BeforeLaunchOnLauncherThread(
+   if (GetProcessType() == switches::kRendererProcess) {
      const int sandbox_fd = SandboxHostLinux::GetInstance()->GetChildSocket();
-     options->fds_to_remap.push_back(
-         std::make_pair(sandbox_fd, service_manager::GetSandboxFD()));
+     options->fds_to_remap.push_back(std::make_pair(sandbox_fd, GetSandboxFD()));
 +
 +    // (For Electron), if we're launching without zygote, that means we're
 +    // launching an unsandboxed process (since all sandboxed processes are
 +    // forked from the zygote). Relax the allow_new_privs option to permit
 +    // launching suid processes from unsandboxed renderers.
-+    service_manager::ZygoteHandle zygote_handle =
++    ZygoteHandle zygote_handle =
 +        base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoZygote)
 +            ? nullptr
 +            : delegate_->GetZygote();

+ 5 - 5
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 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10ce93fcdb8 100644
+index 1fc029cb37562dc32a961666c3af3b0c27b04e5a..e1c6fe2ea2c3c89e10ff4ae27d16baf053e8a3a0 100644
 --- a/ui/base/models/simple_menu_model.cc
 +++ b/ui/base/models/simple_menu_model.cc
 @@ -49,6 +49,11 @@ base::string16 SimpleMenuModel::Delegate::GetLabelForCommandId(
@@ -33,7 +33,7 @@ index 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10c
  void SimpleMenuModel::SetMinorText(int index,
                                     const base::string16& minor_text) {
    items_[ValidateItemIndex(index)].minor_text = minor_text;
-@@ -364,6 +374,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
+@@ -368,6 +378,12 @@ base::string16 SimpleMenuModel::GetLabelAt(int index) const {
    return items_[ValidateItemIndex(index)].label;
  }
  
@@ -47,7 +47,7 @@ index 88053e9d501413d18b6a6ae36b76668431db7ee9..481a04c4835d246cfa20edfc4f1dd10c
    return items_[ValidateItemIndex(index)].minor_text;
  }
 diff --git a/ui/base/models/simple_menu_model.h b/ui/base/models/simple_menu_model.h
-index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027057546cd 100644
+index 3067f9beba9e79e18d341aea052d82aad34039d0..ffd8d7c53378b490e54af430371dc8a44121f72b 100644
 --- a/ui/base/models/simple_menu_model.h
 +++ b/ui/base/models/simple_menu_model.h
 @@ -44,6 +44,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
@@ -68,7 +68,7 @@ index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027
    // Sets the minor text for the item at |index|.
    void SetMinorText(int index, const base::string16& minor_text);
  
-@@ -173,6 +177,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
+@@ -176,6 +180,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
    ui::MenuSeparatorType GetSeparatorTypeAt(int index) const override;
    int GetCommandIdAt(int index) const override;
    base::string16 GetLabelAt(int index) const override;
@@ -76,7 +76,7 @@ index 92975ff7dc5c5ca217717da6faa0042467076005..84cf58456cd8a879dbf5940737713027
    base::string16 GetMinorTextAt(int index) const override;
    ImageModel GetMinorIconAt(int index) const override;
    bool IsItemDynamicAt(int index) const override;
-@@ -207,6 +212,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
+@@ -211,6 +216,7 @@ class COMPONENT_EXPORT(UI_BASE) SimpleMenuModel : public MenuModel {
      int command_id = 0;
      ItemType type = TYPE_COMMAND;
      base::string16 label;

+ 1 - 1
patches/chromium/blink_local_frame.patch

@@ -14,7 +14,7 @@ when there is code doing that.
 This patch reverts the change to fix the crash in Electron.
 
 diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc
-index 657034319731c660e5c513be7d92bab280c9dee0..1c51cab672063a2b9ac8a63d6c42a7c4451e5879 100644
+index 81585d785de936e300af913a0f37d90d3e1b62fb..d80e2b34ee8397f8880135dbc1a25622fb5e9dc2 100644
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
 @@ -538,10 +538,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {

+ 1 - 1
patches/chromium/blink_world_context.patch

@@ -20,7 +20,7 @@ index be5efdc896fd9318b50c9e5ad02ec404ba7be23d..79234d0def2d4e97e05a03ecb1dbd7b0
    // Executes script in the context of the current page and returns the value
    // that the script evaluated to with callback. Script execution can be
 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 857f31b2d7af86138b8b5cfd8b7131f2524bc94e..4891f5aa60469b224c933adaa334eef8ac8a19ec 100644
+index b94a424b644e5ccb2214499e708187427e80c701..9460471d34336f7b33c2e368f0da393d2a180edf 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
 @@ -967,6 +967,13 @@ v8::Local<v8::Object> WebLocalFrameImpl::GlobalProxy() const {

+ 1 - 1
patches/chromium/build_gn.patch

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

+ 16 - 16
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/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
-index 33869e7bf3aa6dd404f8413b817e544fb404bb43..98cfc99a3c917f9b6e7bc3b5c19479b81c114489 100644
+index 4c04d36846d8fe26811aba2389abe177d07dab71..1cc23d34b7ff242e5bcac9089a41ae9b18cb935b 100644
 --- a/content/browser/frame_host/render_frame_host_impl.cc
 +++ b/content/browser/frame_host/render_frame_host_impl.cc
-@@ -4809,6 +4809,7 @@ void RenderFrameHostImpl::CreateNewWindow(
+@@ -4796,6 +4796,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,7 +21,7 @@ index 33869e7bf3aa6dd404f8413b817e544fb404bb43..98cfc99a3c917f9b6e7bc3b5c19479b8
            &no_javascript_access);
  
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 33072ecef6bcfb751ce81cf46e2609bddcca065b..1f5f7f217a7cb4013f6bfbb380b2b81214cc92b0 100644
+index 1afd8ac2c2cf78efa1386b89227e4a5d2ca0ce60..4a576f48e677c7d91726e9c59dd4a24a4d64c792 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
 @@ -3087,9 +3087,9 @@ RenderFrameHostDelegate* WebContentsImpl::CreateNewWindow(
@@ -38,7 +38,7 @@ index 33072ecef6bcfb751ce81cf46e2609bddcca065b..1f5f7f217a7cb4013f6bfbb380b2b812
  
    for (auto& observer : observers_) {
 diff --git a/content/common/frame.mojom b/content/common/frame.mojom
-index 322e2f0f4f023cd2e34163f623c5b52eaad51c1d..46ae29207c804ae3474ae3a3dd8f76de93a1deb0 100644
+index 118a262e5e18c22df6a01312b9f99b235d60ae50..329a92f9c0089cf8f94c7cd2fe990204c670419c 100644
 --- a/content/common/frame.mojom
 +++ b/content/common/frame.mojom
 @@ -277,6 +277,10 @@ struct CreateNewWindowParams {
@@ -53,7 +53,7 @@ index 322e2f0f4f023cd2e34163f623c5b52eaad51c1d..46ae29207c804ae3474ae3a3dd8f76de
  
  // 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 20df2e7f81543d666c8c9136bd3bd0a3fcd318ea..a0ea7c6100eb437bf1c409ddad3bb5bbe1f3acb8 100644
+index 87375b2ef10c24b5d8d0f604f6a9ee601a706a0c..84ca4325a72a5c4267d43e5be9bfd7b73efa0b86 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
 @@ -529,6 +529,8 @@ bool ContentBrowserClient::CanCreateWindow(
@@ -66,10 +66,10 @@ index 20df2e7f81543d666c8c9136bd3bd0a3fcd318ea..a0ea7c6100eb437bf1c409ddad3bb5bb
      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 28be6be2dd20b7beb6e0ef7830396b6d11ac4985..31a0a2b60dd96ede0beba95e8d1df65ed744cf83 100644
+index edf60410ba571866b03968804543188f7f00c088..00f3f557ccf69760c4e0ac7c9fcc7d048e21e8d8 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -146,6 +146,7 @@ class NetworkService;
+@@ -147,6 +147,7 @@ class NetworkService;
  class TrustedURLLoaderHeaderClient;
  }  // namespace mojom
  struct ResourceRequest;
@@ -77,7 +77,7 @@ index 28be6be2dd20b7beb6e0ef7830396b6d11ac4985..31a0a2b60dd96ede0beba95e8d1df65e
  }  // namespace network
  
  namespace sandbox {
-@@ -845,6 +846,8 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -849,6 +850,8 @@ class CONTENT_EXPORT ContentBrowserClient {
        const std::string& frame_name,
        WindowOpenDisposition disposition,
        const blink::mojom::WindowFeatures& features,
@@ -135,7 +135,7 @@ index e545ff70c612e98cdd79230303273a3ec7bfcaac..405152e0e90bc76b7de9c3e6946944f3
    // 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 29220e08371ad0f7a400c81bd024c55130430767..57447f4529917692155d1861c7658156978fa0be 100644
+index c6a990f873066fec1ac7ce5e088ecd02d2142e71..272b613f658ef4bfa3869cbd17d342ceef665142 100644
 --- a/content/renderer/render_view_impl.cc
 +++ b/content/renderer/render_view_impl.cc
 @@ -67,6 +67,7 @@
@@ -146,7 +146,7 @@ index 29220e08371ad0f7a400c81bd024c55130430767..57447f4529917692155d1861c7658156
  #include "content/renderer/media/audio/audio_device_factory.h"
  #include "content/renderer/render_frame_impl.h"
  #include "content/renderer/render_frame_proxy.h"
-@@ -1238,6 +1239,10 @@ WebView* RenderViewImpl::CreateView(
+@@ -1235,6 +1236,10 @@ WebView* RenderViewImpl::CreateView(
    }
    params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
  
@@ -158,10 +158,10 @@ index 29220e08371ad0f7a400c81bd024c55130430767..57447f4529917692155d1861c7658156
    // moved on send.
    bool is_background_tab =
 diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
-index 021b06878da520d5e5576cb01c60a4a2e017b9ad..71d9fc7215180a47b45c924ed95fb8619db598f6 100644
+index 1d17a41e553bf4d7181a1dcfac9f9e379b6dffcb..384d7150daaeda547e0085e3031b706784ceb7dd 100644
 --- a/content/shell/browser/web_test/web_test_content_browser_client.cc
 +++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
-@@ -400,6 +400,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
+@@ -399,6 +399,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,
@@ -171,7 +171,7 @@ index 021b06878da520d5e5576cb01c60a4a2e017b9ad..71d9fc7215180a47b45c924ed95fb861
      bool opener_suppressed,
      bool* no_javascript_access) {
 diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
-index 45b6bbbd41bbe19a39edb83b6ced844cb4c97244..90b5c696f4cc6b77d1377a628c9d8166c773bb60 100644
+index 21f7e0d85006bc35872c237b98a14d9644bb1488..d3fef30d9731e4cc6cfe404003b9b1fa8cea53e1 100644
 --- a/content/shell/browser/web_test/web_test_content_browser_client.h
 +++ b/content/shell/browser/web_test/web_test_content_browser_client.h
 @@ -79,6 +79,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
@@ -206,14 +206,14 @@ index 4f735ad0d97eaac9a57dad137e479f8a7ec33a36..0a3c5821962c85609b64b3625fa6b8d6
  
  }  // 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 5aa89ed53435a5a417adfa05ae503c0cb0520ccf..0a82d2afa8d7896ddb7ea206617c59959a9dd40c 100644
+index 314bc6c11a62bf0cc10c2323183caf97c1e2de16..df08ad7696358c70b2644ad07caefa913ceeeb30 100644
 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc
 +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc
-@@ -1968,6 +1968,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
+@@ -2011,6 +2011,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate,
    }
  
    WebWindowFeatures window_features = GetWindowFeaturesFromString(features);
 +  window_features.raw_features = features;
  
-   FrameLoadRequest frame_request(active_document,
+   FrameLoadRequest frame_request(incumbent_window->document(),
                                   ResourceRequest(completed_url));

+ 2 - 2
patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch

@@ -7,10 +7,10 @@ spellchecker uses a few IDS_ resources.  We need to load these from
 Electrons grit header instead of Chromes
 
 diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
-index 5d7ff1a26faf83c8f82a58787e17d8923f7b9ea1..137d924523ade90bdf4e788f49f7b1c5b3e2e382 100644
+index 5e69beac0bf4202b17ab1102423f0a051a8497f5..58f4d908ba638e97b4b961f5605ceba22680168c 100644
 --- a/chrome/browser/BUILD.gn
 +++ b/chrome/browser/BUILD.gn
-@@ -5500,6 +5500,7 @@ static_library("browser") {
+@@ -5520,6 +5520,7 @@ static_library("browser") {
      deps += [
        "//components/spellcheck/browser",
        "//components/spellcheck/common",

+ 2 - 2
patches/chromium/content_browser_main_loop.patch

@@ -8,10 +8,10 @@ run before shutdown. This is required to cleanup WebContents asynchronously
 in atom::CommonWebContentsDelegate::ResetManageWebContents.
 
 diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
-index 706532cbccd96863d270a35ff87d555b7d648f41..cfee983c0a8c12620a17d1ad7a9a77784c9dfc3c 100644
+index 4ada8596176e8581f8e5db15f91c1cd70f41d7e9..4d600e5d34a0a7514c17c7d02bdabdc796660c9a 100644
 --- a/content/browser/browser_main_loop.cc
 +++ b/content/browser/browser_main_loop.cc
-@@ -1432,7 +1432,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
+@@ -1436,7 +1436,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
    NOTREACHED();
  #else
    base::RunLoop run_loop;

+ 5 - 5
patches/chromium/dcheck.patch

@@ -17,10 +17,10 @@ only one or two specific checks fail. Then it's better to simply comment out the
 failing checks and allow the rest of the target to have them enabled.
 
 diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
-index 25e5a2c20452da3db4c648dfa678d8bd1f7d01cc..5947254f096c78d0ac4b97e4700a77cd2461ba96 100644
+index d6c77f00ee6fb5f0a21d2d3df2bc00aea3f7e5dc..f8aade234eab49e3600e5d78d9ce71af66646ba3 100644
 --- a/content/browser/frame_host/navigation_controller_impl.cc
 +++ b/content/browser/frame_host/navigation_controller_impl.cc
-@@ -1264,8 +1264,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
+@@ -1267,8 +1267,10 @@ NavigationType NavigationControllerImpl::ClassifyNavigation(
      return NAVIGATION_TYPE_NEW_SUBFRAME;
    }
  
@@ -33,7 +33,7 @@ index 25e5a2c20452da3db4c648dfa678d8bd1f7d01cc..5947254f096c78d0ac4b97e4700a77cd
  
    if (rfh->GetParent()) {
      // All manual subframes would be did_create_new_entry and handled above, so
-@@ -1521,7 +1523,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
+@@ -1524,7 +1526,10 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
      new_entry->GetFavicon() = GetLastCommittedEntry()->GetFavicon();
    }
  
@@ -46,10 +46,10 @@ index 25e5a2c20452da3db4c648dfa678d8bd1f7d01cc..5947254f096c78d0ac4b97e4700a77cd
    // navigation. Now we know that the renderer has updated its state accordingly
    // and it is safe to also clear the browser side history.
 diff --git a/ui/base/clipboard/clipboard_win.cc b/ui/base/clipboard/clipboard_win.cc
-index 9bfabd34eabcaf893b674e74e540f9258f1730bb..ea6e9f7b7161f9e3afa463fb8114479d3d10eb6b 100644
+index 421f22eaaf6dbb90c8e3a4bb78d9d017bac8db94..959666ba60c97e0c2f082867c8ebd77de45d8788 100644
 --- a/ui/base/clipboard/clipboard_win.cc
 +++ b/ui/base/clipboard/clipboard_win.cc
-@@ -773,10 +773,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
+@@ -782,10 +782,10 @@ SkBitmap ClipboardWin::ReadImageInternal(ClipboardBuffer buffer) const {
  
  void ClipboardWin::WriteToClipboard(ClipboardFormatType format, HANDLE handle) {
    UINT cf_format = format.ToFormatEtc().cfFormat;

+ 6 - 6
patches/chromium/delay_lock_the_protocol_scheme_registry.patch

@@ -19,10 +19,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1901591, we should try
 re-submitting the patch.
 
 diff --git a/content/app/content_main_runner_impl.cc b/content/app/content_main_runner_impl.cc
-index 12055944205a9d8de54e6d3ff66e99b723fa5752..b46a9f4ad5f07c2a8e649edbfb52b52f9f6e9946 100644
+index f5e5576fd7455336481111c24b436457e235e43c..4af47c892ce5485ff18de67e1af8962cd7315406 100644
 --- a/content/app/content_main_runner_impl.cc
 +++ b/content/app/content_main_runner_impl.cc
-@@ -663,7 +663,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
+@@ -662,7 +662,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
    }
  #endif
  
@@ -68,10 +68,10 @@ index 3038f9d25798f36811b6398f8cc0e7d83ecc41b0..68189c36c47ef85b345b0ccc40c456f8
  // Re-initializes schemes for tests.
  CONTENT_EXPORT void ReRegisterContentSchemesForTests();
 diff --git a/content/public/app/content_main_delegate.cc b/content/public/app/content_main_delegate.cc
-index ed5b0e2c0b4d453560ee9e2e4a55780b409eeea9..46e29dca5d13691bcf9494c0f90b68d6219a75ef 100644
+index 02985a525c98999f469906c8ff3647b740d9f962..e52e8d69c2d05b31d1f28b19752be362941e52be 100644
 --- a/content/public/app/content_main_delegate.cc
 +++ b/content/public/app/content_main_delegate.cc
-@@ -37,6 +37,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
+@@ -36,6 +36,10 @@ int ContentMainDelegate::TerminateForFatalInitializationError() {
    return 0;
  }
  
@@ -83,10 +83,10 @@ index ed5b0e2c0b4d453560ee9e2e4a55780b409eeea9..46e29dca5d13691bcf9494c0f90b68d6
    return service_manager::ProcessType::kDefault;
  }
 diff --git a/content/public/app/content_main_delegate.h b/content/public/app/content_main_delegate.h
-index 2d9ee9fa20a9aba1de168cc86bfeea5eab71e6d3..4b163c3fa2ddd258b5527e0ccaf9fc9d2621ef75 100644
+index 0ca924769b98009264b53121dfe6a892b81e8530..606a5cb8d89216a95e9187fba2ea9b6d4121a394 100644
 --- a/content/public/app/content_main_delegate.h
 +++ b/content/public/app/content_main_delegate.h
-@@ -77,6 +77,20 @@ class CONTENT_EXPORT ContentMainDelegate {
+@@ -76,6 +76,20 @@ class CONTENT_EXPORT ContentMainDelegate {
    // returning initialization error code. Default behavior is CHECK(false).
    virtual int TerminateForFatalInitializationError();
  

+ 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 a47389ee5387b4d08eb293355eca9ecae41d6522..db101407da7678b61af311791dcc6689a51e35b5 100644
+index db4fe784c7e119111917757b2d1de4d7cc1e5f2b..f6e9f97e47b44fa47e8e6c237be371754a5204bd 100644
 --- a/ui/views/win/hwnd_message_handler.cc
 +++ b/ui/views/win/hwnd_message_handler.cc
 @@ -306,6 +306,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500;
@@ -49,7 +49,7 @@ index a47389ee5387b4d08eb293355eca9ecae41d6522..db101407da7678b61af311791dcc6689
  // HWNDMessageHandler, gfx::WindowImpl overrides:
  
 diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
-index 90aab6ae2d180431912c979dc253791f92f17595..88ee06c3b52c506076f71edbb9cc8e55660a1fba 100644
+index 7118ff56f0dd1c6291e4095ce7f3d8fc723f0398..5dbaab15ee1667ed1caf0b746b8e31d1b12a7b52 100644
 --- a/ui/views/win/hwnd_message_handler.h
 +++ b/ui/views/win/hwnd_message_handler.h
 @@ -203,6 +203,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl,

+ 22 - 22
patches/chromium/disable_color_correct_rendering.patch

@@ -20,7 +20,7 @@ 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 82c14397633c55c4ffc5f09d5bd4fc434afa2759..86c5da137497fc01f141be076efa955188a79790 100644
+index eeab47ebc93b9a75775faee87037049541f71dd6..54c3d886a18d25f02e37686dca123d9256a5af34 100644
 --- a/cc/trees/layer_tree_host_impl.cc
 +++ b/cc/trees/layer_tree_host_impl.cc
 @@ -1862,6 +1862,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw(
@@ -60,7 +60,7 @@ index 8bde4796ebcf40f7f10c62f4005eabb84af9de04..913ab005e582b3d1ab0df8f88ac1df62
    bool force_antialiasing = false;
    bool force_blending_with_shaders = false;
 diff --git a/components/viz/host/renderer_settings_creation.cc b/components/viz/host/renderer_settings_creation.cc
-index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8ce1c02da 100644
+index f28c3218baa08e7ae885567e0ede1d8108f8a373..a5f4a4a10a776fc92a5e9fbc9593563d548ccbc8 100644
 --- a/components/viz/host/renderer_settings_creation.cc
 +++ b/components/viz/host/renderer_settings_creation.cc
 @@ -14,6 +14,7 @@
@@ -71,7 +71,7 @@ index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8
  
  #if defined(OS_MACOSX)
  #include "ui/base/cocoa/remote_layer_api.h"
-@@ -50,6 +51,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
+@@ -51,6 +52,8 @@ bool GetSwitchValueAsInt(const base::CommandLine* command_line,
  RendererSettings CreateRendererSettings() {
    RendererSettings renderer_settings;
    base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
@@ -81,10 +81,10 @@ index 0fc4813b2f76fe6154ebdc60ffabd278bed75653..7423c91d661adcf9e761b93ddbfa4ea8
        !command_line->HasSwitch(switches::kUIDisablePartialSwap);
  #if defined(OS_MACOSX)
 diff --git a/components/viz/service/display/gl_renderer.cc b/components/viz/service/display/gl_renderer.cc
-index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf248e2ada8d 100644
+index 591e5c4e6f7291412a5f05c244d6256a4b4fd57d..2af556050b7fe4ce7404d0c5ce6f2328a1e863fd 100644
 --- a/components/viz/service/display/gl_renderer.cc
 +++ b/components/viz/service/display/gl_renderer.cc
-@@ -85,6 +85,9 @@
+@@ -89,6 +89,9 @@
  
  using gpu::gles2::GLES2Interface;
  
@@ -94,7 +94,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  namespace viz {
  namespace {
  
-@@ -583,8 +586,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
+@@ -587,8 +590,9 @@ void GLRenderer::DoDrawQuad(const DrawQuad* quad,
  void GLRenderer::DrawDebugBorderQuad(const DebugBorderDrawQuad* quad) {
    SetBlendEnabled(quad->ShouldDrawWithBlending());
  
@@ -106,7 +106,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
    // Use the full quad_rect for debug quads to not move the edges based on
    // partial swaps.
-@@ -1554,7 +1558,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
+@@ -1558,7 +1562,8 @@ void GLRenderer::ChooseRPDQProgram(DrawRenderPassDrawQuadParams* params,
            params->use_color_matrix, tint_gl_composited_content_,
            params->apply_shader_based_rounded_corner &&
                ShouldApplyRoundedCorner(params->quad)),
@@ -116,7 +116,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  }
  
  void GLRenderer::UpdateRPDQUniforms(DrawRenderPassDrawQuadParams* params) {
-@@ -2025,7 +2030,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
+@@ -2029,7 +2034,8 @@ void GLRenderer::DrawSolidColorQuad(const SolidColorDrawQuad* quad,
    SetUseProgram(ProgramKey::SolidColor(use_aa ? USE_AA : NO_AA,
                                         tint_gl_composited_content_,
                                         ShouldApplyRoundedCorner(quad)),
@@ -126,7 +126,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
    SetShaderColor(color, opacity);
    if (current_program_->rounded_corner_rect_location() != -1) {
      SetShaderRoundedCorner(
-@@ -2180,7 +2186,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
+@@ -2184,7 +2190,8 @@ void GLRenderer::DrawContentQuadAA(const ContentDrawQuadBase* quad,
                                                : NON_PREMULTIPLIED_ALPHA,
                         false, false, tint_gl_composited_content_,
                         ShouldApplyRoundedCorner(quad)),
@@ -136,7 +136,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
    if (current_program_->tint_color_matrix_location() != -1) {
      auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
-@@ -2276,7 +2283,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
+@@ -2280,7 +2287,8 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
                         !quad->ShouldDrawWithBlending(), has_tex_clamp_rect,
                         tint_gl_composited_content_,
                         ShouldApplyRoundedCorner(quad)),
@@ -146,7 +146,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
    if (current_program_->tint_color_matrix_location() != -1) {
      auto matrix = cc::DebugColors::TintCompositedContentColorTransformMatrix();
-@@ -2378,7 +2386,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
+@@ -2382,7 +2390,8 @@ void GLRenderer::DrawYUVVideoQuad(const YUVVideoDrawQuad* quad,
    // The source color space should never be RGB.
    DCHECK_NE(src_color_space, src_color_space.GetAsFullRangeRGB());
  
@@ -156,7 +156,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
  #if defined(OS_WIN)
    // Force sRGB output on Windows for overlay candidate video quads to match
-@@ -2542,7 +2551,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
+@@ -2546,7 +2555,8 @@ void GLRenderer::DrawStreamVideoQuad(const StreamVideoDrawQuad* quad,
  
    SetUseProgram(ProgramKey::VideoStream(tex_coord_precision,
                                          ShouldApplyRoundedCorner(quad)),
@@ -166,7 +166,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
    DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_));
    gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id());
-@@ -2607,8 +2617,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
+@@ -2611,8 +2621,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
        draw_cache_.nearest_neighbor ? GL_NEAREST : GL_LINEAR);
  
    // Bind the program to the GL state.
@@ -177,7 +177,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
    if (current_program_->rounded_corner_rect_location() != -1) {
      SetShaderRoundedCorner(
-@@ -3347,7 +3357,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
+@@ -3357,7 +3367,9 @@ void GLRenderer::PrepareGeometry(BoundGeometry binding) {
  void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color,
                                 const gfx::ColorSpace& src_color_space,
                                 const gfx::ColorSpace& dst_color_space) {
@@ -188,7 +188,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
    // If the input color space is PQ, and it did not specify a white level,
    // override it with the frame's white level.
-@@ -3729,9 +3741,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
+@@ -3739,9 +3751,9 @@ void GLRenderer::CopyRenderPassDrawQuadToOverlayResource(
          cc::MathUtil::CheckedRoundUp(iosurface_height, iosurface_multiple);
    }
  
@@ -201,7 +201,7 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
    *new_bounds = gfx::RectF(updated_dst_rect.origin(),
                             gfx::SizeF((*overlay_texture)->texture.size()));
  
-@@ -3950,8 +3962,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
+@@ -3960,8 +3972,8 @@ void GLRenderer::FlushOverdrawFeedback(const gfx::Rect& output_rect) {
  
    PrepareGeometry(SHARED_BINDING);
  
@@ -212,17 +212,17 @@ index 9c3432fd618ec5d0fc8aa0d28c73c3e004d25438..c35e322f159ea77b63b8711ad7a7bf24
  
    gfx::Transform render_matrix;
    render_matrix.Translate(0.5 * output_rect.width() + output_rect.x(),
-@@ -4068,3 +4080,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
+@@ -4079,3 +4091,5 @@ gfx::Size GLRenderer::GetRenderPassBackingPixelSize(
  }
  
  }  // namespace viz
 +
 +#undef PATCH_CS
 diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
-index 6ec6024a9447817926acf551e23e6ae84a45eded..395633bb6f00d5363a1540ab67c730e507712f2e 100644
+index 9f9d3422ad128fe3bfc305baa57971bd03e1b676..02747c0d4d7f0bb7ba034f35bcce86a91774bb36 100644
 --- a/content/browser/gpu/gpu_process_host.cc
 +++ b/content/browser/gpu/gpu_process_host.cc
-@@ -210,6 +210,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
+@@ -215,6 +215,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus(
  
  // Command-line switches to propagate to the GPU process.
  static const char* const kSwitchNames[] = {
@@ -231,7 +231,7 @@ index 6ec6024a9447817926acf551e23e6ae84a45eded..395633bb6f00d5363a1540ab67c730e5
      service_manager::switches::kGpuSandboxAllowSysVShm,
      service_manager::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 03c5e4cc58ae9321dc2a89cef43d615ac2023916..1800a97025d03d7fbf8cf5ab7a632277dd32202e 100644
+index e5a82f46cd58b0da9959930ee85303e4a1530425..753b926fbe0c6a3ef2b2e244d7f80f4f4574bc5c 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
 @@ -227,6 +227,7 @@
@@ -242,7 +242,7 @@ index 03c5e4cc58ae9321dc2a89cef43d615ac2023916..1800a97025d03d7fbf8cf5ab7a632277
  #include "ui/gl/gl_switches.h"
  #include "ui/native_theme/native_theme_features.h"
  #include "url/origin.h"
-@@ -3282,6 +3283,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
+@@ -3283,6 +3284,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[] = {
@@ -251,7 +251,7 @@ index 03c5e4cc58ae9321dc2a89cef43d615ac2023916..1800a97025d03d7fbf8cf5ab7a632277
      service_manager::switches::kDisableInProcessStackTraces,
      service_manager::switches::kDisableSeccompFilterSandbox,
 diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
-index d56b2a18c3e1edc5c02ceb99d695dde3023f94dc..9e44fd8e77d5fcf651ab1bd9399317bd58881423 100644
+index 30e6638b9c5bf4b04e73156ee4b0f70a91134010..6a05f399a8a70f5d7f4f04ec9b02968bf2c0ef6d 100644
 --- a/content/renderer/render_widget.cc
 +++ b/content/renderer/render_widget.cc
 @@ -2216,6 +2216,9 @@ cc::LayerTreeSettings RenderWidget::GenerateLayerTreeSettings(

+ 0 - 28
patches/chromium/disable_dcheck_that_fails_with_software_compositing.patch

@@ -1,28 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Deepak Mohan <[email protected]>
-Date: Fri, 22 May 2020 17:58:16 -0700
-Subject: Disable DCHECK that fails with software compositing
-
-Should be removed once https://bugs.chromium.org/p/chromium/issues/detail?id=1084625
-is addressed.
-
-diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index db101407da7678b61af311791dcc6689a51e35b5..6191775ea0566862722741a3c6102867082f33d6 100644
---- a/ui/views/win/hwnd_message_handler.cc
-+++ b/ui/views/win/hwnd_message_handler.cc
-@@ -2421,13 +2421,13 @@ void HWNDMessageHandler::OnPaint(HDC dc) {
-       RECT cr;
-       if (GetClientRect(hwnd(), &cr)) {
-         if (exposed_pixels_.height() > 0) {
--          DCHECK_GE(cr.bottom, exposed_pixels_.height());
-+          //DCHECK_GE(cr.bottom, exposed_pixels_.height());
-           RECT rect = {cr.left, cr.bottom - exposed_pixels_.height(), cr.right,
-                        cr.bottom};
-           FillRect(ps.hdc, &rect, brush);
-         }
-         if (exposed_pixels_.width() > 0) {
--          DCHECK_GE(cr.right, exposed_pixels_.width());
-+          //DCHECK_GE(cr.right, exposed_pixels_.width());
-           RECT rect = {cr.right - exposed_pixels_.width(), cr.top, cr.right,
-                        cr.bottom - exposed_pixels_.height()};
-           FillRect(ps.hdc, &rect, brush);

+ 1 - 1
patches/chromium/disable_hidden.patch

@@ -34,7 +34,7 @@ index 5f3f2feec8c787ff1e086bf256ef9353732037af..a127ec54042ef869f0e19ba6b86b86d4
        const base::TimeDelta& delay) {
      new_content_rendering_delay_ = delay;
 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 0edc16351ec6856bb1b3010905ebff4cf7f1b2a3..a73d370bf2475a112790ba7c02d8d8d3ba9febff 100644
+index 3ff69bf8cd7d7b5808aab5ae8d00f6c6e1dadf39..603b439f8113535ab16fea75c2b6520295e844a5 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
 @@ -623,7 +623,7 @@ void RenderWidgetHostViewAura::HideImpl() {

+ 4 - 4
patches/chromium/expose_setuseragent_on_networkcontext.patch

@@ -33,10 +33,10 @@ index 0ccfe130f00ec3b6c75cd8ee04d5a2777e1fd00c..653829457d58bf92057cc36aa8a28970
    DISALLOW_COPY_AND_ASSIGN(StaticHttpUserAgentSettings);
  };
 diff --git a/services/network/network_context.cc b/services/network/network_context.cc
-index a07176cf0fd3c7160922e7f9919e775cb3b6fe71..5d59a8cc4fec91de95ddbb90dab1df9334081fac 100644
+index 170ba3cf6176e8423b6009a0ac0299bf1e411158..14f8cb99631232cc225026c345e95df2b548bcff 100644
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
-@@ -1036,6 +1036,13 @@ void NetworkContext::SetNetworkConditions(
+@@ -1035,6 +1035,13 @@ void NetworkContext::SetNetworkConditions(
                                        std::move(network_conditions));
  }
  
@@ -51,10 +51,10 @@ index a07176cf0fd3c7160922e7f9919e775cb3b6fe71..5d59a8cc4fec91de95ddbb90dab1df93
    // 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 dd65d1560daa8fde7d76e0dec8e1cdcb6c76b318..042f62dafcb027f0a65318d09dfadf751c792329 100644
+index 391a02c108debdd5e5572b4a666d30dc68ece76b..0d9c4cce09db485b5e750921eed703c75ffdf15a 100644
 --- a/services/network/network_context.h
 +++ b/services/network/network_context.h
-@@ -243,6 +243,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -242,6 +242,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    void CloseIdleConnections(CloseIdleConnectionsCallback callback) override;
    void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id,
                              mojom::NetworkConditionsPtr conditions) override;

+ 3 - 3
patches/chromium/feat_add_set_theme_source_to_allow_apps_to.patch

@@ -13,7 +13,7 @@ uses internally for things like menus and devtools.
 We can remove this patch once it has in some shape been upstreamed.
 
 diff --git a/ui/native_theme/native_theme.cc b/ui/native_theme/native_theme.cc
-index 119c6ba8f0318c398a1020cab5f0c55d387d4ed6..74b47875a042f9a5189dc4a7ade36c0cb3d1b5a6 100644
+index 150f4455d497c6e1ac84948eac088c9dc3a4d729..84a4d6dfc33ae7ba7e21efc5f38405e24749edd6 100644
 --- a/ui/native_theme/native_theme.cc
 +++ b/ui/native_theme/native_theme.cc
 @@ -247,6 +247,8 @@ NativeTheme::NativeTheme(bool should_use_dark_colors)
@@ -26,7 +26,7 @@ index 119c6ba8f0318c398a1020cab5f0c55d387d4ed6..74b47875a042f9a5189dc4a7ade36c0c
  }
  
 diff --git a/ui/native_theme/native_theme.h b/ui/native_theme/native_theme.h
-index 9ecc4540915100ff61e310d4c60bf91d75d0c588..8dfd9699f569e7fa0426492f881228ae8df9d376 100644
+index f4e9cc14b0b8406d255bbed56d98dcf61f24a405..e1b9298532b2676aa4d9cdacb15e9398be3ccc3f 100644
 --- a/ui/native_theme/native_theme.h
 +++ b/ui/native_theme/native_theme.h
 @@ -392,6 +392,22 @@ class NATIVE_THEME_EXPORT NativeTheme {
@@ -52,7 +52,7 @@ index 9ecc4540915100ff61e310d4c60bf91d75d0c588..8dfd9699f569e7fa0426492f881228ae
    // Returns a shared instance of the native theme that should be used for web
    // rendering. Do not use it in a normal application context (i.e. browser).
    // The returned object should not be deleted by the caller. This function is
-@@ -526,6 +542,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
+@@ -527,6 +543,8 @@ class NATIVE_THEME_EXPORT NativeTheme {
    bool is_high_contrast_ = false;
    PreferredColorScheme preferred_color_scheme_ = PreferredColorScheme::kLight;
  

+ 8 - 8
patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch

@@ -6,7 +6,7 @@ Subject: feat: 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 9a2cc0f076406d68910eeb5351e3869287515fcb..bde2f593f55edc677d44f4ae037042fe10661679 100644
+index f2c4cbf786188b8aa5dad1e7f2b8ae9c785aaed9..2882ef3371960cc914ac27e9b6eedd09ff34cb63 100644
 --- a/content/browser/renderer_host/render_view_host_impl.cc
 +++ b/content/browser/renderer_host/render_view_host_impl.cc
 @@ -512,6 +512,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
@@ -21,7 +21,7 @@ index 9a2cc0f076406d68910eeb5351e3869287515fcb..bde2f593f55edc677d44f4ae037042fe
    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 af15805b34d2cc038e73654017d4c0921e3fc321..3489f03bac1283efb6a27f5b959a72a8e5d0cb14 100644
+index c0943cbdd019a37474e1727b8282b7138475e74f..cb58b299976745edb6e3f0d13687301b7fc61a10 100644
 --- a/content/browser/renderer_host/render_view_host_impl.h
 +++ b/content/browser/renderer_host/render_view_host_impl.h
 @@ -110,6 +110,7 @@ class CONTENT_EXPORT RenderViewHostImpl
@@ -61,10 +61,10 @@ index dfd856eb481114fea9da3e26b4080c9a8473acf6..604a95a0427705eca523e91b08a136f8
    //
    // Returns the current WebKit preferences. Note: WebPreferences is cached, so
 diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
-index 57447f4529917692155d1861c7658156978fa0be..2eaf980889ef9053e728dc09e76f1fcd889153b8 100644
+index 272b613f658ef4bfa3869cbd17d342ceef665142..461310b69c823546f99d99b087b9ea005167a883 100644
 --- a/content/renderer/render_view_impl.cc
 +++ b/content/renderer/render_view_impl.cc
-@@ -1173,6 +1173,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
+@@ -1170,6 +1170,8 @@ bool RenderViewImpl::OnMessageReceived(const IPC::Message& message) {
  
    bool handled = true;
    IPC_BEGIN_MESSAGE_MAP(RenderViewImpl, message)
@@ -73,7 +73,7 @@ index 57447f4529917692155d1861c7658156978fa0be..2eaf980889ef9053e728dc09e76f1fcd
      IPC_MESSAGE_HANDLER(ViewMsg_UpdateTargetURL_ACK, OnUpdateTargetURLAck)
      IPC_MESSAGE_HANDLER(ViewMsg_UpdateWebPreferences, OnUpdateWebPreferences)
      IPC_MESSAGE_HANDLER(ViewMsg_MoveOrResizeStarted, OnMoveOrResizeStarted)
-@@ -1669,6 +1671,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
+@@ -1666,6 +1668,12 @@ bool RenderViewImpl::GetContentStateImmediately() {
    return send_content_state_immediately_;
  }
  
@@ -111,10 +111,10 @@ index baa1cec07522a23221b146165a638d3f679f9817..50f0c46c8fcbb4ee8ebb316f859f84d0
    // 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 94fb9863a6da4c049e45ec5966ef79d9c8e42b75..063d88779ad2ca7c4c723e2872c28d93401fcec3 100644
+index 27adaed62fe204202b4716cd573165b7456dbd29..2ba1cb1605ba5a10d5db78f4d3b440d431baceb1 100644
 --- a/third_party/blink/renderer/core/exported/web_view_impl.cc
 +++ b/third_party/blink/renderer/core/exported/web_view_impl.cc
-@@ -3366,6 +3366,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
+@@ -3368,6 +3368,13 @@ PageScheduler* WebViewImpl::Scheduler() const {
    return GetPage()->GetPageScheduler();
  }
  
@@ -128,7 +128,7 @@ index 94fb9863a6da4c049e45ec5966ef79d9c8e42b75..063d88779ad2ca7c4c723e2872c28d93
  void WebViewImpl::SetVisibilityState(
      mojom::blink::PageVisibilityState visibility_state,
      bool is_initial_state) {
-@@ -3376,7 +3383,8 @@ void WebViewImpl::SetVisibilityState(
+@@ -3378,7 +3385,8 @@ void WebViewImpl::SetVisibilityState(
    }
    GetPage()->SetVisibilityState(visibility_state, is_initial_state);
    GetPage()->GetPageScheduler()->SetPageVisible(

+ 4 - 4
patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch

@@ -94,7 +94,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3
   private:
    const HWND hwnd_;
 diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn
-index 8c4f933b32420d2cfc40d5bc5883fda61636b52a..6f2322736e570b1e994a4f0c39396261cb8a6f58 100644
+index 0979770409131aed4bea76d33b2748c01dde9541..d256ec42bb2154628de7d8d08cc8cf4b6d928911 100644
 --- a/components/viz/service/BUILD.gn
 +++ b/components/viz/service/BUILD.gn
 @@ -111,6 +111,8 @@ viz_component("service") {
@@ -107,7 +107,7 @@ index 8c4f933b32420d2cfc40d5bc5883fda61636b52a..6f2322736e570b1e994a4f0c39396261
      "display_embedder/software_output_surface.h",
      "display_embedder/viz_process_context_provider.cc",
 diff --git a/components/viz/service/display_embedder/output_surface_provider_impl.cc b/components/viz/service/display_embedder/output_surface_provider_impl.cc
-index b58099c6c1ad5727a806b81d674f4dac187da927..6d38e89500b6f3dd2b76fe3c7e67c568862aa4af 100644
+index da8936a87cfe156a90952c1ca79d9faf6ef2cd1f..6fd321aaf610ee985868af62b0e856f19e8be264 100644
 --- a/components/viz/service/display_embedder/output_surface_provider_impl.cc
 +++ b/components/viz/service/display_embedder/output_surface_provider_impl.cc
 @@ -21,6 +21,7 @@
@@ -126,7 +126,7 @@ index b58099c6c1ad5727a806b81d674f4dac187da927..6d38e89500b6f3dd2b76fe3c7e67c568
  #include "ui/base/ui_base_switches.h"
  #include "ui/gl/gl_context.h"
  #include "ui/gl/init/gl_factory.h"
-@@ -218,6 +220,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
+@@ -223,6 +225,22 @@ OutputSurfaceProviderImpl::CreateSoftwareOutputDeviceForPlatform(
    if (headless_)
      return std::make_unique<SoftwareOutputDevice>();
  
@@ -527,7 +527,7 @@ index 6b7fbb6cf13dc8ee6ade0878a9a2c1efc5d4d3f1..e2af75168cb914a7b3b4a6c9b6a28549
 +  Draw(gfx.mojom.Rect damage_rect) => ();
  };
 diff --git a/ui/compositor/compositor.h b/ui/compositor/compositor.h
-index 0f99c9d78626ccc211236832e5df2008ce0df5f2..f1dfa72d21e93f5223cde8e2b34d5ed2a6c04209 100644
+index 438dd212d881abf70362f12391b6a85f697785d0..34bd0cbf18714ac24355e603806cc36986f24e30 100644
 --- a/ui/compositor/compositor.h
 +++ b/ui/compositor/compositor.h
 @@ -74,6 +74,7 @@ class DisplayPrivate;

+ 0 - 23
patches/chromium/fix_account_for_print_preview_disabled_when_printing_to_pdf.patch

@@ -1,23 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Andy Locascio <[email protected]>
-Date: Thu, 2 Apr 2020 15:05:00 -0700
-Subject: fix: account for print preview disabled when printing to pdf
-
-Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2068936
-
-Avoid an optimization introduced in the above CL. In my limited
-understanding, it seems like we slightly misuse the print preview API
-and this is fallout from using it in a way the code doesn't expect.
-
-diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
-index 7406760e1c0247899232fc96614cfb2359ade432..2bf4ea5817c80bef2f057c10195ca846e3d44d0b 100644
---- a/components/printing/renderer/print_render_frame_helper.cc
-+++ b/components/printing/renderer/print_render_frame_helper.cc
-@@ -1499,6 +1499,7 @@ PrintRenderFrameHelper::CreatePreviewDocument() {
-   const std::vector<int>& pages = print_pages_params_->pages;
- 
-   bool require_document_metafile =
-+      !g_is_preview_enabled ||
-       print_renderer_ ||
-       print_params.printed_doc_type != mojom::SkiaDocumentType::kMSKP;
-   if (!print_preview_context_.CreatePreviewDocument(

+ 0 - 28
patches/chromium/fix_handling_non_client_pointer_events_from_pen_on_windows_10.patch

@@ -1,28 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Cheng Zhao <[email protected]>
-Date: Thu, 4 Oct 2018 14:57:02 -0700
-Subject: fix: handle non client pointer events from pen on Windows 10
-
-Refs: https://github.com/electron/electron/issues/21440
-Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2237535
-
-diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
-index 6191775ea0566862722741a3c6102867082f33d6..48f32cc9b820156ee7bca9381611b8aff7953fdf 100644
---- a/ui/views/win/hwnd_message_handler.cc
-+++ b/ui/views/win/hwnd_message_handler.cc
-@@ -2002,6 +2002,15 @@ LRESULT HWNDMessageHandler::OnPointerEvent(UINT message,
-     return -1;
-   }
- 
-+  // Pen may also send non client pointer messages, treat them as normal
-+  // touch events so they can be properly handled.
-+  if (pointer_type == PT_PEN &&
-+      (message == WM_NCPOINTERDOWN ||
-+       message == WM_NCPOINTERUP ||
-+       message == WM_NCPOINTERUPDATE)) {
-+    pointer_type = PT_TOUCH;
-+  }
-+
-   switch (pointer_type) {
-     case PT_PEN:
-       return HandlePointerEventTypePen(message, w_param, l_param);

+ 30 - 0
patches/chromium/fix_include_missing_header_file.patch

@@ -0,0 +1,30 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Adam Kallai <[email protected]>
+Date: Thu, 2 Jul 2020 17:09:16 +0200
+Subject: fix: include missing header file
+
+Include the header from base/ where NOTREACHED is defined.
+This fixes a build failure on Windows on Arm.
+
+The patch was originally created by Richard Townsend <[email protected]>.
+
+Bug: 1100363
+Change-Id: Ic97f7c217f22e51f1d4c9bd87ae434e263975c6d
+Reviewed-on: https://chromium-review.googlesource.com/c/crashpad/crashpad/+/2279091
+Commit-Queue: Mark Mentovai <[email protected]>
+Reviewed-by: Mark Mentovai <[email protected]>
+
+diff --git a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
+index 88cbc800de81de88d08c41e893ad4f64dc65ef47..778892c50be5e2acaaed3d47e45fb8a8261e695e 100644
+--- a/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
++++ b/third_party/crashpad/crashpad/snapshot/win/system_snapshot_win.cc
+@@ -23,7 +23,9 @@
+ #include <utility>
+ #include <vector>
+ 
++#include "base/check_op.h"
+ #include "base/logging.h"
++#include "base/notreached.h"
+ #include "base/numerics/safe_conversions.h"
+ #include "base/strings/stringprintf.h"
+ #include "base/strings/utf_string_conversions.h"

+ 1 - 1
patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch

@@ -13,7 +13,7 @@ This patch can be removed once app.allowRendererProcessReuse is forced
 to true as then Chromiums assumptions around processes become correct.
 
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 1f5f7f217a7cb4013f6bfbb380b2b81214cc92b0..9ac8c8ea965a33e64a656f4478b217d3e6288597 100644
+index 4a576f48e677c7d91726e9c59dd4a24a4d64c792..ee336b57fa13ec611b4591cb8147ec8f29f162e2 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
 @@ -2492,11 +2492,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {

+ 11 - 11
patches/chromium/frame_host_manager.patch

@@ -42,10 +42,10 @@ index 6b03c07316eaab83a50afc123fc9f17b1c1dfa3b..e821571731e4e1a93f873477c7410de7
    // another SiteInstance for the same site.
    void RegisterSiteInstance(SiteInstanceImpl* site_instance);
 diff --git a/content/browser/frame_host/navigation_request.cc b/content/browser/frame_host/navigation_request.cc
-index 6c3252af5e5f6dac3045f6315704ba9d494add4c..a8853ff856aa923e3820eb68d7b8081332d2a004 100644
+index 6f13dd3aded702faa63bd8c092b3541349c538c0..88ec13647789c869a05114c678f8fa8b5f67b7fe 100644
 --- a/content/browser/frame_host/navigation_request.cc
 +++ b/content/browser/frame_host/navigation_request.cc
-@@ -1406,6 +1406,21 @@ void NavigationRequest::BeginNavigation() {
+@@ -1410,6 +1410,21 @@ void NavigationRequest::BeginNavigation() {
      // it immediately.
      EnterChildTraceEvent("ResponseStarted", this);
  
@@ -67,7 +67,7 @@ index 6c3252af5e5f6dac3045f6315704ba9d494add4c..a8853ff856aa923e3820eb68d7b80813
      // Select an appropriate RenderFrameHost.
      render_frame_host_ =
          frame_tree_node_->render_manager()->GetFrameHostForNavigation(this);
-@@ -4783,6 +4798,7 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
+@@ -4795,6 +4810,7 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
            {WILL_START_REQUEST, {
                WILL_REDIRECT_REQUEST,
                WILL_PROCESS_RESPONSE,
@@ -75,7 +75,7 @@ index 6c3252af5e5f6dac3045f6315704ba9d494add4c..a8853ff856aa923e3820eb68d7b80813
                READY_TO_COMMIT,
                DID_COMMIT,
                CANCELING,
-@@ -4796,10 +4812,14 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
+@@ -4808,10 +4824,14 @@ void NavigationRequest::CheckStateTransition(NavigationState state) const {
                WILL_FAIL_REQUEST,
            }},
            {WILL_PROCESS_RESPONSE, {
@@ -106,10 +106,10 @@ index 6941326796bb7e7b056ae0f83345edb2e4cb0479..8e8e1e6d994809159cf0433a4feeec85
      READY_TO_COMMIT,
  
 diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
-index b6f81430796a820992abc7dd81202853b9f6ed7f..c646423abc241e23252f5857abafcf44397c2c42 100644
+index 4d39ae3c17ee807b744dc4e8406c55fc623a779d..28acc2401ec7fc035c2548e633847fd297fb88a4 100644
 --- a/content/browser/frame_host/render_frame_host_manager.cc
 +++ b/content/browser/frame_host/render_frame_host_manager.cc
-@@ -2305,6 +2305,16 @@ bool RenderFrameHostManager::InitRenderView(
+@@ -2304,6 +2304,16 @@ bool RenderFrameHostManager::InitRenderView(
  scoped_refptr<SiteInstance>
  RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
      NavigationRequest* request) {
@@ -126,7 +126,7 @@ index b6f81430796a820992abc7dd81202853b9f6ed7f..c646423abc241e23252f5857abafcf44
    SiteInstance* current_site_instance = render_frame_host_->GetSiteInstance();
  
    // All children of MHTML documents must be MHTML documents. They all live in
-@@ -2324,10 +2334,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
+@@ -2323,10 +2333,60 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
    //
    // TODO(clamy): We should also consider as a candidate SiteInstance the
    // speculative SiteInstance that was computed on redirects.
@@ -191,7 +191,7 @@ index b6f81430796a820992abc7dd81202853b9f6ed7f..c646423abc241e23252f5857abafcf44
  
    // Account for renderer-initiated reload as well.
    // Needed as a workaround for https://crbug.com/1045524, remove it when it is
-@@ -2357,6 +2417,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
+@@ -2356,6 +2416,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
      request->ResetStateForSiteInstanceChange();
    }
  
@@ -229,7 +229,7 @@ index 571e6381f2456450a07b64c3a84d1f15f4cbbefa..cb342a6c4915c4b2cc7fe0c1b3c7219f
    size_t GetRelatedActiveContentsCount() override;
    bool RequiresDedicatedProcess() override;
 diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
-index a0ea7c6100eb437bf1c409ddad3bb5bbe1f3acb8..756cf1465e27820e1061ce251b03f77b3d8546aa 100644
+index 84ca4325a72a5c4267d43e5be9bfd7b73efa0b86..4af654e2a2dbb5450b3f8ca1d85b0e6c94825c42 100644
 --- a/content/public/browser/content_browser_client.cc
 +++ b/content/public/browser/content_browser_client.cc
 @@ -59,6 +59,21 @@
@@ -255,10 +255,10 @@ index a0ea7c6100eb437bf1c409ddad3bb5bbe1f3acb8..756cf1465e27820e1061ce251b03f77b
      const MainFunctionParams& parameters) {
    return nullptr;
 diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
-index 31a0a2b60dd96ede0beba95e8d1df65ed744cf83..e56dee7ea987b6b0b3f729f4c8ffa483e3e8c96f 100644
+index 00f3f557ccf69760c4e0ac7c9fcc7d048e21e8d8..d968ab756f8628a3e52b57c9cacb50dea7819157 100644
 --- a/content/public/browser/content_browser_client.h
 +++ b/content/public/browser/content_browser_client.h
-@@ -236,8 +236,45 @@ class CONTENT_EXPORT ContentBrowserClient {
+@@ -240,8 +240,45 @@ class CONTENT_EXPORT ContentBrowserClient {
    using IsClipboardPasteAllowedCallback =
        base::OnceCallback<void(ClipboardPasteAllowed)>;
  

+ 2 - 2
patches/chromium/gpu_notify_when_dxdiag_request_fails.patch

@@ -40,10 +40,10 @@ index 2e069f00bb0f2c263b60662988548b246b74e5d9..82e9a19b6502aeab8f5d14098f2e5c5f
    // Update the GPU feature info. This updates the blacklist and enabled status
    // of GPU rasterization. In the future this will be used for more features.
 diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
-index 8ceb4ed3c6bc4759bacdf6a5922dd9a4c5e65322..a0a18214c3a4722c920ad4204a4975625130bb3c 100644
+index 54a2d002794e3cf3c40799e437456dd37df51503..4faf21eab883aa7095d712678ceea95975bdd18f 100644
 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc
 +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
-@@ -1059,6 +1059,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
+@@ -1063,6 +1063,11 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() {
      host->ForceShutdown();
  }
  

+ 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 732d954a33a69d8aee0849b96b0e0d5eacebca91..7b0419d6a75009e7a0052a09641ab60197010275 100644
+index fa2306ead7d2b70e41be750408e386bd452b99cc..9985c129afd87ed546baddae598881418ee502bf 100644
 --- a/tools/gritsettings/resource_ids.spec
 +++ b/tools/gritsettings/resource_ids.spec
-@@ -630,6 +630,11 @@
+@@ -649,6 +649,11 @@
      "includes": [3880],
    },
  

+ 3 - 3
patches/chromium/mas_disable_custom_window_frame.patch

@@ -7,7 +7,7 @@ Disable private window frame APIs (NSNextStepFrame and NSThemeFrame) for MAS
 build.
 
 diff --git a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
-index b52df712266ca390593d304936f0b979503af3ad..62ded794bd83963f681eb6a0b698228bf4e89ce5 100644
+index 2cd283de6677f0c256940ab475eb6c58d8040f54..ad7f1f0c05b491977ccd5650c94248e876ad2b0e 100644
 --- a/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
 +++ b/components/remote_cocoa/app_shim/browser_native_widget_window_mac.mm
 @@ -9,6 +9,7 @@
@@ -27,7 +27,7 @@ index b52df712266ca390593d304936f0b979503af3ad..62ded794bd83963f681eb6a0b698228b
  @implementation BrowserNativeWidgetWindow
  
  // Prevent detached tabs from glitching when the window is partially offscreen.
-@@ -82,6 +85,7 @@
+@@ -88,6 +91,7 @@
  
  // NSWindow (PrivateAPI) overrides.
  
@@ -35,7 +35,7 @@ index b52df712266ca390593d304936f0b979503af3ad..62ded794bd83963f681eb6a0b698228b
  + (Class)frameViewClassForStyleMask:(NSUInteger)windowStyle {
    // - NSThemeFrame and its subclasses will be nil if it's missing at runtime.
    if ([BrowserWindowFrame class])
-@@ -96,6 +100,8 @@
+@@ -102,6 +106,8 @@
    return NO;
  }
  

+ 1 - 1
patches/chromium/mas_disable_remote_accessibility.patch

@@ -170,7 +170,7 @@ index 026bb184e3ecf21185900d3102fbbdb4bc9e1100..aef2f3625465d5de36d0ce496f713386
  
  ///////////////////////////////////////////////////////////////////////////////
 diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn
-index 3241093ca37134435507b6cfb7d9663317563860..aace5b11a419cdbb0e257dd3ba2329e9ea013c6a 100644
+index 1179753aeffe325bc35ee6a730b0a6fde269e909..097ed19949105ad80edc0750c7241697ba87dfe6 100644
 --- a/ui/base/BUILD.gn
 +++ b/ui/base/BUILD.gn
 @@ -311,6 +311,13 @@ jumbo_component("base") {

+ 4 - 4
patches/chromium/mas_disable_remote_layer.patch

@@ -17,7 +17,7 @@ cases where performance improves when disabling remote CoreAnimation (remote
 CoreAnimation is really only about battery usage).
 
 diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.h b/gpu/ipc/service/image_transport_surface_overlay_mac.h
-index 3307998ec566e24a9050434af4e6e3bb09557d43..456603c97bfc2214b0d08fecd592ff1e2c26ceb6 100644
+index d565d2ab23d7a42e6787b58103fd40a8675b8e28..4cb9681c1f810a0cbd7f7ef04c4a7c73ca10c2b0 100644
 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.h
 +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.h
 @@ -20,7 +20,9 @@
@@ -30,7 +30,7 @@ index 3307998ec566e24a9050434af4e6e3bb09557d43..456603c97bfc2214b0d08fecd592ff1e
  @class CALayer;
  
  namespace ui {
-@@ -111,7 +113,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
+@@ -116,7 +118,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass,
    base::WeakPtr<ImageTransportSurfaceDelegate> delegate_;
  
    bool use_remote_layer_api_;
@@ -41,7 +41,7 @@ index 3307998ec566e24a9050434af4e6e3bb09557d43..456603c97bfc2214b0d08fecd592ff1e
  
    gfx::Size pixel_size_;
 diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
-index 0823c8a728f62679f076a6237ba4dcc207c5d9bb..5ce94e2e2d696664e75c1aeb30d0177458a27df1 100644
+index f0dd2928aefcfef71e148e4e5c1e88dd7f9b0724..3461a7839a13f5c34c78b9b13997d5d3e42977a4 100644
 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
 +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
 @@ -51,7 +51,7 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::
@@ -61,7 +61,7 @@ index 0823c8a728f62679f076a6237ba4dcc207c5d9bb..5ce94e2e2d696664e75c1aeb30d01774
  }
  
  template <typename BaseClass>
-@@ -141,7 +142,9 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::SwapBuffersInternal(
+@@ -140,7 +141,9 @@ ImageTransportSurfaceOverlayMacBase<BaseClass>::SwapBuffersInternal(
                           "GLImpl", static_cast<int>(gl::GetGLImplementation()),
                           "width", pixel_size_.width());
      if (use_remote_layer_api_) {

+ 80 - 31
patches/chromium/mas_no_private_api.patch

@@ -7,10 +7,47 @@ Guard usages in blink of private Mac APIs by MAS_BUILD, so they can be
 excluded for people who want to submit their apps to the Mac App store.
 
 diff --git a/content/browser/accessibility/accessibility_tree_formatter_mac.mm b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
-index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a46bc0640 100644
+index bc23c9cea294a363c650f234f3b697cd7139b082..7467840b77ee2e3a75b34d1981cdfeef62a4f9fc 100644
 --- a/content/browser/accessibility/accessibility_tree_formatter_mac.mm
 +++ b/content/browser/accessibility/accessibility_tree_formatter_mac.mm
-@@ -449,7 +449,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
+@@ -145,7 +145,9 @@ class AccessibilityTreeFormatterMac : public AccessibilityTreeFormatterBase {
+   gfx::NativeViewAccessible PropertyNodeToUIElement(
+       const PropertyNode&,
+       const LineIndexesMap&) const;
++  #ifndef MAS_BUILD      
+   id PropertyNodeToTextMarker(const PropertyNode&, const LineIndexesMap&) const;
++  #endif
+ 
+   base::Value PopulateSize(const BrowserAccessibilityCocoa*) const;
+   base::Value PopulatePosition(const BrowserAccessibilityCocoa*) const;
+@@ -337,8 +339,10 @@ AccessibilityTreeFormatterMac::ParamByPropertyNode(
+     param = PropertyNodeToRange(property_node);
+   } else if (property_name == "AXIndexForChildUIElement") {  // UIElement
+     param = PropertyNodeToUIElement(property_node, line_indexes_map);
++  #ifndef MAS_BUILD
+   } else if (property_name == "AXIndexForTextMarker") {  // TextMarker
+     param = PropertyNodeToTextMarker(property_node, line_indexes_map);
++  #endif
+   }
+ 
+   return param;
+@@ -426,6 +430,7 @@ AccessibilityTreeFormatterMac::PropertyNodeToUIElement(
+   return uielement;
+ }
+ 
++#ifndef MAS_BUILD
+ id AccessibilityTreeFormatterMac::PropertyNodeToTextMarker(
+     const PropertyNode& propnode,
+     const LineIndexesMap& line_indexes_map) const {
+@@ -466,6 +471,7 @@ id AccessibilityTreeFormatterMac::PropertyNodeToTextMarker(
+ 
+   return content::AXTextMarkerFrom(anchor_cocoa, *offset, affinity);
+ }
++#endif
+ 
+ base::Value AccessibilityTreeFormatterMac::PopulateSize(
+     const BrowserAccessibilityCocoa* cocoa_node) const {
+@@ -527,7 +533,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
        0 == strcmp([value objCType], @encode(NSRange))) {
      return PopulateRange([value rangeValue]);
    }
@@ -19,7 +56,7 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
    // AXTextMarker
    if (content::IsAXTextMarker(value)) {
      return PopulateTextPosition(content::AXTextMarkerToPosition(value).get(),
-@@ -460,7 +460,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
+@@ -538,7 +544,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateObject(
    if (content::IsAXTextMarkerRange(value)) {
      return PopulateTextMarkerRange(value, line_indexes_map);
    }
@@ -28,7 +65,7 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
    // Accessible object
    if ([value isKindOfClass:[BrowserAccessibilityCocoa class]]) {
      return base::Value(NodeToLineIndex(value, line_indexes_map));
-@@ -511,7 +511,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextPosition(
+@@ -589,7 +595,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextPosition(
                      kConstValuePrefix + affinity);
    return set;
  }
@@ -37,7 +74,7 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
  base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
      id object,
      const LineIndexesMap& line_indexes_map) const {
-@@ -526,7 +526,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
+@@ -604,7 +610,7 @@ base::Value AccessibilityTreeFormatterMac::PopulateTextMarkerRange(
    dict.SetPath("focus", PopulateTextPosition(range.focus(), line_indexes_map));
    return dict;
  }
@@ -47,10 +84,23 @@ index 177a7321153f68008f7c122b4f73e200feed72e9..f03c4fbad79ea829c440f13885a9005a
      NSArray* node_array,
      const LineIndexesMap& line_indexes_map) const {
 diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h
-index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0a00277e3 100644
+index 947a548278067323aabe099986057ed68a8f50ae..7b721327bbe784314f4523bc7164182af3f53299 100644
 --- a/content/browser/accessibility/browser_accessibility_cocoa.h
 +++ b/content/browser/accessibility/browser_accessibility_cocoa.h
-@@ -124,7 +124,9 @@ BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
+@@ -40,10 +40,12 @@ BrowserAccessibilityPosition::AXPositionInstance AXTextMarkerToPosition(id);
+ // Returns browser accessibility range for the given AXTextMarkerRange.
+ BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
+ 
++#ifndef MAS_BUILD
+ // Returns AXTextMarker for the given browser accessibility position.
+ id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
+                     int offset,
+                     ax::mojom::TextAffinity affinity);
++#endif
+ 
+ }  // namespace content
+ 
+@@ -129,7 +131,9 @@ id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
  @property(nonatomic, readonly) NSNumber* enabled;
  // Returns a text marker that points to the last character in the document that
  // can be selected with Voiceover.
@@ -60,7 +110,7 @@ index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0
  @property(nonatomic, readonly) NSNumber* expanded;
  @property(nonatomic, readonly) NSNumber* focused;
  @property(nonatomic, readonly) NSNumber* grabbed;
-@@ -135,7 +137,9 @@ BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
+@@ -140,7 +144,9 @@ id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
  @property(nonatomic, readonly, getter=isIgnored) BOOL ignored;
  // Index of a row, column, or tree item.
  @property(nonatomic, readonly) NSNumber* index;
@@ -70,7 +120,7 @@ index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0
  @property(nonatomic, readonly) NSString* invalid;
  @property(nonatomic, readonly) NSNumber* isMultiSelectable;
  @property(nonatomic, readonly) NSString* placeholderValue;
-@@ -158,14 +162,18 @@ BrowserAccessibilityPosition::AXRangeType AXTextMarkerRangeToRange(id);
+@@ -163,14 +169,18 @@ id AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
  // The object is selected as a whole.
  @property(nonatomic, readonly) NSNumber* selected;
  @property(nonatomic, readonly) NSArray* selectedChildren;
@@ -90,7 +140,7 @@ index 8e7b652d2eb51ca20672d25465c2f2a42092086d..1bb0d2b7c9ab7a073da8454e328636b0
  // is concerned.
  @property(nonatomic, readonly) NSString* subrole;
 diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
-index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d6451651d418 100644
+index 47174fe1dd4743c6bffc6f462baa58db187501f6..84cb0fe898631353ade5b205cc061c7e8622301d 100644
 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm
 +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
 @@ -208,6 +208,7 @@ NSString* const
@@ -133,16 +183,15 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  bool content::IsAXTextMarker(id object) {
    if (object == nil)
      return false;
-@@ -755,7 +760,7 @@ BrowserAccessibilityPosition::AXRangeType
- content::AXTextMarkerRangeToRange(id text_marker_range) {
-   return CreateRangeFromTextMarkerRange(text_marker_range);
+@@ -765,6 +770,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
+   return CreateTextMarker(std::move(position));
  }
--
+ 
 +#endif
  @implementation BrowserAccessibilityCocoa
  
  + (void)initialize {
-@@ -792,7 +797,9 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -801,7 +807,9 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
        {NSAccessibilityEditableAncestorAttribute, @"editableAncestor"},
        {NSAccessibilityElementBusyAttribute, @"elementBusy"},
        {NSAccessibilityEnabledAttribute, @"enabled"},
@@ -152,7 +201,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
        {NSAccessibilityExpandedAttribute, @"expanded"},
        {NSAccessibilityFocusableAncestorAttribute, @"focusableAncestor"},
        {NSAccessibilityFocusedAttribute, @"focused"},
-@@ -804,8 +811,10 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -813,8 +821,10 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
        {NSAccessibilityHighestEditableAncestorAttribute,
         @"highestEditableAncestor"},
        {NSAccessibilityIndexAttribute, @"index"},
@@ -163,7 +212,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
        {NSAccessibilityInvalidAttribute, @"invalid"},
        {NSAccessibilityIsMultiSelectableAttribute, @"isMultiSelectable"},
        {NSAccessibilityLanguageAttribute, @"language"},
-@@ -827,13 +836,17 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -836,13 +846,17 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
        {NSAccessibilityRowsAttribute, @"rows"},
        // TODO(aboxhall): expose
        // NSAccessibilityServesAsTitleForUIElementsAttribute
@@ -181,7 +230,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
        {NSAccessibilitySizeAttribute, @"size"},
        {NSAccessibilitySortDirectionAttribute, @"sortDirection"},
        {NSAccessibilitySubroleAttribute, @"subrole"},
-@@ -1321,6 +1334,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -1330,6 +1344,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
                                    ax::mojom::Restriction::kDisabled];
  }
  
@@ -189,7 +238,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  // Returns a text marker that points to the last character in the document that
  // can be selected with VoiceOver.
  - (id)endTextMarker {
-@@ -1331,6 +1345,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -1340,6 +1355,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
    BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
    return CreateTextMarker(position->CreatePositionAtEndOfAnchor());
  }
@@ -197,7 +246,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  
  - (NSNumber*)expanded {
    if (![self instanceActive])
-@@ -1480,6 +1495,8 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -1489,6 +1505,8 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
    return nil;
  }
  
@@ -206,7 +255,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  - (NSNumber*)insertionPointLineNumber {
    if (![self instanceActive])
      return nil;
-@@ -1502,6 +1519,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -1511,6 +1529,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
                         caretPosition->AsTextPosition()->text_offset());
    return @(std::distance(lineBreaks.begin(), iterator));
  }
@@ -214,7 +263,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  
  // Returns whether or not this node should be ignored in the
  // accessibility tree.
-@@ -2178,6 +2196,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -2187,6 +2206,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
    return ret;
  }
  
@@ -222,7 +271,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  - (NSString*)selectedText {
    if (![self instanceActive])
      return nil;
-@@ -2189,11 +2208,13 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -2198,11 +2218,13 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
      return nil;
    return base::SysUTF16ToNSString(range.GetText());
  }
@@ -236,7 +285,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  - (NSValue*)selectedTextRange {
    if (![self instanceActive])
      return nil;
-@@ -2214,12 +2235,15 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -2223,12 +2245,15 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
    int selLength = range.GetText().length();
    return [NSValue valueWithRange:NSMakeRange(selStart, selLength)];
  }
@@ -252,7 +301,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  
  - (NSValue*)size {
    if (![self instanceActive])
-@@ -2252,6 +2276,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -2261,6 +2286,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
    return nil;
  }
  
@@ -260,7 +309,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  // Returns a text marker that points to the first character in the document that
  // can be selected with VoiceOver.
  - (id)startTextMarker {
-@@ -2262,6 +2287,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -2271,6 +2297,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
    BrowserAccessibilityPositionInstance position = root->CreatePositionAt(0);
    return CreateTextMarker(position->CreatePositionAtStartOfAnchor());
  }
@@ -268,7 +317,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  
  // Returns a subrole based upon the role.
  - (NSString*)subrole {
-@@ -2584,11 +2610,13 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -2593,11 +2620,13 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
    NSMutableAttributedString* attributedInnerText =
        [[[NSMutableAttributedString alloc]
            initWithString:base::SysUTF16ToNSString(innerText)] autorelease];
@@ -282,7 +331,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  
    return [attributedInnerText attributedSubstringFromRange:range];
  }
-@@ -2692,9 +2720,8 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -2701,9 +2730,8 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
        return ToBrowserAccessibilityCocoa(cell);
    }
  
@@ -294,7 +343,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
      BrowserAccessibilityPositionInstance position =
          CreatePositionFromTextMarker(parameter);
      if (!position->IsNullPosition())
-@@ -3007,6 +3034,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -3016,6 +3044,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
  
      return CreateTextMarker(root->CreatePositionAt(index));
    }
@@ -302,7 +351,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
  
    if ([attribute isEqualToString:
                       NSAccessibilityBoundsForRangeParameterizedAttribute]) {
-@@ -3042,6 +3070,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -3051,6 +3080,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
      return nil;
    }
  
@@ -310,7 +359,7 @@ index ce1d034e40fbf907c18684711c36d8f428d174ff..5fd67af11106ef1e0bb093078d78d645
    if ([attribute
            isEqualToString:
                NSAccessibilityLineTextMarkerRangeForTextMarkerParameterizedAttribute]) {
-@@ -3156,6 +3185,7 @@ content::AXTextMarkerRangeToRange(id text_marker_range) {
+@@ -3165,6 +3195,7 @@ id content::AXTextMarkerFrom(const BrowserAccessibilityCocoa* anchor,
  
      return @(child->GetIndexInParent());
    }

+ 10 - 10
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 f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775cb3b6fe71 100644
+index 3bb208bad23cd3247f95305104a856e9d0bbc396..170ba3cf6176e8423b6009a0ac0299bf1e411158 100644
 --- a/services/network/network_context.cc
 +++ b/services/network/network_context.cc
 @@ -114,6 +114,11 @@
@@ -22,7 +22,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
  #if BUILDFLAG(IS_CT_SUPPORTED)
  #include "components/certificate_transparency/chrome_ct_policy_enforcer.h"
  #include "components/certificate_transparency/chrome_require_ct_delegate.h"
-@@ -325,6 +330,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
+@@ -324,6 +329,79 @@ std::string HashesToBase64String(const net::HashValueVector& hashes) {
  
  }  // namespace
  
@@ -102,7 +102,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
  constexpr uint32_t NetworkContext::kMaxOutstandingRequestsPerProcess;
  
  NetworkContext::PendingCertVerify::PendingCertVerify() = default;
-@@ -519,6 +597,13 @@ void NetworkContext::SetClient(
+@@ -518,6 +596,13 @@ void NetworkContext::SetClient(
    client_.Bind(std::move(client));
  }
  
@@ -116,7 +116,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
  void NetworkContext::CreateURLLoaderFactory(
      mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
      mojom::URLLoaderFactoryParamsPtr params) {
-@@ -1729,8 +1814,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
+@@ -1723,8 +1808,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
           "NetworkContext should pass CertVerifierServiceRemoteParams.";
  
    std::unique_ptr<net::CertVerifier> cert_verifier;
@@ -127,7 +127,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
    } else {
      if (params_->cert_verifier_params &&
          params_->cert_verifier_params->is_remote_params()) {
-@@ -1763,14 +1849,14 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
+@@ -1752,14 +1838,14 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
          cert_net_fetcher_ =
              base::MakeRefCounted<net::CertNetFetcherURLRequest>();
  
@@ -145,7 +145,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
  
  #if defined(OS_CHROMEOS)
      cert_verifier_with_trust_anchors_ =
-@@ -1779,13 +1865,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
+@@ -1768,13 +1854,27 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext(
      UpdateAdditionalCertificates(
          std::move(params_->initial_additional_certificates));
      cert_verifier_with_trust_anchors_->InitializeOnIOThread(
@@ -178,7 +178,7 @@ index f29891cb543999a5ed83ceb8130661ddbde5f1a6..a07176cf0fd3c7160922e7f9919e775c
    std::unique_ptr<NetworkServiceNetworkDelegate> network_delegate =
        std::make_unique<NetworkServiceNetworkDelegate>(
 diff --git a/services/network/network_context.h b/services/network/network_context.h
-index 6989b0367ea1abcd46a110b738adc18227ab6846..dd65d1560daa8fde7d76e0dec8e1cdcb6c76b318 100644
+index eced38ff04f8d7f3a91079b65f5ad29348bf8813..391a02c108debdd5e5572b4a666d30dc68ece76b 100644
 --- a/services/network/network_context.h
 +++ b/services/network/network_context.h
 @@ -86,6 +86,7 @@ class DomainReliabilityMonitor;
@@ -189,7 +189,7 @@ index 6989b0367ea1abcd46a110b738adc18227ab6846..dd65d1560daa8fde7d76e0dec8e1cdcb
  class CookieManager;
  class ExpectCTReporter;
  class HostResolver;
-@@ -190,6 +191,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+@@ -189,6 +190,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
    void CreateURLLoaderFactory(
        mojo::PendingReceiver<mojom::URLLoaderFactory> receiver,
        mojom::URLLoaderFactoryParamsPtr params) override;
@@ -198,8 +198,8 @@ index 6989b0367ea1abcd46a110b738adc18227ab6846..dd65d1560daa8fde7d76e0dec8e1cdcb
    void ResetURLLoaderFactories() override;
    void GetCookieManager(
        mojo::PendingReceiver<mojom::CookieManager> receiver) override;
-@@ -657,6 +660,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
-   std::unique_ptr<network::NSSTempCertsCacheChromeOS> nss_temp_certs_cache_;
+@@ -653,6 +656,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext
+   CertVerifierWithTrustAnchors* cert_verifier_with_trust_anchors_ = nullptr;
  #endif
  
 +  RemoteCertVerifier* remote_cert_verifier_ = nullptr;

+ 1 - 1
patches/chromium/notification_provenance.patch

@@ -108,7 +108,7 @@ index 4bf25bf1fa69f7d3869369172d375e2e489e62a1..f80ef2cecc8b111dc54e109646573a59
        mojo::PendingReceiver<blink::mojom::NotificationService> receiver);
  
 diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
-index 792e359038592c6cb5bc9da319cbd5b383d5ca12..5f73faa60d4e8d8688af6513134a7696fd464026 100644
+index b3cee953abdb4f8d6991dedaa43b4f8267f44f9d..a2fc5326f7ecc3d0bd57587f78d0e3231c5a49ac 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
 @@ -2148,7 +2148,7 @@ void RenderProcessHostImpl::CreateNotificationService(

+ 4 - 4
patches/chromium/printing.patch

@@ -31,7 +31,7 @@ index 668a14bff461e83b2c6d9d7f23d9674ff081ef12..674f141e80c0316fd47558c4d428a970
    using RenderMode = PdfRenderSettings::Mode;
    RenderMode mode;
 diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
-index adb208ba3589e32536527219aaf4e89e3ee3311a..301f6416898445eed814d67901254ef8e5915e2a 100644
+index 52efa2037a31f84a261502107bfebc69ae5a419e..4834e92ae99f12043e5ce476370f64345ad29001 100644
 --- a/chrome/browser/printing/print_job_worker.cc
 +++ b/chrome/browser/printing/print_job_worker.cc
 @@ -20,7 +20,6 @@
@@ -50,8 +50,8 @@ index adb208ba3589e32536527219aaf4e89e3ee3311a..301f6416898445eed814d67901254ef8
  #include "printing/print_job_constants.h"
  #include "printing/printed_document.h"
  #include "printing/printing_utils.h"
-@@ -223,16 +223,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
-         print_backend->GetPrinterDriverInfo(printer_name));
+@@ -235,16 +235,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
+ #endif  // defined(OS_LINUX) && defined(USE_CUPS) && !defined(OS_CHROMEOS)
    }
  
 -  PrintingContext::Result result;
@@ -75,7 +75,7 @@ index adb208ba3589e32536527219aaf4e89e3ee3311a..301f6416898445eed814d67901254ef8
  }
  
  #if defined(OS_CHROMEOS)
-@@ -248,6 +253,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
+@@ -260,6 +265,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
  
  void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
                                       PrintingContext::Result result) {

+ 3 - 3
patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch

@@ -43,7 +43,7 @@ index bf6baff690af930acf19c2a544c8f00ab492bb8e..8d205a1b052c6d670c0c2e38852734c5
  
  void RenderWidgetHostImpl::OnCursorVisibilityStateChanged(bool is_visible) {
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index ca90c21170ff3405efa1da230944faaaf12ce1b4..11560e87eab8d4aec49be358be92c0af7ad402f7 100644
+index b08fdaca5d59deb48d83b50d917c80908a2fa02f..e858b2fca4bb8fce0cf6dcb148c979ed96afdc7a 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
 @@ -3588,6 +3588,11 @@ bool WebContentsImpl::OnUpdateDragCursor() {
@@ -59,10 +59,10 @@ index ca90c21170ff3405efa1da230944faaaf12ce1b4..11560e87eab8d4aec49be358be92c0af
      RenderWidgetHostImpl* render_widget_host) {
    return render_widget_host == GetMainFrame()->GetRenderWidgetHost();
 diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h
-index 5209401c03325f420d14d984a6b3b05391ff41e1..1bde6eae0148bdc60ded08ee2327b3b3799157bb 100644
+index 353addcc1e7646e7ddc14a8d253d622ced94f34d..b62b7aafc2dcfa281cf82b9d8088b053db425417 100644
 --- a/content/browser/web_contents/web_contents_impl.h
 +++ b/content/browser/web_contents/web_contents_impl.h
-@@ -921,6 +921,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
+@@ -920,6 +920,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents,
    void SendScreenRects() override;
    TextInputManager* GetTextInputManager() override;
    bool OnUpdateDragCursor() override;

+ 0 - 20
patches/chromium/remove_menu_window_task_item.patch

@@ -1,20 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Cheng Zhao <[email protected]>
-Date: Thu, 4 Oct 2018 14:57:02 -0700
-Subject: fix: remove menu window from taskbar
-
-Refs https://chromium-review.googlesource.com/c/chromium/src/+/2245941
-
-diff --git a/ui/views/widget/widget_hwnd_utils.cc b/ui/views/widget/widget_hwnd_utils.cc
-index 40e66a212e3ea158b61f11d804a3c1644023b2d7..89f5b62f95dfec59bacf79f33895438039fac1c5 100644
---- a/ui/views/widget/widget_hwnd_utils.cc
-+++ b/ui/views/widget/widget_hwnd_utils.cc
-@@ -118,6 +118,8 @@ void CalculateWindowStylesFromInitParams(
-         else
-           *style |= WS_BORDER;
-       }
-+      if (!params.force_show_in_taskbar)
-+        *ex_style |= WS_EX_TOOLWINDOW;
-       break;
-     case Widget::InitParams::TYPE_TOOLTIP:
-       *style |= WS_POPUP;

+ 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 4894620e63bda3946292eb43ae19078172860843..b7c6293dfb3177164a34254613b320c690563a37 100644
+index f06eeeee05c8f645e4a5c640da69c524156e9ff0..7fe32cc32fba2b2760e23b9b83930c2726f44bf6 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
-@@ -1386,7 +1386,7 @@ if (is_chrome_branded && !is_android) {
+@@ -1388,7 +1388,7 @@ if (is_chrome_branded && !is_android) {
    }
  }
  
@@ -64,7 +64,7 @@ index 4894620e63bda3946292eb43ae19078172860843..b7c6293dfb3177164a34254613b320c6
    chrome_paks("packed_resources") {
      if (is_mac) {
        output_dir = "$root_gen_dir/repack"
-@@ -1406,6 +1406,12 @@ if (!is_android) {
+@@ -1408,6 +1408,12 @@ if (!is_android) {
    }
  }
  

+ 7 - 7
patches/chromium/revert_remove_contentrendererclient_shouldfork.patch

@@ -9,10 +9,10 @@ for every navigation to keep Node.js working properly. Once Native Modules in th
 are required to be NAPI or context aware (Electron v11), this patch can be removed.
 
 diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
-index 79d62d4dd739fbe51fedaf1b38e83669d625d7fc..f728b88778b7c9137833fece9615856a60fb399c 100644
+index 03d1e6a078433e15accf847439182f7c8dea3f00..bf5dc00667ff0e47e9a0833ad302d06c39b5f822 100644
 --- a/chrome/renderer/chrome_content_renderer_client.cc
 +++ b/chrome/renderer/chrome_content_renderer_client.cc
-@@ -1296,6 +1296,25 @@ bool ChromeContentRendererClient::AllowPopup() {
+@@ -1306,6 +1306,25 @@ bool ChromeContentRendererClient::AllowPopup() {
  #endif
  }
  
@@ -39,7 +39,7 @@ index 79d62d4dd739fbe51fedaf1b38e83669d625d7fc..f728b88778b7c9137833fece9615856a
      WebLocalFrame* frame,
      ui::PageTransition transition_type,
 diff --git a/chrome/renderer/chrome_content_renderer_client.h b/chrome/renderer/chrome_content_renderer_client.h
-index 416b7a8f3ba1b6941761c1df4ea108219c415489..2733d0dbbc10c5465a319b080d9b079258ba896d 100644
+index ea214daadf1e5613ab2e402f5d3783b150c41ede..31513568737c0cb9639451b74b0172825f6e8fc4 100644
 --- a/chrome/renderer/chrome_content_renderer_client.h
 +++ b/chrome/renderer/chrome_content_renderer_client.h
 @@ -127,6 +127,11 @@ class ChromeContentRendererClient
@@ -55,7 +55,7 @@ index 416b7a8f3ba1b6941761c1df4ea108219c415489..2733d0dbbc10c5465a319b080d9b0792
                         ui::PageTransition transition_type,
                         const blink::WebURL& url,
 diff --git a/content/public/renderer/content_renderer_client.cc b/content/public/renderer/content_renderer_client.cc
-index ea6d8e6357233f519c3cf41a96d8453993a9ce71..c513aff3e1c3da45e45954bc0beb80469de6a450 100644
+index 064d0a433dbe67cd24b92b78fab2f294ce5d320a..e38490b3cbfc62ed29ff93452814a9e65cd8bca6 100644
 --- a/content/public/renderer/content_renderer_client.cc
 +++ b/content/public/renderer/content_renderer_client.cc
 @@ -114,6 +114,14 @@ bool ContentRendererClient::HandleNavigation(
@@ -74,7 +74,7 @@ index ea6d8e6357233f519c3cf41a96d8453993a9ce71..c513aff3e1c3da45e45954bc0beb8046
      blink::WebLocalFrame* frame,
      ui::PageTransition transition_type,
 diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h
-index 9d321040de33acac09e83cc582f685740f425009..8f328979cc232c4f81a7f040e2424273a8248015 100644
+index d57edc0cea54b9d78700c3b9acdcfcc5f17341dd..e56aae188d7d8f46a4438b8e99f7e9b714c5875a 100644
 --- a/content/public/renderer/content_renderer_client.h
 +++ b/content/public/renderer/content_renderer_client.h
 @@ -228,6 +228,13 @@ class CONTENT_EXPORT ContentRendererClient {
@@ -92,10 +92,10 @@ index 9d321040de33acac09e83cc582f685740f425009..8f328979cc232c4f81a7f040e2424273
    // |url|. If the function returns a valid |new_url|, the request must be
    // updated to use it. The |force_ignore_site_for_cookies| output parameter
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index a5a95523e16fd35018f9646ae4a4d51e5ca626c0..4133bb215a66be974e5dfc0f3e0c89614bb58523 100644
+index 55af1205b90a1fce035a6b7abf1797fe20ea1f7b..31c5bf1f0081f61313179a79529497f773b76ff0 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -5478,6 +5478,23 @@ void RenderFrameImpl::BeginNavigation(
+@@ -5484,6 +5484,23 @@ void RenderFrameImpl::BeginNavigation(
      // we can do a per-frame check here rather than a process-wide check.
      bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
                         (enabled_bindings_ & kWebUIBindingsPolicyMask);

+ 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 7875675a3567283699cb33a77223ab355fe5e8f2..c1af2355ef8d50d067da32c322eccbacbe535ed9 100644
+index baee6cbd6369e60471741770f1ab56e72f6c4c7c..bbbe819d4442e55d5dbdb54f82241ddec0ef5f0b 100644
 --- a/content/renderer/render_thread_impl.cc
 +++ b/content/renderer/render_thread_impl.cc
-@@ -1356,7 +1356,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
+@@ -1360,7 +1360,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
  }
  
  bool RenderThreadImpl::IsElasticOverscrollEnabled() {

+ 2 - 2
patches/chromium/support_mixed_sandbox_with_zygote.patch

@@ -22,7 +22,7 @@ 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 5f73faa60d4e8d8688af6513134a7696fd464026..03c5e4cc58ae9321dc2a89cef43d615ac2023916 100644
+index a2fc5326f7ecc3d0bd57587f78d0e3231c5a49ac..e5a82f46cd58b0da9959930ee85303e4a1530425 100644
 --- a/content/browser/renderer_host/render_process_host_impl.cc
 +++ b/content/browser/renderer_host/render_process_host_impl.cc
 @@ -414,6 +414,11 @@ class RendererSandboxedProcessLauncherDelegate
@@ -40,7 +40,7 @@ index 5f73faa60d4e8d8688af6513134a7696fd464026..03c5e4cc58ae9321dc2a89cef43d615a
 @@ -435,6 +440,9 @@ class RendererSandboxedProcessLauncherDelegate
  
  #if BUILDFLAG(USE_ZYGOTE_HANDLE)
-   service_manager::ZygoteHandle GetZygote() override {
+   ZygoteHandle GetZygote() override {
 +    if (!use_zygote_) {
 +      return nullptr;
 +    }

+ 0 - 30
patches/chromium/tts.patch

@@ -1,30 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Heilig Benedek <[email protected]>
-Date: Thu, 18 Oct 2018 17:08:03 -0700
-Subject: tts.patch
-
-* Adds patch in //chrome/browser/speech/tts_controller_impl.cc
-  to disable calls using chrome profile class.
-* Adds patch in //chrome/browser/speech/tts_message_filter.cc
-  to remove reference to browser context when its signaled for
-  destruction from content layer.
-
-diff --git a/chrome/browser/speech/tts_controller_delegate_impl.cc b/chrome/browser/speech/tts_controller_delegate_impl.cc
-index c62476d6f77857eb9e254afddb02c772338425de..8b5b9a090f33fc0a961901d9058fbdf3070efea6 100644
---- a/chrome/browser/speech/tts_controller_delegate_impl.cc
-+++ b/chrome/browser/speech/tts_controller_delegate_impl.cc
-@@ -211,6 +211,7 @@ void TtsControllerDelegateImpl::UpdateUtteranceDefaultsFromPrefs(
- const PrefService* TtsControllerDelegateImpl::GetPrefService(
-     content::TtsUtterance* utterance) {
-   const PrefService* prefs = nullptr;
-+#if 0
-   // The utterance->GetBrowserContext() is null in tests.
-   if (utterance->GetBrowserContext()) {
-     const Profile* profile =
-@@ -218,5 +219,6 @@ const PrefService* TtsControllerDelegateImpl::GetPrefService(
-     if (profile)
-       prefs = profile->GetPrefs();
-   }
-+#endif
-   return prefs;
- }

+ 1 - 1
patches/chromium/ui_gtk_public_header.patch

@@ -6,7 +6,7 @@ Subject: ui_gtk_public_header.patch
 Allow electron to depend on //ui/gtk/gtk_util.h
 
 diff --git a/ui/gtk/BUILD.gn b/ui/gtk/BUILD.gn
-index d849743769837288848fd1a6e9ed75127e1a6d1d..bcdc4df20d86ac7f2b9a8a0327dd4d71aced9b20 100644
+index 02e12b9db88d24183bf98ef7383da6ce80f600bd..3ac1ede81e44147a918fee2e9d65aa8726c2b94b 100644
 --- a/ui/gtk/BUILD.gn
 +++ b/ui/gtk/BUILD.gn
 @@ -22,13 +22,15 @@ component("gtk_ui_delegate") {

+ 2 - 2
patches/chromium/unsandboxed_ppapi_processes_skip_zygote.patch

@@ -6,11 +6,11 @@ Subject: unsandboxed_ppapi_processes_skip_zygote.patch
 Unsandboxed ppapi processes should skip zygote.
 
 diff --git a/content/browser/ppapi_plugin_process_host.cc b/content/browser/ppapi_plugin_process_host.cc
-index 18ca6cf2de5b58f65a4786f9b7bfcd8ad0c2e9ae..0792c6f681f2cec8993de8c51fabdc5bc102ed25 100644
+index 09f2cabf4c3a97785eb24368762f9a221896f188..3956d540fb9122d2ec1217682a4cea5f9e014d27 100644
 --- a/content/browser/ppapi_plugin_process_host.cc
 +++ b/content/browser/ppapi_plugin_process_host.cc
 @@ -123,6 +123,9 @@ class PpapiPluginSandboxedProcessLauncherDelegate
-   service_manager::ZygoteHandle GetZygote() override {
+   ZygoteHandle GetZygote() override {
      const base::CommandLine& browser_command_line =
          *base::CommandLine::ForCurrentProcess();
 +    if (browser_command_line.HasSwitch(service_manager::switches::kNoSandbox)) {

+ 1 - 1
patches/chromium/use_electron_resources_in_pdf_util.patch

@@ -8,7 +8,7 @@ and cause a DCHECK(), since the resource will be loaded as an empty
 string.
 
 diff --git a/chrome/browser/pdf/pdf_extension_util.cc b/chrome/browser/pdf/pdf_extension_util.cc
-index 77c529ba92ecadbad3fbbb1431fe90abef9ea8bb..ae10e620fdefcaa1f0127864418d8edca8468533 100644
+index 9fd9791fd923d6c5e741cb7dc064ababf9a7995a..0a5534f2f09224196971076794daa3c805c91606 100644
 --- a/chrome/browser/pdf/pdf_extension_util.cc
 +++ b/chrome/browser/pdf/pdf_extension_util.cc
 @@ -8,7 +8,7 @@

+ 1 - 1
patches/chromium/web_contents.patch

@@ -9,7 +9,7 @@ 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 9ac8c8ea965a33e64a656f4478b217d3e6288597..ca90c21170ff3405efa1da230944faaaf12ce1b4 100644
+index ee336b57fa13ec611b4591cb8147ec8f29f162e2..b08fdaca5d59deb48d83b50d917c80908a2fa02f 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
 @@ -2225,6 +2225,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {

+ 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 3e382a6aaa621f91abd9553b3ba9f77a38dad3bd..6b0706c20367b26258df8990ec393e06ffa12f95 100644
+index b332c568cb33544ef37c8d149ec36127571696bc..92049b3fb017013ad8afb4a7b89d71fba6fe920b 100644
 --- a/content/browser/web_contents/web_contents_view_aura.cc
 +++ b/content/browser/web_contents/web_contents_view_aura.cc
-@@ -784,9 +784,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
+@@ -789,9 +789,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const {
  
  bool WebContentsViewAura::IsValidDragTarget(
      RenderWidgetHostImpl* target_rwh) const {

+ 8 - 8
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 4cc9d55795035e6857f6e4ceb839d056d48c96cd..9d321040de33acac09e83cc582f685740f425009 100644
+index f6d2f50e8d6b4a5df796f2d4478ccd3048101532..d57edc0cea54b9d78700c3b9acdcfcc5f17341dd 100644
 --- a/content/public/renderer/content_renderer_client.h
 +++ b/content/public/renderer/content_renderer_client.h
-@@ -395,6 +395,11 @@ class CONTENT_EXPORT ContentRendererClient {
+@@ -397,6 +397,11 @@ class CONTENT_EXPORT ContentRendererClient {
    virtual void DidInitializeWorkerContextOnWorkerThread(
        v8::Local<v8::Context> context) {}
  
@@ -26,7 +26,7 @@ index 4cc9d55795035e6857f6e4ceb839d056d48c96cd..9d321040de33acac09e83cc582f68574
    // 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 138a0aafcafa7512ba13026c26b433b3517867f4..e5c439f283a14d58235ce08ac62ce4c82bdbd0f7 100644
+index a4382a6afa328308e9d3a39ddbdc6f3248c6f4c0..d5a84147b0479e18e53fc94b28c41393803c8af3 100644
 --- a/content/renderer/renderer_blink_platform_impl.cc
 +++ b/content/renderer/renderer_blink_platform_impl.cc
 @@ -860,6 +860,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() {
@@ -43,7 +43,7 @@ index 138a0aafcafa7512ba13026c26b433b3517867f4..e5c439f283a14d58235ce08ac62ce4c8
      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 12044eb34510d190981e5e82b4939adc159f9aa5..54d3dd4245aa880ff7503264edbf47cf46f8796a 100644
+index 59d7d92cf5f76f45c41c8d10465bbb57b19e8676..6c8ef4c7c37e6b951f228500b178a53d91ebdfb9 100644
 --- a/content/renderer/renderer_blink_platform_impl.h
 +++ b/content/renderer/renderer_blink_platform_impl.h
 @@ -181,6 +181,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
@@ -55,10 +55,10 @@ index 12044eb34510d190981e5e82b4939adc159f9aa5..54d3dd4245aa880ff7503264edbf47cf
        const blink::WebString& header_name) override;
  
 diff --git a/third_party/blink/public/platform/platform.h b/third_party/blink/public/platform/platform.h
-index 977d2c47345264bb3c4c6662fe97adf8f9faccd0..5d1187cb10f828e4774f871ead1c23833ce63948 100644
+index 3278250b6d3d161a07f7cda5e18a281457ae519a..01930661416c1987790bb9b3fdd88a04e3662c7a 100644
 --- a/third_party/blink/public/platform/platform.h
 +++ b/third_party/blink/public/platform/platform.h
-@@ -623,6 +623,7 @@ class BLINK_PLATFORM_EXPORT Platform {
+@@ -619,6 +619,7 @@ class BLINK_PLATFORM_EXPORT Platform {
    virtual void DidStartWorkerThread() {}
    virtual void WillStopWorkerThread() {}
    virtual void WorkerContextCreated(const v8::Local<v8::Context>& worker) {}
@@ -67,10 +67,10 @@ index 977d2c47345264bb3c4c6662fe97adf8f9faccd0..5d1187cb10f828e4774f871ead1c2383
        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 f655c4ecc13e8445e35c6a79625946c9c7fb671b..32bac98ed79471178c36590b7db99fc1a95363b0 100644
+index 05414c7fba07de0b461100614e396b96c0389330..7cfe2ca3b42e0378dd84816195f440b1f85ed5fc 100644
 --- a/third_party/blink/renderer/core/workers/worker_thread.cc
 +++ b/third_party/blink/renderer/core/workers/worker_thread.cc
-@@ -686,6 +686,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
+@@ -682,6 +682,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
      nested_runner_->QuitNow();
    }
  

+ 3 - 3
patches/v8/add_realloc.patch

@@ -12,10 +12,10 @@ when we override ReallocateBufferMemory, so we therefore need to implement
 Realloc on the v8 side.
 
 diff --git a/include/v8.h b/include/v8.h
-index b2274c7b91b0552faa6077dafa9e12ef9b07c3e5..533ca94ecbdee4e6d13a99ab616d7f079ac8ccf9 100644
+index 13b40db28eb08e4ad602d23fcab2f56900896dd8..f27cc892846cd6de06ec5fc0e908a7884fc40d06 100644
 --- a/include/v8.h
 +++ b/include/v8.h
-@@ -5051,6 +5051,13 @@ class V8_EXPORT ArrayBuffer : public Object {
+@@ -5068,6 +5068,13 @@ class V8_EXPORT ArrayBuffer : public Object {
       */
      virtual void* AllocateUninitialized(size_t length) = 0;
  
@@ -30,7 +30,7 @@ index b2274c7b91b0552faa6077dafa9e12ef9b07c3e5..533ca94ecbdee4e6d13a99ab616d7f07
       * Free the memory block of size |length|, pointed to by |data|.
       * That memory is guaranteed to be previously allocated by |Allocate|.
 diff --git a/src/api/api.cc b/src/api/api.cc
-index b26acef20874b4ea303c302a254616fab43e3a82..b7fe46660e1502db23e1eb31c45be1b6923ba7f2 100644
+index 49b1a1d15734dc284264c3b9af6a99559c0367dd..8776d3369e2c5f36b43309e38def79d25fc231d9 100644
 --- a/src/api/api.cc
 +++ b/src/api/api.cc
 @@ -533,6 +533,10 @@ void V8::SetSnapshotDataBlob(StartupData* snapshot_blob) {

+ 1 - 1
patches/v8/build_gn.patch

@@ -9,7 +9,7 @@ necessary for native modules to load.
 Also, some fixes relating to mksnapshot on ARM.
 
 diff --git a/BUILD.gn b/BUILD.gn
-index 6ac9e37d0426bc8312c347cbc0ec61c2a636608f..79b78807f0aac98190fb9fe1de58aa8e30dd332f 100644
+index 65d137cbedec79c78c7d80870058c464d0df003c..a82e1923db35cd88352518591412dbee86b4ddf6 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
 @@ -355,7 +355,7 @@ config("internal_config") {

+ 4 - 4
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 b7fe46660e1502db23e1eb31c45be1b6923ba7f2..811c6815c6bd770e2bb014994b859dfdc1eb5630 100644
+index 8776d3369e2c5f36b43309e38def79d25fc231d9..827dd51fc68b180e1e2f3a0b93ef950959982e06 100644
 --- a/src/api/api.cc
 +++ b/src/api/api.cc
-@@ -8634,7 +8634,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
+@@ -8656,7 +8656,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) {
  }
  
  void Isolate::PerformMicrotaskCheckpoint() {
@@ -19,10 +19,10 @@ index b7fe46660e1502db23e1eb31c45be1b6923ba7f2..811c6815c6bd770e2bb014994b859dfd
    isolate->default_microtask_queue()->PerformCheckpoint(this);
  }
 diff --git a/src/heap/heap.cc b/src/heap/heap.cc
-index 4c6bf8aff32e294b5d3fdc965baaffb3ca989ea0..5258597c48189dbc741e321e8df4e3b5e7c29066 100644
+index 4d23e084b95c8f8b9f8fcd5e1059390a9d32883d..6326286418ce44869c484a46811b7079cb06f229 100644
 --- a/src/heap/heap.cc
 +++ b/src/heap/heap.cc
-@@ -5642,9 +5642,9 @@ void Heap::TearDown() {
+@@ -5645,9 +5645,9 @@ void Heap::TearDown() {
  void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback,
                                   GCType gc_type, void* data) {
    DCHECK_NOT_NULL(callback);

+ 1 - 1
patches/v8/do_not_export_private_v8_symbols_on_windows.patch

@@ -12,7 +12,7 @@ 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 bf06d50979db2e3b989cb996a3b29e42bae05c76..a388baea736340d24c8d6b787e512d7cd85bad12 100644
+index 306478ddb8131a127cac002609e8756b71c60206..7040084426fe8e4677712a9651717b440b001244 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
 @@ -355,6 +355,10 @@ config("internal_config") {

+ 1 - 1
patches/v8/expose_mksnapshot.patch

@@ -6,7 +6,7 @@ Subject: expose_mksnapshot.patch
 Needed in order to target mksnapshot for mksnapshot zip.
 
 diff --git a/BUILD.gn b/BUILD.gn
-index 79b78807f0aac98190fb9fe1de58aa8e30dd332f..bf06d50979db2e3b989cb996a3b29e42bae05c76 100644
+index a82e1923db35cd88352518591412dbee86b4ddf6..306478ddb8131a127cac002609e8756b71c60206 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
 @@ -4334,7 +4334,6 @@ if (current_toolchain == v8_generator_toolchain) {

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

@@ -89,8 +89,8 @@ bool NativeTheme::ShouldUseInvertedColorScheme() {
     return false;
   return is_inverted;
 #else
-  return ui_theme_->GetHighContrastColorScheme() ==
-         ui::NativeTheme::HighContrastColorScheme::kDark;
+  return ui_theme_->GetPlatformHighContrastColorScheme() ==
+         ui::NativeTheme::PlatformHighContrastColorScheme::kDark;
 #endif
 }
 

+ 2 - 1
shell/browser/api/electron_api_power_monitor_win.cc

@@ -7,6 +7,7 @@
 #include <windows.h>
 #include <wtsapi32.h>
 
+#include "base/win/windows_types.h"
 #include "base/win/wrapped_window_proc.h"
 #include "ui/base/win/shell.h"
 #include "ui/gfx/win/hwnd_util.h"
@@ -34,7 +35,7 @@ void PowerMonitor::InitPlatformSpecificMonitors() {
   // session lock and unlock events.
   window_ = CreateWindow(MAKEINTATOM(atom_), 0, 0, 0, 0, 0, 0, HWND_MESSAGE, 0,
                          instance_, 0);
-  gfx::CheckWindowCreated(window_);
+  gfx::CheckWindowCreated(window_, ::GetLastError());
   gfx::SetWindowUserData(window_, this);
 
   // Tel windows we want to be notified with session events

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

@@ -38,8 +38,8 @@ bool SystemPreferences::IsDarkMode() {
 
 bool SystemPreferences::IsInvertedColorScheme() {
   return ui::NativeTheme::GetInstanceForNativeUi()
-             ->GetHighContrastColorScheme() ==
-         ui::NativeTheme::HighContrastColorScheme::kDark;
+             ->GetPlatformHighContrastColorScheme() ==
+         ui::NativeTheme::PlatformHighContrastColorScheme::kDark;
 }
 
 bool SystemPreferences::IsHighContrastColorScheme() {

+ 2 - 1
shell/browser/api/electron_api_system_preferences_win.cc

@@ -10,6 +10,7 @@
 #include "shell/browser/api/electron_api_system_preferences.h"
 
 #include "base/win/core_winrt_util.h"
+#include "base/win/windows_types.h"
 #include "base/win/wrapped_window_proc.h"
 #include "shell/common/color_util.h"
 #include "ui/base/win/shell.h"
@@ -209,7 +210,7 @@ void SystemPreferences::InitializeWindow() {
   // receive broadcast messages like "WM_DWMCOLORIZATIONCOLORCHANGED".
   window_ = CreateWindow(MAKEINTATOM(atom_), 0, WS_POPUP, 0, 0, 0, 0, 0, 0,
                          instance_, 0);
-  gfx::CheckWindowCreated(window_);
+  gfx::CheckWindowCreated(window_, ::GetLastError());
   gfx::SetWindowUserData(window_, this);
 }
 

+ 6 - 0
shell/browser/browser_process_impl.cc

@@ -9,6 +9,7 @@
 #include <utility>
 
 #include "chrome/common/chrome_switches.h"
+#include "components/federated_learning/floc_blocklist_service.h"  // nogncheck
 #include "components/prefs/in_memory_pref_store.h"
 #include "components/prefs/overlay_user_pref_store.h"
 #include "components/prefs/pref_registry.h"
@@ -237,6 +238,11 @@ BrowserProcessImpl::subresource_filter_ruleset_service() {
   return nullptr;
 }
 
+federated_learning::FlocBlocklistService*
+BrowserProcessImpl::floc_blocklist_service() {
+  return nullptr;
+}
+
 optimization_guide::OptimizationGuideService*
 BrowserProcessImpl::optimization_guide_service() {
   return nullptr;

+ 1 - 0
shell/browser/browser_process_impl.h

@@ -79,6 +79,7 @@ class BrowserProcessImpl : public BrowserProcess {
   safe_browsing::SafeBrowsingService* safe_browsing_service() override;
   subresource_filter::RulesetService* subresource_filter_ruleset_service()
       override;
+  federated_learning::FlocBlocklistService* floc_blocklist_service() override;
   optimization_guide::OptimizationGuideService* optimization_guide_service()
       override;
   component_updater::ComponentUpdateService* component_updater() override;

+ 3 - 10
shell/browser/electron_browser_client.cc

@@ -39,6 +39,8 @@
 #include "content/public/browser/render_process_host.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/site_instance.h"
+#include "content/public/browser/tts_controller.h"
+#include "content/public/browser/tts_platform.h"
 #include "content/public/common/content_descriptors.h"
 #include "content/public/common/content_paths.h"
 #include "content/public/common/content_switches.h"
@@ -128,10 +130,6 @@
 #include "shell/browser/fake_location_provider.h"
 #endif  // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
 
-#if BUILDFLAG(ENABLE_TTS)
-#include "chrome/browser/speech/tts_controller_delegate_impl.h"
-#endif  // BUILDFLAG(ENABLE_TTS)
-
 #if BUILDFLAG(ENABLE_PRINTING)
 #include "chrome/browser/printing/printing_message_filter.h"
 #endif  // BUILDFLAG(ENABLE_PRINTING)
@@ -565,13 +563,8 @@ ElectronBrowserClient::CreateSpeechRecognitionManagerDelegate() {
   return new ElectronSpeechRecognitionManagerDelegate;
 }
 
-content::TtsControllerDelegate*
-ElectronBrowserClient::GetTtsControllerDelegate() {
-#if BUILDFLAG(ENABLE_TTS)
-  return TtsControllerDelegateImpl::GetInstance();
-#else
+content::TtsPlatform* ElectronBrowserClient::GetTtsPlatform() {
   return nullptr;
-#endif
 }
 
 void ElectronBrowserClient::OverrideWebkitPrefs(

+ 2 - 1
shell/browser/electron_browser_client.h

@@ -87,7 +87,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
   void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
   content::SpeechRecognitionManagerDelegate*
   CreateSpeechRecognitionManagerDelegate() override;
-  content::TtsControllerDelegate* GetTtsControllerDelegate() override;
+  content::TtsPlatform* GetTtsPlatform() override;
+
   void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
                            content::WebPreferences* prefs) override;
   SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation(

+ 15 - 8
shell/browser/native_window_views.cc

@@ -955,16 +955,23 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) {
     SetForwardMouseMessages(forward);
   }
 #elif defined(USE_X11)
+  auto* connection = x11::Connection::Get();
   if (ignore) {
-    XRectangle r = {0, 0, 1, 1};
-    XShapeCombineRectangles(gfx::GetXDisplay(),
-                            static_cast<uint32_t>(GetAcceleratedWidget()),
-                            ShapeInput, 0, 0, &r, 1, ShapeSet,
-                            static_cast<int>(x11::ClipOrdering::YXBanded));
+    x11::Rectangle r{0, 0, 1, 1};
+    connection->shape().Rectangles({
+        .operation = x11::Shape::So::Set,
+        .destination_kind = x11::Shape::Sk::Input,
+        .ordering = x11::ClipOrdering::YXBanded,
+        .destination_window = static_cast<x11::Window>(GetAcceleratedWidget()),
+        .rectangles = {r},
+    });
   } else {
-    XShapeCombineMask(gfx::GetXDisplay(),
-                      static_cast<uint32_t>(GetAcceleratedWidget()), ShapeInput,
-                      0, 0, x11::None, ShapeSet);
+    connection->shape().Mask({
+        .operation = x11::Shape::So::Set,
+        .destination_kind = x11::Shape::Sk::Input,
+        .destination_window = static_cast<x11::Window>(GetAcceleratedWidget()),
+        .source_bitmap = x11::Pixmap::None,
+    });
   }
 #endif
 }

+ 1 - 0
shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.cc

@@ -17,6 +17,7 @@
 #include <utility>
 #include <vector>
 
+#include "base/check.h"
 #include "shell/browser/notifications/win/win32_desktop_notifications/common.h"
 #include "shell/browser/notifications/win/win32_desktop_notifications/toast.h"
 

+ 1 - 1
shell/browser/notifications/win/win32_desktop_notifications/toast.h

@@ -9,7 +9,7 @@
 
 #include "shell/browser/notifications/win/win32_desktop_notifications/desktop_notification_controller.h"
 
-#include "base/logging.h"
+#include "base/check.h"
 
 namespace electron {
 

+ 3 - 0
shell/browser/notifications/win/win32_desktop_notifications/toast_uia.cc

@@ -3,7 +3,10 @@
 // found in the LICENSE file.
 
 #include "shell/browser/notifications/win/win32_desktop_notifications/toast_uia.h"
+
 #include <UIAutomation.h>
+
+#include "base/check_op.h"
 #include "shell/browser/notifications/win/win32_desktop_notifications/common.h"
 
 #pragma comment(lib, "uiautomationcore.lib")

+ 89 - 13
shell/browser/printing/print_preview_message_handler.cc

@@ -67,6 +67,9 @@ bool PrintPreviewMessageHandler::OnMessageReceived(
                                    render_frame_host)
     IPC_MESSAGE_HANDLER(PrintHostMsg_MetafileReadyForPrinting,
                         OnMetafileReadyForPrinting)
+    IPC_MESSAGE_HANDLER(PrintHostMsg_DidPreviewPage, OnDidPreviewPage)
+    IPC_MESSAGE_HANDLER(PrintHostMsg_DidPrepareDocumentForPreview,
+                        OnDidPrepareForDocumentToPdf)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
   return handled;
@@ -79,42 +82,75 @@ void PrintPreviewMessageHandler::OnMetafileReadyForPrinting(
   // Always try to stop the worker.
   StopWorker(params.document_cookie);
 
-  const printing::mojom::DidPrintContentParams& content = params.content;
-  if (!content.metafile_data_region.IsValid() ||
-      params.expected_pages_count <= 0) {
+  if (params.expected_pages_count == 0) {
     RejectPromise(ids.request_id);
     return;
   }
 
+  const base::ReadOnlySharedMemoryRegion& metafile =
+      params.content.metafile_data_region;
+
   if (printing::IsOopifEnabled()) {
     auto* client =
         printing::PrintCompositeClient::FromWebContents(web_contents());
     DCHECK(client);
 
-    auto callback =
-        base::BindOnce(&PrintPreviewMessageHandler::OnCompositePdfDocumentDone,
-                       weak_ptr_factory_.GetWeakPtr(), ids);
-    client->DoCompositeDocumentToPdf(
-        params.document_cookie, render_frame_host, content,
+    auto callback = base::BindOnce(
+        &PrintPreviewMessageHandler::OnCompositeDocumentToPdfDone,
+        weak_ptr_factory_.GetWeakPtr(), ids);
+
+    client->DoCompleteDocumentToPdf(
+        params.document_cookie, params.expected_pages_count,
         mojo::WrapCallbackWithDefaultInvokeIfNotRun(
             std::move(callback),
             printing::mojom::PrintCompositor::Status::kCompositingFailure,
             base::ReadOnlySharedMemoryRegion()));
   } else {
-    ResolvePromise(ids.request_id,
-                   base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(
-                       content.metafile_data_region));
+    ResolvePromise(
+        ids.request_id,
+        base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(metafile));
   }
 }
 
-void PrintPreviewMessageHandler::OnCompositePdfDocumentDone(
+void PrintPreviewMessageHandler::OnPrepareForDocumentToPdfDone(
+    const PrintHostMsg_PreviewIds& ids,
+    printing::mojom::PrintCompositor::Status status) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  if (status != printing::mojom::PrintCompositor::Status::kSuccess) {
+    LOG(ERROR) << "Preparing document for pdf failed with error " << status;
+  }
+}
+
+void PrintPreviewMessageHandler::OnDidPrepareForDocumentToPdf(
+    content::RenderFrameHost* render_frame_host,
+    int document_cookie,
+    const PrintHostMsg_PreviewIds& ids) {
+  if (printing::IsOopifEnabled()) {
+    auto* client =
+        printing::PrintCompositeClient::FromWebContents(web_contents());
+    DCHECK(client);
+
+    if (client->GetIsDocumentConcurrentlyComposited(document_cookie))
+      return;
+
+    client->DoPrepareForDocumentToPdf(
+        document_cookie,
+        mojo::WrapCallbackWithDefaultInvokeIfNotRun(
+            base::BindOnce(
+                &PrintPreviewMessageHandler::OnPrepareForDocumentToPdfDone,
+                weak_ptr_factory_.GetWeakPtr(), ids),
+            printing::mojom::PrintCompositor::Status::kCompositingFailure));
+  }
+}
+
+void PrintPreviewMessageHandler::OnCompositeDocumentToPdfDone(
     const PrintHostMsg_PreviewIds& ids,
     printing::mojom::PrintCompositor::Status status,
     base::ReadOnlySharedMemoryRegion region) {
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 
   if (status != printing::mojom::PrintCompositor::Status::kSuccess) {
-    DLOG(ERROR) << "Compositing pdf failed with error " << status;
+    LOG(ERROR) << "Compositing pdf failed with error " << status;
     RejectPromise(ids.request_id);
     return;
   }
@@ -124,6 +160,46 @@ void PrintPreviewMessageHandler::OnCompositePdfDocumentDone(
       base::RefCountedSharedMemoryMapping::CreateFromWholeRegion(region));
 }
 
+void PrintPreviewMessageHandler::OnCompositePdfPageDone(
+    int page_number,
+    int document_cookie,
+    const PrintHostMsg_PreviewIds& ids,
+    printing::mojom::PrintCompositor::Status status,
+    base::ReadOnlySharedMemoryRegion region) {
+  DCHECK_CURRENTLY_ON(BrowserThread::UI);
+  if (status != printing::mojom::PrintCompositor::Status::kSuccess) {
+    LOG(ERROR) << "Compositing pdf failed on page: " << page_number
+               << " with error: " << status;
+  }
+}
+
+void PrintPreviewMessageHandler::OnDidPreviewPage(
+    content::RenderFrameHost* render_frame_host,
+    const PrintHostMsg_DidPreviewPage_Params& params,
+    const PrintHostMsg_PreviewIds& ids) {
+  if (params.page_number < printing::FIRST_PAGE_INDEX ||
+      !params.content.metafile_data_region.IsValid()) {
+    RejectPromise(ids.request_id);
+    return;
+  }
+
+  if (printing::IsOopifEnabled()) {
+    auto* client =
+        printing::PrintCompositeClient::FromWebContents(web_contents());
+    DCHECK(client);
+
+    // Use utility process to convert skia metafile to pdf.
+    client->DoCompositePageToPdf(
+        params.document_cookie, render_frame_host, params.content,
+        mojo::WrapCallbackWithDefaultInvokeIfNotRun(
+            base::BindOnce(&PrintPreviewMessageHandler::OnCompositePdfPageDone,
+                           weak_ptr_factory_.GetWeakPtr(), params.page_number,
+                           params.document_cookie, ids),
+            printing::mojom::PrintCompositor::Status::kCompositingFailure,
+            base::ReadOnlySharedMemoryRegion()));
+  }
+}
+
 void PrintPreviewMessageHandler::PrintPreviewFailed(int32_t document_cookie,
                                                     int32_t request_id) {
   StopWorker(document_cookie);

+ 16 - 1
shell/browser/printing/print_preview_message_handler.h

@@ -19,6 +19,7 @@
 #include "v8/include/v8.h"
 
 struct PrintHostMsg_DidPreviewDocument_Params;
+struct PrintHostMsg_DidPreviewPage_Params;
 struct PrintHostMsg_PreviewIds;
 
 namespace content {
@@ -52,10 +53,24 @@ class PrintPreviewMessageHandler
       content::RenderFrameHost* render_frame_host,
       const PrintHostMsg_DidPreviewDocument_Params& params,
       const PrintHostMsg_PreviewIds& ids);
-  void OnCompositePdfDocumentDone(
+  void OnCompositeDocumentToPdfDone(
       const PrintHostMsg_PreviewIds& ids,
       printing::mojom::PrintCompositor::Status status,
       base::ReadOnlySharedMemoryRegion region);
+  void OnPrepareForDocumentToPdfDone(
+      const PrintHostMsg_PreviewIds& ids,
+      printing::mojom::PrintCompositor::Status status);
+  void OnDidPrepareForDocumentToPdf(content::RenderFrameHost* render_frame_host,
+                                    int document_cookie,
+                                    const PrintHostMsg_PreviewIds& ids);
+  void OnCompositePdfPageDone(int page_number,
+                              int document_cookie,
+                              const PrintHostMsg_PreviewIds& ids,
+                              printing::mojom::PrintCompositor::Status status,
+                              base::ReadOnlySharedMemoryRegion region);
+  void OnDidPreviewPage(content::RenderFrameHost* render_frame_host,
+                        const PrintHostMsg_DidPreviewPage_Params& params,
+                        const PrintHostMsg_PreviewIds& ids);
 
   // printing::mojo::PrintPreviewUI:
   void SetOptionsFromDocument(

+ 2 - 1
shell/browser/ui/win/notify_icon_host.cc

@@ -11,6 +11,7 @@
 #include "base/logging.h"
 #include "base/stl_util.h"
 #include "base/win/win_util.h"
+#include "base/win/windows_types.h"
 #include "base/win/wrapped_window_proc.h"
 #include "shell/browser/ui/win/notify_icon.h"
 #include "ui/events/event_constants.h"
@@ -69,7 +70,7 @@ NotifyIconHost::NotifyIconHost() {
   // "TaskbarCreated".
   window_ = CreateWindow(MAKEINTATOM(atom_), 0, WS_POPUP, 0, 0, 0, 0, 0, 0,
                          instance_, 0);
-  gfx::CheckWindowCreated(window_);
+  gfx::CheckWindowCreated(window_, ::GetLastError());
   gfx::SetWindowUserData(window_, this);
 }
 

+ 1 - 1
shell/common/node_includes.h

@@ -5,7 +5,7 @@
 #ifndef SHELL_COMMON_NODE_INCLUDES_H_
 #define SHELL_COMMON_NODE_INCLUDES_H_
 
-#include "base/logging.h"
+#include "base/check.h"
 
 // Include common headers for using node APIs.
 

+ 1 - 0
shell/common/v8_value_converter.cc

@@ -10,6 +10,7 @@
 #include <utility>
 #include <vector>
 
+#include "base/logging.h"
 #include "base/values.h"
 #include "shell/common/gin_helper/dictionary.h"
 #include "shell/common/node_bindings.h"

+ 15 - 2
spec-main/api-web-contents-spec.ts

@@ -1662,16 +1662,29 @@ describe('webContents module', () => {
       expect(width).to.be.greaterThan(height);
     });
 
-    it('does not crash when called multiple times', async () => {
+    it('does not crash when called multiple times in parallel', async () => {
       const promises = [];
-      for (let i = 0; i < 2; i++) {
+      for (let i = 0; i < 3; i++) {
         promises.push(w.webContents.printToPDF({}));
       }
+
       const results = await Promise.all(promises);
       for (const data of results) {
         expect(data).to.be.an.instanceof(Buffer).that.is.not.empty();
       }
     });
+
+    it('does not crash when called multiple times in sequence', async () => {
+      const results = [];
+      for (let i = 0; i < 3; i++) {
+        const result = await w.webContents.printToPDF({});
+        results.push(result);
+      }
+
+      for (const data of results) {
+        expect(data).to.be.an.instanceof(Buffer).that.is.not.empty();
+      }
+    });
   });
 
   describe('PictureInPicture video', () => {