Browse Source

chore: bump chromium to 83.0.4103.14 (9-x-y) (#23095)

Co-authored-by: deepak1556 <[email protected]>
Co-authored-by: Jeremy Apthorp <[email protected]>
Electron Bot 5 years ago
parent
commit
f193d9a34f
56 changed files with 219 additions and 247 deletions
  1. 0 1
      BUILD.gn
  2. 1 1
      DEPS
  3. 3 2
      chromium_src/BUILD.gn
  4. 2 3
      patches/chromium/.patches
  5. 1 1
      patches/chromium/add_contentgpuclient_precreatemessageloop_callback.patch
  6. 14 14
      patches/chromium/add_didinstallconditionalfeatures.patch
  7. 2 2
      patches/chromium/add_realloc.patch
  8. 6 6
      patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch
  9. 0 52
      patches/chromium/autofill_size_calculation.patch
  10. 2 2
      patches/chromium/blink-worker-enable-csp-in-file-scheme.patch
  11. 3 3
      patches/chromium/blink_local_frame.patch
  12. 3 3
      patches/chromium/can_create_window.patch
  13. 2 2
      patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch
  14. 2 2
      patches/chromium/content_browser_main_loop.patch
  15. 2 2
      patches/chromium/delay_lock_the_protocol_scheme_registry.patch
  16. 2 2
      patches/chromium/disable_hidden.patch
  17. 2 2
      patches/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch
  18. 2 2
      patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch
  19. 3 3
      patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch
  20. 2 2
      patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch
  21. 4 4
      patches/chromium/frame_host_manager.patch
  22. 4 4
      patches/chromium/gpu_notify_when_dxdiag_request_fails.patch
  23. 4 4
      patches/chromium/gtk_visibility.patch
  24. 7 7
      patches/chromium/put_back_deleted_colors_for_autofill.patch
  25. 1 1
      patches/chromium/resource_file_conflict.patch
  26. 0 52
      patches/chromium/revert_enable_samesitebydefaultcookies_and.patch
  27. 8 8
      patches/chromium/revert_remove_contentrendererclient_shouldfork.patch
  28. 2 2
      patches/chromium/scroll_bounce_flag.patch
  29. 29 0
      patches/chromium/ui_gtk_public_header.patch
  30. 6 6
      patches/chromium/web_contents.patch
  31. 4 4
      patches/chromium/worker_context_will_destroy.patch
  32. 3 3
      patches/v8/build_gn.patch
  33. 1 1
      patches/v8/do_not_export_private_v8_symbols_on_windows.patch
  34. 2 2
      patches/v8/expose_mksnapshot.patch
  35. 26 4
      shell/browser/api/electron_api_app.cc
  36. 4 1
      shell/browser/api/electron_api_app.h
  37. 9 5
      shell/browser/api/electron_api_web_contents.cc
  38. 2 0
      shell/browser/api/frame_subscriber.cc
  39. 2 0
      shell/browser/api/frame_subscriber.h
  40. 6 0
      shell/browser/browser.cc
  41. 1 0
      shell/browser/browser.h
  42. 1 1
      shell/browser/browser_linux.cc
  43. 5 0
      shell/browser/browser_observer.h
  44. 5 2
      shell/browser/electron_browser_main_parts.cc
  45. 1 1
      shell/browser/notifications/linux/libnotify_notification.cc
  46. 2 0
      shell/browser/osr/osr_video_consumer.cc
  47. 2 0
      shell/browser/osr/osr_video_consumer.h
  48. 5 18
      shell/browser/ui/autofill_popup.cc
  49. 2 2
      shell/browser/ui/file_dialog_gtk.cc
  50. 2 2
      shell/browser/ui/message_box_gtk.cc
  51. 1 1
      shell/browser/ui/views/menu_bar.cc
  52. 1 1
      shell/common/application_info_linux.cc
  53. 1 1
      shell/common/platform_util_linux.cc
  54. 1 1
      spec-main/extensions-spec.ts
  55. 1 1
      spec-main/fixtures/pages/webview-devtools.html
  56. 10 1
      spec-main/webview-spec.ts

+ 0 - 1
BUILD.gn

@@ -493,7 +493,6 @@ source_set("electron_lib") {
     deps += [
       ":libnotify_loader",
       "//build/config/linux/gtk",
-      "//chrome/browser/ui/gtk",
       "//dbus",
       "//device/bluetooth",
       "//third_party/breakpad:client",

+ 1 - 1
DEPS

@@ -12,7 +12,7 @@ gclient_gn_args = [
 
 vars = {
   'chromium_version':
-    '83.0.4102.3',
+    '83.0.4103.14',
   'node_version':
     'v12.14.1',
   'nan_version':

+ 3 - 2
chromium_src/BUILD.gn

@@ -51,8 +51,8 @@ static_library("chrome") {
     "//chrome/browser/ssl/security_state_tab_helper.cc",
     "//chrome/browser/ssl/security_state_tab_helper.h",
     "//chrome/browser/ssl/tls_deprecation_config.cc",
-    "//chrome/browser/ui/autofill/popup_view_common.cc",
-    "//chrome/browser/ui/autofill/popup_view_common.h",
+    "//chrome/browser/ui/views/autofill/autofill_popup_view_utils.cc",
+    "//chrome/browser/ui/views/autofill/autofill_popup_view_utils.h",
     "//chrome/browser/win/chrome_process_finder.cc",
     "//chrome/browser/win/chrome_process_finder.h",
     "//extensions/browser/app_window/size_constraints.cc",
@@ -69,6 +69,7 @@ static_library("chrome") {
   deps = [
     "//chrome/browser:resource_prefetch_predictor_proto",
     "//components/feature_engagement:buildflags",
+    "//components/optimization_guide/proto:optimization_guide_proto",
   ]
 
   if (is_linux) {

+ 2 - 3
patches/chromium/.patches

@@ -11,7 +11,6 @@ dom_storage_limits.patch
 render_widget_host_view_base.patch
 render_widget_host_view_mac.patch
 thread_capabilities.patch
-web_contents.patch
 webview_cross_drag.patch
 disable_user_gesture_requirement_for_beforeunload_dialogs.patch
 gin_enable_disable_v8_platform.patch
@@ -50,7 +49,6 @@ tts.patch
 printing.patch
 verbose_generate_breakpad_symbols.patch
 support_mixed_sandbox_with_zygote.patch
-autofill_size_calculation.patch
 fix_disable_usage_of_abort_report_np_in_mas_builds.patch
 fix_disable_usage_of_pthread_fchdir_np_and_pthread_chdir_np_in_mas.patch
 fix_disable_usage_of_setapplicationisdaemon_and.patch
@@ -91,4 +89,5 @@ feat_add_support_for_overriding_the_base_spellchecker_download_url.patch
 gpu_notify_when_dxdiag_request_fails.patch
 feat_allow_embedders_to_add_observers_on_created_hunspell.patch
 fix_account_for_print_preview_disabled_when_printing_to_pdf.patch
-revert_enable_samesitebydefaultcookies_and.patch
+web_contents.patch
+ui_gtk_public_header.patch

+ 1 - 1
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 a52345eb5b5facaf4ad1308c9d21407370d4c8bd..343f76603bd217e1d333944d4b7f20927121642f 100644
+index 0a96d09d0deca530bc9e3ab649e1a9cc5045b1fb..9b22493abbd81c2f592e75fe32f7ab7efbb281d9 100644
 --- a/content/gpu/gpu_main.cc
 +++ b/content/gpu/gpu_main.cc
 @@ -248,6 +248,10 @@ int GpuMain(const MainFunctionParams& parameters) {

+ 14 - 14
patches/chromium/add_didinstallconditionalfeatures.patch

@@ -23,10 +23,10 @@ index 172b2a246e6cdda81212a2cf4ec9c7e13cd4e85f..3932bd0a4d3de963d22869caaadb8b9a
                                          int32_t world_id) {}
    virtual void DidClearWindowObject() {}
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index 3a9e1b0aaccdfe2ae7b03426370592f620b87315..7a6562904eebbf55fcc4b08c9676a80350ce0863 100644
+index 2ab5e79b71cc8d5fa5c5690da0ac4fe3bf9a0def..902c33cac74cf66f97e7a900a736f59f0f3308fc 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -4926,6 +4926,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
+@@ -4933,6 +4933,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local<v8::Context> context,
      observer.DidCreateScriptContext(context, world_id);
  }
  
@@ -40,10 +40,10 @@ index 3a9e1b0aaccdfe2ae7b03426370592f620b87315..7a6562904eebbf55fcc4b08c9676a803
                                                 int world_id) {
    for (auto& observer : observers_)
 diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h
-index 3b58f29dbc91c52dd0046d389c11d9fd698e3948..090ea1fec07cdfc0567af63407f8ad9b0dde7cdc 100644
+index 6a33dcf8df3d64f09a262fe62fff1bc7a310d0cb..7c1ac8d9bdbfd01faa0515a8d3094dfd34696d97 100644
 --- a/content/renderer/render_frame_impl.h
 +++ b/content/renderer/render_frame_impl.h
-@@ -747,6 +747,8 @@ class CONTENT_EXPORT RenderFrameImpl
+@@ -750,6 +750,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 3b58f29dbc91c52dd0046d389c11d9fd698e3948..090ea1fec07cdfc0567af63407f8ad9b
                                  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 8a2f1ab74873599448f27b784024b39ba13c7c6e..0720d9062272fdc823963a856f1e85e485e348c7 100644
+index d11faf48cf3cc2165598737a4624db7d1f224fcd..01b9eed5509ee7b2138e6c6c9d422c75d2ee0a90 100644
 --- a/third_party/blink/public/web/web_local_frame_client.h
 +++ b/third_party/blink/public/web/web_local_frame_client.h
-@@ -555,6 +555,9 @@ class BLINK_EXPORT WebLocalFrameClient {
+@@ -557,6 +557,9 @@ class BLINK_EXPORT WebLocalFrameClient {
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) {}
  
@@ -67,10 +67,10 @@ index 8a2f1ab74873599448f27b784024b39ba13c7c6e..0720d9062272fdc823963a856f1e85e4
    virtual void WillReleaseScriptContext(v8::Local<v8::Context>,
                                          int32_t world_id) {}
 diff --git a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
-index c7eb05be74884686abc4cbb43868464d1066904f..8b05af30571f0a68a56adf6d74b2c7fc39591c70 100644
+index 81457a2e2b5723aa2ff218b4e410d55d7b7f14f8..a62f6c58bb0aaac836edfd87ab2a6f61045059dc 100644
 --- a/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
 +++ b/third_party/blink/renderer/bindings/core/v8/local_window_proxy.cc
-@@ -203,6 +203,7 @@ void LocalWindowProxy::Initialize() {
+@@ -201,6 +201,7 @@ void LocalWindowProxy::Initialize() {
    }
  
    InstallConditionalFeatures();
@@ -79,7 +79,7 @@ index c7eb05be74884686abc4cbb43868464d1066904f..8b05af30571f0a68a56adf6d74b2c7fc
    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 22919e83d2fa5329471357849db28fd94899e92f..106a099cdfc49bcfc5a396fac46e93699f99f5e1 100644
+index cb7aa76af1c748548a62f881f59b4879d4a7f0d4..5703bff85cac07aa9755d0ac8c603ba09c5cddc9 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
 @@ -344,6 +344,13 @@ void LocalFrameClientImpl::DidCreateScriptContext(
@@ -97,7 +97,7 @@ index 22919e83d2fa5329471357849db28fd94899e92f..106a099cdfc49bcfc5a396fac46e9369
      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 77194e8e0b10946df54e536df3f556ff66b3aac5..99e21afc95504ca4427f73cb6a268d0a57c0cb8f 100644
+index 74f08e06333566337f4a2c00319192106630bcf2..fe018133f56078c796d4bae934fb7359b21229f2 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 LocalFrameClientImpl final : public LocalFrameClient {
@@ -110,10 +110,10 @@ index 77194e8e0b10946df54e536df3f556ff66b3aac5..99e21afc95504ca4427f73cb6a268d0a
                                  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 5cd032934257d957b1e6ce85bf83e5a89dc6a87d..afca3554d93f7a6d5b3c10a7b594dcb1a3b6df07 100644
+index 5faee38f8a79c635d166ece00c845489fde53ebe..f35d1598ce62c1be35e51e39578454023e481f03 100644
 --- a/third_party/blink/renderer/core/frame/local_frame_client.h
 +++ b/third_party/blink/renderer/core/frame/local_frame_client.h
-@@ -288,6 +288,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
+@@ -289,6 +289,8 @@ class CORE_EXPORT LocalFrameClient : public FrameClient {
  
    virtual void DidCreateScriptContext(v8::Local<v8::Context>,
                                        int32_t world_id) = 0;
@@ -123,10 +123,10 @@ index 5cd032934257d957b1e6ce85bf83e5a89dc6a87d..afca3554d93f7a6d5b3c10a7b594dcb1
                                          int32_t world_id) = 0;
    virtual bool AllowScriptExtensions() = 0;
 diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h
-index ad193eee54963de001cee76153c6fafa25b814a1..d232898dfac0ba8f4b54a96b87e604dfea7ff7fc 100644
+index bbfe2870e688c446a85570b63e96a4457649e496..b2ec2661284c12c123bb17f31ed11f09432f0502 100644
 --- a/third_party/blink/renderer/core/loader/empty_clients.h
 +++ b/third_party/blink/renderer/core/loader/empty_clients.h
-@@ -340,6 +340,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
+@@ -341,6 +341,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient {
  
    void DidCreateScriptContext(v8::Local<v8::Context>,
                                int32_t world_id) override {}

+ 2 - 2
patches/chromium/add_realloc.patch

@@ -39,10 +39,10 @@ index 2aef366ac8194aa261cbca6abc051f7da8a988d3..3c7d66c81032636abcca4f1538ce9b7f
  
    GIN_EXPORT static ArrayBufferAllocator* SharedInstance();
 diff --git a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
-index e514c85d34e59f0f7bde3f62f567def06266bc79..c947c36b15d2cb8eac9d560b9aba9b0069bfc091 100644
+index 696a6170a584c1bb71c8ad253963d9f64395a13e..9677aa931cd543adfc1e9844d6afee8dcb0f4c2d 100644
 --- a/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
 +++ b/third_party/blink/renderer/bindings/core/v8/v8_initializer.cc
-@@ -681,6 +681,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
+@@ -661,6 +661,10 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
          size, ArrayBufferContents::kDontInitialize);
    }
  

+ 6 - 6
patches/chromium/add_trustedauthclient_to_urlloaderfactory.patch

@@ -49,10 +49,10 @@ index a46aab1db2de282e0ff3561a98bad1dac659b67a..31ce9719f63c564baf88e48c7494e030
    NetworkIsolationKey? network_isolation_key;
  
 diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc
-index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d26753c44ff50 100644
+index 3dc126f94737cbf7f01afcfe21e108b93b630b27..9ee5cd1bf6aefa28c2a58c648736f857383485e4 100644
 --- a/services/network/url_loader.cc
 +++ b/services/network/url_loader.cc
-@@ -486,6 +486,7 @@ URLLoader::URLLoader(
+@@ -487,6 +487,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 fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
      mojom::OriginPolicyManager* origin_policy_manager,
      std::unique_ptr<TrustTokenRequestHelper> trust_token_helper)
      : url_request_context_(url_request_context),
-@@ -546,6 +547,11 @@ URLLoader::URLLoader(
+@@ -543,6 +544,11 @@ URLLoader::URLLoader(
      header_client_.set_disconnect_handler(
          base::BindOnce(&URLLoader::OnMojoDisconnect, base::Unretained(this)));
    }
@@ -72,7 +72,7 @@ index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
    if (want_raw_headers_) {
      options_ |= mojom::kURLLoadOptionSendSSLInfoWithResponse |
                  mojom::kURLLoadOptionSendSSLInfoForCertificateError;
-@@ -1020,7 +1026,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
+@@ -1012,7 +1018,7 @@ void URLLoader::OnReceivedRedirect(net::URLRequest* url_request,
  
  void URLLoader::OnAuthRequired(net::URLRequest* url_request,
                                 const net::AuthChallengeInfo& auth_info) {
@@ -81,7 +81,7 @@ index fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
      OnAuthCredentials(base::nullopt);
      return;
    }
-@@ -1036,11 +1042,20 @@ void URLLoader::OnAuthRequired(net::URLRequest* url_request,
+@@ -1028,11 +1034,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 fb4f8ad895c685922af873f96f62ad4662a70f24..07fa817025eae412f43f6311b68d2675
    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 9a07d08baf1f52234898951f8680a8b3a5c6e82f..e99228fd574cd5291d71de6a5f77cdda2debea7c 100644
+index 9098fa1e35f8935c4c8183dac294fada6a0c113c..ab20b4fce4bc79f69cf1dea1989ceb817ab04fe6 100644
 --- a/services/network/url_loader.h
 +++ b/services/network/url_loader.h
 @@ -111,6 +111,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader

+ 0 - 52
patches/chromium/autofill_size_calculation.patch

@@ -1,52 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Heilig Benedek <[email protected]>
-Date: Wed, 30 Jan 2019 17:04:33 +0100
-Subject: autofill_size_calculation.patch
-
-We don't want to call into chrome internals for autofill popup size
-calculations. The default GetWindowBounds calls into chrome internal
-functions to find out the size of the window - this can be overridden
-but even then some methods call into the original. Let's just return
-an empty gfx::Rect and do the actual job in the subclass.
-
-diff --git a/chrome/browser/ui/autofill/popup_view_common.cc b/chrome/browser/ui/autofill/popup_view_common.cc
-index 25e2cfce4999bdf6a94d61aae4558470d18f89ed..c9880bcd639eb59ae52c38dbdabbd86ebac3b530 100644
---- a/chrome/browser/ui/autofill/popup_view_common.cc
-+++ b/chrome/browser/ui/autofill/popup_view_common.cc
-@@ -8,15 +8,19 @@
- #include <utility>
- 
- #include "build/build_config.h"
-+#if 0
- #include "chrome/browser/platform_util.h"
-+#endif
- #include "ui/gfx/geometry/vector2d.h"
- 
- #if defined(OS_ANDROID)
- #include "ui/android/view_android.h"
- #include "ui/android/window_android.h"
- #else  // defined(OS_ANDROID)
-+#if 0
- #include "chrome/browser/ui/browser_finder.h"
- #include "chrome/browser/ui/browser_window.h"
-+#endif
- #include "ui/views/widget/widget.h"
- #endif  // !defined(OS_ANDROID)
- 
-@@ -176,14 +180,14 @@ gfx::Rect PopupViewCommon::GetWindowBounds(gfx::NativeView container_view) {
-       views::Widget::GetTopLevelWidgetForNativeView(container_view);
-   if (widget)
-     return widget->GetWindowBoundsInScreen();
--
-+#if 0
-   // If the widget is null, try to get these bounds from a browser window. This
-   // is common on Mac when the window is drawn using Cocoa.
-   gfx::NativeWindow window = platform_util::GetTopLevel(container_view);
-   Browser* browser = chrome::FindBrowserWithWindow(window);
-   if (browser)
-     return browser->window()->GetBounds();
--
-+#endif
-   // If the browser is null, simply return an empty rect. The most common reason
-   // to end up here is that the NativeView has been destroyed externally, which
-   // can happen at any time. This happens fairly commonly on Windows (e.g., at

+ 2 - 2
patches/chromium/blink-worker-enable-csp-in-file-scheme.patch

@@ -6,10 +6,10 @@ Subject: blink-worker-enable-csp-in-file-scheme.patch
 This allows file:// URLs in workers to have a CSP.
 
 diff --git a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
-index d490f57f7ad056a278bc50786e285d6757de6433..6bd0614c388dc581b50c6b01e9c6dabad5419b19 100644
+index e15412a87803f38bceca93cf460386c9fd8e8903..ac09d3997e1018d227178c29f2fd714d9bb4000a 100644
 --- a/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
 +++ b/third_party/blink/renderer/core/workers/worker_classic_script_loader.cc
-@@ -312,7 +312,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
+@@ -323,7 +323,6 @@ void WorkerClassicScriptLoader::ProcessContentSecurityPolicy(
    // document (which is implemented in WorkerMessagingProxy, and
    // m_contentSecurityPolicy should be left as nullptr to inherit the policy).
    if (!response.CurrentRequestUrl().ProtocolIs("blob") &&

+ 3 - 3
patches/chromium/blink_local_frame.patch

@@ -14,10 +14,10 @@ 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 adf78283c04036c92dede354be0a1835ba620ca4..a02ffcaef8e29a934d4e3a8f795ca9dd38537b55 100644
+index ab0d55c3de88faf10e25ef8cbb6ebd3f7f580654..4660af81c248fe39c1df428a3b892a251a957363 100644
 --- a/third_party/blink/renderer/core/frame/local_frame.cc
 +++ b/third_party/blink/renderer/core/frame/local_frame.cc
-@@ -473,10 +473,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -472,10 +472,6 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
    }
    CHECK(!view_ || !view_->IsAttached());
  
@@ -28,7 +28,7 @@ index adf78283c04036c92dede354be0a1835ba620ca4..a02ffcaef8e29a934d4e3a8f795ca9dd
    if (!Client())
      return;
  
-@@ -494,6 +490,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
+@@ -493,6 +489,10 @@ void LocalFrame::DetachImpl(FrameDetachType type) {
    // Notify ScriptController that the frame is closing, since its cleanup ends
    // up calling back to LocalFrameClient via WindowProxy.
    GetScriptController().ClearForClose();

+ 3 - 3
patches/chromium/can_create_window.patch

@@ -9,7 +9,7 @@ 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 6b54a537e4d9282a3af95364e9925cbdd6ce5812..979a9ca641971ca706f9ea00580fdceaaf64b3d2 100644
+index 657306b0c95c9a499ca626c033c4b5b73de71d59..d1503246dfa0edf16a918d0c5b141bf89ae95bb1 100644
 --- a/content/browser/frame_host/render_frame_host_impl.cc
 +++ b/content/browser/frame_host/render_frame_host_impl.cc
 @@ -4324,6 +4324,7 @@ void RenderFrameHostImpl::CreateNewWindow(
@@ -91,10 +91,10 @@ index f0cb4833442be24dee52e2e172a0d22474d1135b..5e83b930fa0f32c368ce1d5980436d4c
    // 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 33d795d25197745f870e967f34348fc4c4db953f..90afa523c8d093018a5d8a45acd88dd656405648 100644
+index b8dd24b1b654e80505de8ea8c52a92c219b259fe..15c6d7c07fdc38a578af0463158be3ee81a98c95 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
-@@ -367,6 +367,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
+@@ -366,6 +366,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
      const std::string& frame_name,
      WindowOpenDisposition disposition,
      const blink::mojom::WindowFeatures& features,

+ 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 93001a62c6daea08854466429a5f17aff236a09b..83e2eabb262418627ee2a040989cfdd79939e50c 100644
+index 023024e81c99d09efc0d1530a6c9ae3f1acf3abe..9cff221f4927bec68eb93353cfcc4c9af153ac8e 100644
 --- a/chrome/browser/BUILD.gn
 +++ b/chrome/browser/BUILD.gn
-@@ -5329,6 +5329,7 @@ jumbo_static_library("browser") {
+@@ -5331,6 +5331,7 @@ jumbo_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 8591e0018c58baaca66f14cab82faea523183afc..3570d543170eeb63167d786312294b04e49f7e93 100644
+index e9609ef58a821c494232d02fc30f62150fea4c28..1c960c2b98b8ab3e8876aa974a72eedd3b46b2fc 100644
 --- a/content/browser/browser_main_loop.cc
 +++ b/content/browser/browser_main_loop.cc
-@@ -1487,7 +1487,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
+@@ -1492,7 +1492,7 @@ void BrowserMainLoop::MainMessageLoopRun() {
    NOTREACHED();
  #else
    base::RunLoop run_loop;

+ 2 - 2
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 d769b656dbe9e88a3e2533f82cb8daebe871d88b..0955e03a1ff9347b1d7d692e16ff62f350453f7d 100644
+index bb72915a26e298bdb81009248fb3fb4df7bddab5..00d991ad0183ec0c82d23633c86a3c0d7a6e6754 100644
 --- a/content/app/content_main_runner_impl.cc
 +++ b/content/app/content_main_runner_impl.cc
-@@ -670,7 +670,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
+@@ -671,7 +671,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) {
    }
  #endif
  

+ 2 - 2
patches/chromium/disable_hidden.patch

@@ -6,7 +6,7 @@ Subject: disable_hidden.patch
 Electron uses this to disable background throttling for hidden windows.
 
 diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc
-index 5ad66a6af94f07d7a989e738ea587ce467a542d6..8c54e34e716a647a72ffce78b56f94a03a5dd978 100644
+index fc06067480b091cd9051e4068180c999b0d1753b..2bb18f88be18093cd5b4d97ae2f8a43edf86b3ed 100644
 --- a/content/browser/renderer_host/render_widget_host_impl.cc
 +++ b/content/browser/renderer_host/render_widget_host_impl.cc
 @@ -660,6 +660,9 @@ void RenderWidgetHostImpl::WasHidden() {
@@ -34,7 +34,7 @@ index 013b2165038f1f21df394a0742f7927f26ab1671..894ddaa62fe8aa24eccbe7f9885a4dbb
        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 3e2190700aee4ea6184ea59d8bb4a480cd52697b..0ccdaa8d037cb71ee3eebae027a74e96ffe1e846 100644
+index f7f9dafb97983d05b3d13af3c178aa2f392b09ef..b43d1e528acaa4f0ead02c13d13a072216e2638c 100644
 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc
 +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc
 @@ -692,7 +692,7 @@ void RenderWidgetHostViewAura::HideImpl() {

+ 2 - 2
patches/chromium/disable_user_gesture_requirement_for_beforeunload_dialogs.patch

@@ -6,10 +6,10 @@ Subject: disable_user_gesture_requirement_for_beforeunload_dialogs.patch
 See https://github.com/electron/electron/issues/10754
 
 diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc
-index 474d302e08510884846e71c0dea41c30f8caa09e..59396d8a77b86ac0cb224fb91dec91fa79ade53d 100644
+index ef44c779973737d2abc024553b317f0dc2ccccdc..ae9608974be11e28d8d2737302f0d377cd8f674c 100644
 --- a/third_party/blink/renderer/core/dom/document.cc
 +++ b/third_party/blink/renderer/core/dom/document.cc
-@@ -4153,7 +4153,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
+@@ -4151,7 +4151,9 @@ bool Document::DispatchBeforeUnloadEvent(ChromeClient* chrome_client,
          "frame that never had a user gesture since its load. "
          "https://www.chromestatus.com/feature/5082396709879808";
      Intervention::GenerateReport(frame_, "BeforeUnloadNoGesture", message);

+ 2 - 2
patches/chromium/feat_allow_disabling_blink_scheduler_throttling_per_renderview.patch

@@ -6,10 +6,10 @@ 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 f27504c70d635a3b45cd53ca675a473d39e74b44..297eb00c16fc683e420d74b720a4b005015aa9cc 100644
+index 01a4e3dc134b3cf267ec637dde1066db51ac78e7..9178621b483b3790fe41f75f40463001cde4f133 100644
 --- a/content/browser/renderer_host/render_view_host_impl.cc
 +++ b/content/browser/renderer_host/render_view_host_impl.cc
-@@ -453,6 +453,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
+@@ -458,6 +458,10 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) {
    GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque);
  }
  

+ 3 - 3
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 84a16ad496b5e443555ac41bb969b855f5aed091..e2a478ef9b51117316a0c1fca45c5e193053b4c0 100644
+index eb1a0ae5ca25f56a261ef1e747ecdfc7fb3dccff..0c335fcf26aef770cc30c4147e1c112eec8098bb 100644
 --- a/components/viz/service/BUILD.gn
 +++ b/components/viz/service/BUILD.gn
 @@ -111,6 +111,8 @@ viz_component("service") {
@@ -442,10 +442,10 @@ index 0000000000000000000000000000000000000000..48fa86caaab3c15764f105eb7ad2aecf
 +
 +#endif  // COMPONENTS_VIZ_SERVICE_DISPLAY_EMBEDDER_SOFTWARE_OUTPUT_DEVICE_PROXY_H_
 diff --git a/components/viz/service/display_embedder/software_output_device_win.cc b/components/viz/service/display_embedder/software_output_device_win.cc
-index 94ea55487f85ab32d862e913c476bc95f388dce9..d055a18bbc186facd88d496d589be78068c4ca64 100644
+index 2bb30e5318b6b48c2e6d4b1f64a6a36c68f963d1..9e805f27a9d7d1c0aa68cdf9f48895c055ca7791 100644
 --- a/components/viz/service/display_embedder/software_output_device_win.cc
 +++ b/components/viz/service/display_embedder/software_output_device_win.cc
-@@ -268,7 +268,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
+@@ -188,7 +188,7 @@ void SoftwareOutputDeviceWinProxy::EndPaintDelegated(
    if (!canvas_)
      return;
  

+ 2 - 2
patches/chromium/fix_route_mouse_event_navigations_through_the_web_contents_delegate.patch

@@ -13,10 +13,10 @@ 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 552f4cf6e09855e9bc1ceecbdeb959dd85a1ce05..be2540b359525d3adbd8f4a37834566a71f150cb 100644
+index 0fe5a498d6981962dba2f7de1603b3f0fd0c1ffa..484e2325a618ea2e665544a625dfbb60ef6124da 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -2350,11 +2350,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
+@@ -2347,11 +2347,13 @@ bool WebContentsImpl::HandleMouseEvent(const blink::WebMouseEvent& event) {
      WebContentsImpl* outermost = GetOutermostWebContents();
      if (event.button == blink::WebPointerProperties::Button::kBack &&
          outermost->controller_.CanGoBack()) {

+ 4 - 4
patches/chromium/frame_host_manager.patch

@@ -42,10 +42,10 @@ index 906a1ee4ac58b0744a32153bbaafeac4322a60e4..c90f4aead36cbf3767dc5094728963c2
    // 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 a0225751ed6f881e8f7b4e7233282ff2e8aeaac7..22f49e6f6c779adc929ee173591d7f5355bfe457 100644
+index f0b9f9634264e9073f22560903307332986df2fe..934fa63595053156b446dbc5fdccb196f1a0ba15 100644
 --- a/content/browser/frame_host/navigation_request.cc
 +++ b/content/browser/frame_host/navigation_request.cc
-@@ -1259,6 +1259,24 @@ void NavigationRequest::BeginNavigation() {
+@@ -1264,6 +1264,24 @@ void NavigationRequest::BeginNavigation() {
      // it immediately.
      EnterChildTraceEvent("ResponseStarted", this);
  
@@ -71,7 +71,7 @@ index a0225751ed6f881e8f7b4e7233282ff2e8aeaac7..22f49e6f6c779adc929ee173591d7f53
      render_frame_host_ =
          frame_tree_node_->render_manager()->GetFrameHostForNavigation(this);
 diff --git a/content/browser/frame_host/render_frame_host_manager.cc b/content/browser/frame_host/render_frame_host_manager.cc
-index 50533c338dd75f606ba542813cfe724301ad6527..d18482d9a934ea5fd10035328be540ba89af7441 100644
+index f76a633c85c8e53d99c1280d359b6ddcf6bcfbbc..676f70c59f75d47c94902eba3776949b749f267f 100644
 --- a/content/browser/frame_host/render_frame_host_manager.cc
 +++ b/content/browser/frame_host/render_frame_host_manager.cc
 @@ -2392,6 +2392,16 @@ bool RenderFrameHostManager::InitRenderView(
@@ -156,7 +156,7 @@ index 50533c338dd75f606ba542813cfe724301ad6527..d18482d9a934ea5fd10035328be540ba
  
    // Account for renderer-initiated reload as well.
    // Needed as a workaround for https://crbug.com/1045524, remove it when it is
-@@ -2455,6 +2515,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
+@@ -2456,6 +2516,8 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest(
        request->dest_site_instance() != dest_site_instance) {
      request->ResetStateForSiteInstanceChange();
    }

+ 4 - 4
patches/chromium/gpu_notify_when_dxdiag_request_fails.patch

@@ -12,10 +12,10 @@ rendering and there is no signal from browser process on this event
 to identify it.
 
 diff --git a/content/browser/gpu/gpu_data_manager_impl.cc b/content/browser/gpu/gpu_data_manager_impl.cc
-index ba01477a3deea383f538adfe519bc53154df3321..441010b3e5cbe70f49e8aece3120dc24bd41e43c 100644
+index db9780a6c0b679354a5f74b1f89e32a8ff9dd2e3..cc51d41f88a60ccb936b0608973b76ba84c2a47b 100644
 --- a/content/browser/gpu/gpu_data_manager_impl.cc
 +++ b/content/browser/gpu/gpu_data_manager_impl.cc
-@@ -147,6 +147,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
+@@ -161,6 +161,11 @@ bool GpuDataManagerImpl::Dx12VulkanRequested() const {
    return private_->Dx12VulkanRequested();
  }
  
@@ -28,10 +28,10 @@ index ba01477a3deea383f538adfe519bc53154df3321..441010b3e5cbe70f49e8aece3120dc24
    base::AutoLock auto_lock(lock_);
    private_->OnBrowserThreadsStarted();
 diff --git a/content/browser/gpu/gpu_data_manager_impl.h b/content/browser/gpu/gpu_data_manager_impl.h
-index c5515870a1dcf017b3477d890510a672e82e00e3..436a16a581f5d39bd64e0101d2c0e59d5f8a4dc6 100644
+index d5595c91f4d63362e575ad31070335ee344261fa..19c012313550cf9d9bf591a54e739fc34239e4dd 100644
 --- a/content/browser/gpu/gpu_data_manager_impl.h
 +++ b/content/browser/gpu/gpu_data_manager_impl.h
-@@ -87,6 +87,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
+@@ -90,6 +90,7 @@ class CONTENT_EXPORT GpuDataManagerImpl : public GpuDataManager,
    void UpdateDxDiagNodeRequestStatus(bool request_continues);
    void UpdateDx12VulkanRequestStatus(bool request_continues);
    bool Dx12VulkanRequested() const;

+ 4 - 4
patches/chromium/gtk_visibility.patch

@@ -6,12 +6,12 @@ Subject: gtk_visibility.patch
 Allow electron to depend on GTK in the GN build.
 
 diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn
-index 8bfa5592441136ae13b97187682fdd10864a54e1..6e3a02ad3f3d8881a9f0a9b7f8ed13383eafde1f 100644
+index 9249f88e3234d0c11fe870169fc3fe8ce3c00ff1..7c4261f06c74f13d29b4cb2d2e3c047bf319b7f0 100644
 --- a/build/config/linux/gtk/BUILD.gn
 +++ b/build/config/linux/gtk/BUILD.gn
-@@ -25,6 +25,8 @@ group("gtk") {
-     # This is the only target that should depend on GTK.
-     "//ui/gtk:*",
+@@ -28,6 +28,8 @@ group("gtk") {
+     # This should probably be moved into //ui/gtk.
+     "//ui/ozone/platform/wayland",
  
 +    "//electron:*",
 +

+ 7 - 7
patches/chromium/put_back_deleted_colors_for_autofill.patch

@@ -7,10 +7,10 @@ https://chromium-review.googlesource.com/c/chromium/src/+/1652925 removed colors
 needed in chromium but our autofill implementation uses them.  This patch can be removed if we refactor
 our autofill implementation to work like Chromium's.
 
-diff --git a/chrome/browser/ui/gtk/native_theme_gtk.cc b/chrome/browser/ui/gtk/native_theme_gtk.cc
-index 990e2f0539dea8a4f2b47df1cc93715901fc5a7d..84a67a0efb3deed4a273be0f939abef71543e4fa 100644
---- a/chrome/browser/ui/gtk/native_theme_gtk.cc
-+++ b/chrome/browser/ui/gtk/native_theme_gtk.cc
+diff --git a/ui/gtk/native_theme_gtk.cc b/ui/gtk/native_theme_gtk.cc
+index 352bc3d9fb59ea46829ff02f779b3372efadf8db..70a49a4b473bc03e92625c57383dc9fddd85de42 100644
+--- a/ui/gtk/native_theme_gtk.cc
++++ b/ui/gtk/native_theme_gtk.cc
 @@ -351,6 +351,27 @@ base::Optional<SkColor> SkColorFromColorId(
      case ui::NativeTheme::kColorId_TableHeaderSeparator:
        return GetBorderColor("GtkTreeView#treeview.view GtkButton#button");
@@ -40,7 +40,7 @@ index 990e2f0539dea8a4f2b47df1cc93715901fc5a7d..84a67a0efb3deed4a273be0f939abef7
      // TODO(thomasanderson): Render GtkSpinner directly.
      case ui::NativeTheme::kColorId_ThrobberSpinningColor:
 diff --git a/ui/native_theme/common_theme.cc b/ui/native_theme/common_theme.cc
-index cbef81b92f2589937c67370335713e5e9de44532..e850e603101e54e33b96fcd2c67a9e33a6819302 100644
+index aac3821e6d977a8f80e4ded5b5944b43a7f200b1..83b3f97113244108c8648f21b646ef7262f282b5 100644
 --- a/ui/native_theme/common_theme.cc
 +++ b/ui/native_theme/common_theme.cc
 @@ -43,7 +43,8 @@ base::Optional<SkColor> GetHighContrastColor(
@@ -68,7 +68,7 @@ index cbef81b92f2589937c67370335713e5e9de44532..e850e603101e54e33b96fcd2c67a9e33
      // FocusableBorder
      case NativeTheme::kColorId_FocusedBorderColor:
        return SkColorSetA(gfx::kGoogleBlue300, 0x4D);
-@@ -484,6 +493,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
+@@ -487,6 +496,18 @@ SkColor GetDefaultColor(NativeTheme::ColorId color_id,
      case NativeTheme::kColorId_UnfocusedBorderColor:
        return gfx::kGoogleGrey300;
  
@@ -87,7 +87,7 @@ index cbef81b92f2589937c67370335713e5e9de44532..e850e603101e54e33b96fcd2c67a9e33
      // Material spinner/throbber
      case NativeTheme::kColorId_ThrobberSpinningColor:
        return gfx::kGoogleBlue600;
-@@ -543,7 +564,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
+@@ -549,7 +570,7 @@ SkColor GetAuraColor(NativeTheme::ColorId color_id,
    }
  
    if (color_scheme == NativeTheme::ColorScheme::kDark) {

+ 1 - 1
patches/chromium/resource_file_conflict.patch

@@ -52,7 +52,7 @@ Some alternatives to this patch:
 None of these options seems like a substantial maintainability win over this patch to me (@nornagon).
 
 diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
-index 23eb5fcfd9889aadd615d6a347258ff9db604bab..22844351c09b50ba958dfbbe416f4a645aaa035f 100644
+index d113eedf7afc704b0c2e8d112413e3bd7c58d8c7..fcd838d69b23e6799702353a551a0a7ac5c4ae15 100644
 --- a/chrome/BUILD.gn
 +++ b/chrome/BUILD.gn
 @@ -1470,7 +1470,7 @@ if (is_chrome_branded && !is_android) {

+ 0 - 52
patches/chromium/revert_enable_samesitebydefaultcookies_and.patch

@@ -1,52 +0,0 @@
-From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
-From: Lily Chen <[email protected]>
-Date: Fri, 3 Apr 2020 00:25:12 +0000
-Subject: Revert "Enable SameSiteByDefaultCookies and
- CookiesWithoutSameSiteMustBeSecure"
-
-This reverts commit 2507555fe83d314ef6300317cd6f90ff165150bd.
-
-Reason for revert: Expected full rollout delayed
-
-Original change's description:
-> Enable SameSiteByDefaultCookies and CookiesWithoutSameSiteMustBeSecure
->
-> [email protected]
->
-> Bug: 953306
-> Change-Id: I5bde61d8ff66261ade4e68caadafda73c522df00
-> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2122809
-> Reviewed-by: Lily Chen <[email protected]>
-> Commit-Queue: Lily Chen <[email protected]>
-> Cr-Commit-Position: refs/heads/master@{#753807}
-
[email protected],[email protected]
-
-# Not skipping CQ checks because original CL landed > 1 day ago.
-
-Bug: 953306
-Change-Id: Ic7da4e9938184e2833895ff263325c01948be6f0
-Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2135046
-Reviewed-by: Lily Chen <[email protected]>
-Commit-Queue: Lily Chen <[email protected]>
-Cr-Commit-Position: refs/heads/master@{#756087}
-
-diff --git a/net/base/features.cc b/net/base/features.cc
-index 0a0c2da968ca115eb6422ee244a7a97bb4627375..46b4562c621633c19bb7033a3c95618b8578e227 100644
---- a/net/base/features.cc
-+++ b/net/base/features.cc
-@@ -57,11 +57,11 @@ const base::FeatureParam<int> kEsniDnsMaxAbsoluteAdditionalWaitMilliseconds{
- const base::FeatureParam<int> kEsniDnsMaxRelativeAdditionalWaitPercent{
-     &kRequestEsniDnsRecords, "EsniDnsMaxRelativeAdditionalWaitPercent", 5};
- 
--const base::Feature kSameSiteByDefaultCookies{"SameSiteByDefaultCookies",
--                                              base::FEATURE_ENABLED_BY_DEFAULT};
-+const base::Feature kSameSiteByDefaultCookies{
-+    "SameSiteByDefaultCookies", base::FEATURE_DISABLED_BY_DEFAULT};
- 
- const base::Feature kCookiesWithoutSameSiteMustBeSecure{
--    "CookiesWithoutSameSiteMustBeSecure", base::FEATURE_ENABLED_BY_DEFAULT};
-+    "CookiesWithoutSameSiteMustBeSecure", base::FEATURE_DISABLED_BY_DEFAULT};
- 
- const base::Feature kShortLaxAllowUnsafeThreshold{
-     "ShortLaxAllowUnsafeThreshold", base::FEATURE_DISABLED_BY_DEFAULT};

+ 8 - 8
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 42383cda5a9ccb39e64ee65d0202bee60639623f..c9099e58ba6f552a83a7994529c7999e4e22cd07 100644
+index b96048aec4f7d58438a5b08d688756d8c639a6fc..df3bbd1a2a5bfe8804b97447e7671b7dd8b8fd36 100644
 --- a/chrome/renderer/chrome_content_renderer_client.cc
 +++ b/chrome/renderer/chrome_content_renderer_client.cc
-@@ -1272,6 +1272,25 @@ bool ChromeContentRendererClient::AllowPopup() {
+@@ -1275,6 +1275,25 @@ bool ChromeContentRendererClient::AllowPopup() {
  #endif
  }
  
@@ -39,7 +39,7 @@ index 42383cda5a9ccb39e64ee65d0202bee60639623f..c9099e58ba6f552a83a7994529c7999e
      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 8969adb44800e925c9066e51793463c09eb78622..d11a4fdf04f7632fb1191c28c83f1d66ce0e5bf2 100644
+index c210526bfedc468dd6ba314e337aaae46154de01..e4532372a0e54e42bd708bfad275d5c543080cd2 100644
 --- a/chrome/renderer/chrome_content_renderer_client.h
 +++ b/chrome/renderer/chrome_content_renderer_client.h
 @@ -126,6 +126,11 @@ class ChromeContentRendererClient
@@ -55,7 +55,7 @@ index 8969adb44800e925c9066e51793463c09eb78622..d11a4fdf04f7632fb1191c28c83f1d66
                         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 c4c0e27127ff2976db4e78cf5a02bd22d1c667d3..a4318511d1081d4f101cb2f18ca5fa200fb9773c 100644
+index 84db33f5fb464c3df36e5ea230ea76f06ae9a919..d538b0d1b7d58c4f466334d787cd524420186e9e 100644
 --- a/content/public/renderer/content_renderer_client.cc
 +++ b/content/public/renderer/content_renderer_client.cc
 @@ -104,6 +104,14 @@ bool ContentRendererClient::HandleNavigation(
@@ -74,10 +74,10 @@ index c4c0e27127ff2976db4e78cf5a02bd22d1c667d3..a4318511d1081d4f101cb2f18ca5fa20
      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 ee2079537feb23869fe4f812bcef33e1d7de29a7..93287ae0928b52f9df34834ad1a8ef0e54367882 100644
+index f409df27977c6d43e6738c4557cb6201507b7fce..a94b2b289eb1b5da820dd3bf620911f2edef7c68 100644
 --- a/content/public/renderer/content_renderer_client.h
 +++ b/content/public/renderer/content_renderer_client.h
-@@ -213,6 +213,13 @@ class CONTENT_EXPORT ContentRendererClient {
+@@ -214,6 +214,13 @@ class CONTENT_EXPORT ContentRendererClient {
                                  bool is_redirect);
  #endif
  
@@ -92,10 +92,10 @@ index ee2079537feb23869fe4f812bcef33e1d7de29a7..93287ae0928b52f9df34834ad1a8ef0e
    // |url|. If the function returns a valid |new_url|, the request must be
    // updated to use it. The |attach_same_site_cookies| output parameter
 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
-index 7a6562904eebbf55fcc4b08c9676a80350ce0863..bc18d55a6556adc1e8376f42d21fc64593ac1a59 100644
+index 902c33cac74cf66f97e7a900a736f59f0f3308fc..52243ef165ca5cb5adf9d9453bdb5e67f97365f1 100644
 --- a/content/renderer/render_frame_impl.cc
 +++ b/content/renderer/render_frame_impl.cc
-@@ -5694,6 +5694,23 @@ void RenderFrameImpl::BeginNavigation(
+@@ -5716,6 +5716,23 @@ void RenderFrameImpl::BeginNavigation(
      int cumulative_bindings = RenderProcess::current()->GetEnabledBindings();
      bool should_fork = HasWebUIScheme(url) || HasWebUIScheme(old_url) ||
                         (cumulative_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 7cbdbcef0ce0f18aba40f6bdf71ac8064b4b6d71..460e85470f6dad7c38d2c50d3b4b668a01f17456 100644
+index 76176518dfe4a04f1e96add7af49a50e6576d19d..627ed897ea9a7dc964a08c7eae6d73584d2391e1 100644
 --- a/content/renderer/render_thread_impl.cc
 +++ b/content/renderer/render_thread_impl.cc
-@@ -1344,7 +1344,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
+@@ -1346,7 +1346,7 @@ bool RenderThreadImpl::IsGpuMemoryBufferCompositorResourcesEnabled() {
  }
  
  bool RenderThreadImpl::IsElasticOverscrollEnabled() {

+ 29 - 0
patches/chromium/ui_gtk_public_header.patch

@@ -0,0 +1,29 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: deepak1556 <[email protected]>
+Date: Fri, 10 Apr 2020 17:47:18 -0700
+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 2dd67393ec469b9c75761d98e729818453b6ce6b..53fc63acd371eb2efd77e9f50d60ce52b0436b59 100644
+--- a/ui/gtk/BUILD.gn
++++ b/ui/gtk/BUILD.gn
+@@ -22,13 +22,15 @@ component("gtk_ui_delegate") {
+ }
+ 
+ jumbo_component("gtk") {
+-  public = [ "gtk_ui.h" ]
++  public = [ 
++    "gtk_ui.h",
++    "gtk_util.h",
++  ]
+   sources = [
+     "gtk_key_bindings_handler.cc",
+     "gtk_key_bindings_handler.h",
+     "gtk_ui.cc",
+     "gtk_util.cc",
+-    "gtk_util.h",
+     "input_method_context_impl_gtk.cc",
+     "input_method_context_impl_gtk.h",
+     "native_theme_gtk.cc",

+ 6 - 6
patches/chromium/web_contents.patch

@@ -9,10 +9,10 @@ is needed for OSR.
 Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
 
 diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
-index 1e0d0a28cfe2c25b186fac6eb2d02e96730c3934..552f4cf6e09855e9bc1ceecbdeb959dd85a1ce05 100644
+index 484e2325a618ea2e665544a625dfbb60ef6124da..5b4f85cfadac54fa81a357ebece6f9b274066a29 100644
 --- a/content/browser/web_contents/web_contents_impl.cc
 +++ b/content/browser/web_contents/web_contents_impl.cc
-@@ -2065,6 +2065,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
+@@ -2069,6 +2069,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
    std::string unique_name;
    frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
  
@@ -25,7 +25,7 @@ index 1e0d0a28cfe2c25b186fac6eb2d02e96730c3934..552f4cf6e09855e9bc1ceecbdeb959dd
    WebContentsViewDelegate* delegate =
        GetContentClient()->browser()->GetWebContentsViewDelegate(this);
  
-@@ -2075,6 +2081,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
+@@ -2079,6 +2085,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
      view_.reset(CreateWebContentsView(this, delegate,
                                        &render_view_host_delegate_view_));
    }
@@ -34,10 +34,10 @@ index 1e0d0a28cfe2c25b186fac6eb2d02e96730c3934..552f4cf6e09855e9bc1ceecbdeb959dd
    CHECK(view_.get());
  
 diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
-index cf98180740c4adaf0082e987e4b7fc482b11d348..376aaaebcb45b078c59f013437ac9baf7c9dd037 100644
+index b471bd1f78c610e56219962084ae66d5e2450738..ab498adcf576641c79f16fd1bf5376b7acaf9636 100644
 --- a/content/public/browser/web_contents.h
 +++ b/content/public/browser/web_contents.h
-@@ -82,9 +82,12 @@ class BrowserPluginGuestDelegate;
+@@ -84,9 +84,12 @@ class BrowserPluginGuestDelegate;
  class InterstitialPage;
  class RenderFrameHost;
  class RenderViewHost;
@@ -50,7 +50,7 @@ index cf98180740c4adaf0082e987e4b7fc482b11d348..376aaaebcb45b078c59f013437ac9baf
  class WebUI;
  struct CustomContextMenuContext;
  struct DropData;
-@@ -209,6 +212,10 @@ class WebContents : public PageNavigator,
+@@ -211,6 +214,10 @@ class WebContents : public PageNavigator,
        kInitializeAndWarmupRendererProcess,
      } desired_renderer_state;
  

+ 4 - 4
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 56062bb2680a71103d3c600697dfae03e265ef15..ee2079537feb23869fe4f812bcef33e1d7de29a7 100644
+index 764556d80f1bb26797c439488906eb96fda28b81..f409df27977c6d43e6738c4557cb6201507b7fce 100644
 --- a/content/public/renderer/content_renderer_client.h
 +++ b/content/public/renderer/content_renderer_client.h
-@@ -373,6 +373,11 @@ class CONTENT_EXPORT ContentRendererClient {
+@@ -378,6 +378,11 @@ class CONTENT_EXPORT ContentRendererClient {
    virtual void DidInitializeWorkerContextOnWorkerThread(
        v8::Local<v8::Context> context) {}
  
@@ -67,10 +67,10 @@ index c7bc68000ad0a9b49e9638e5413e0c3e4db508b0..3edcb4715c2dd8b2cf33f093710f1481
        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 c43f8b1e8f4a20ee0bf267ef78f2b067837be223..b34800d0a569b31f9ecc9c62d0e93e676eddf32d 100644
+index d11b948c6de2cbb38cf09728168218fee5c63713..d736f31425d024f28fb8be63b03ab0eeb56d354c 100644
 --- a/third_party/blink/renderer/core/workers/worker_thread.cc
 +++ b/third_party/blink/renderer/core/workers/worker_thread.cc
-@@ -688,6 +688,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
+@@ -691,6 +691,12 @@ void WorkerThread::PrepareForShutdownOnWorkerThread() {
      nested_runner_->QuitNow();
    }
  

+ 3 - 3
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 d64dec51c27048637ae1ecdd37c90dc4f083013d..3ace8c5530897cbea738b76327caa340c6b942ff 100644
+index b2dde3f9d703126395bdf91fdc0b5b9ea752f60f..af6d290c129ece4a8fd0a5b4fdef49bdf8ef5337 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
 @@ -311,7 +311,7 @@ config("internal_config") {
@@ -21,7 +21,7 @@ index d64dec51c27048637ae1ecdd37c90dc4f083013d..3ace8c5530897cbea738b76327caa340
      defines += [ "BUILDING_V8_SHARED" ]
    }
  }
-@@ -4037,7 +4037,7 @@ if (current_toolchain == v8_generator_toolchain) {
+@@ -4034,7 +4034,7 @@ if (current_toolchain == v8_generator_toolchain) {
        "src/interpreter/bytecodes.h",
      ]
  
@@ -30,7 +30,7 @@ index d64dec51c27048637ae1ecdd37c90dc4f083013d..3ace8c5530897cbea738b76327caa340
  
      deps = [
        ":v8_libbase",
-@@ -4070,6 +4070,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
+@@ -4067,6 +4067,8 @@ if (current_toolchain == v8_snapshot_toolchain) {
  
      configs = [ ":internal_config" ]
  

+ 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 91f4ef5346961beb992e1ae95ef8c48167107b46..1b04d32d6e404b29f5604eb548a6b3154fa81797 100644
+index ab2c30e340482a1218e22f59d130911f1230a630..dfe2f0af85412a6c344012f2782f5216a8b17df9 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
 @@ -311,6 +311,10 @@ config("internal_config") {

+ 2 - 2
patches/v8/expose_mksnapshot.patch

@@ -6,10 +6,10 @@ Subject: expose_mksnapshot.patch
 Needed in order to target mksnapshot for mksnapshot zip.
 
 diff --git a/BUILD.gn b/BUILD.gn
-index 3ace8c5530897cbea738b76327caa340c6b942ff..91f4ef5346961beb992e1ae95ef8c48167107b46 100644
+index af6d290c129ece4a8fd0a5b4fdef49bdf8ef5337..ab2c30e340482a1218e22f59d130911f1230a630 100644
 --- a/BUILD.gn
 +++ b/BUILD.gn
-@@ -4048,7 +4048,6 @@ if (current_toolchain == v8_generator_toolchain) {
+@@ -4045,7 +4045,6 @@ if (current_toolchain == v8_generator_toolchain) {
  
  if (current_toolchain == v8_snapshot_toolchain) {
    v8_executable("mksnapshot") {

+ 26 - 4
shell/browser/api/electron_api_app.cc

@@ -539,7 +539,6 @@ App::App(v8::Isolate* isolate) {
   static_cast<ElectronBrowserClient*>(ElectronBrowserClient::Get())
       ->set_delegate(this);
   Browser::Get()->AddObserver(this);
-  content::GpuDataManager::GetInstance()->AddObserver(this);
 
   base::ProcessId pid = base::GetCurrentProcId();
   auto process_metric = std::make_unique<electron::ProcessMetric>(
@@ -617,6 +616,21 @@ void App::OnPreMainMessageLoopRun() {
   }
 }
 
+void App::OnPreCreateThreads() {
+  DCHECK(!content::GpuDataManager::Initialized());
+  content::GpuDataManager* manager = content::GpuDataManager::GetInstance();
+  manager->AddObserver(this);
+
+  if (disable_hw_acceleration_) {
+    manager->DisableHardwareAcceleration();
+  }
+
+  if (disable_domain_blocking_for_3DAPIs_) {
+    content::GpuDataManagerImpl::GetInstance()
+        ->DisableDomainBlockingFor3DAPIsForTesting();
+  }
+}
+
 void App::OnAccessibilitySupportChanged() {
   Emit("accessibility-support-changed", IsAccessibilitySupportEnabled());
 }
@@ -1023,7 +1037,11 @@ void App::DisableHardwareAcceleration(gin_helper::ErrorThrower thrower) {
         "before app is ready");
     return;
   }
-  content::GpuDataManager::GetInstance()->DisableHardwareAcceleration();
+  if (content::GpuDataManager::Initialized()) {
+    content::GpuDataManager::GetInstance()->DisableHardwareAcceleration();
+  } else {
+    disable_hw_acceleration_ = true;
+  }
 }
 
 void App::DisableDomainBlockingFor3DAPIs(gin_helper::ErrorThrower thrower) {
@@ -1033,8 +1051,12 @@ void App::DisableDomainBlockingFor3DAPIs(gin_helper::ErrorThrower thrower) {
         "before app is ready");
     return;
   }
-  content::GpuDataManagerImpl::GetInstance()
-      ->DisableDomainBlockingFor3DAPIsForTesting();
+  if (content::GpuDataManager::Initialized()) {
+    content::GpuDataManagerImpl::GetInstance()
+        ->DisableDomainBlockingFor3DAPIsForTesting();
+  } else {
+    disable_domain_blocking_for_3DAPIs_ = true;
+  }
 }
 
 bool App::IsAccessibilitySupportEnabled() {

+ 4 - 1
shell/browser/api/electron_api_app.h

@@ -70,7 +70,6 @@ class App : public ElectronBrowserClient::Delegate,
   base::FilePath GetAppPath() const;
   void RenderProcessReady(content::RenderProcessHost* host);
   void RenderProcessDisconnected(base::ProcessId host_pid);
-  void PreMainMessageLoopRun();
 
  protected:
   explicit App(v8::Isolate* isolate);
@@ -88,6 +87,7 @@ class App : public ElectronBrowserClient::Delegate,
   void OnFinishLaunching(const base::DictionaryValue& launch_info) override;
   void OnAccessibilitySupportChanged() override;
   void OnPreMainMessageLoopRun() override;
+  void OnPreCreateThreads() override;
 #if defined(OS_MACOSX)
   void OnWillContinueUserActivity(bool* prevent_default,
                                   const std::string& type) override;
@@ -239,6 +239,9 @@ class App : public ElectronBrowserClient::Delegate,
                          std::unique_ptr<electron::ProcessMetric>>;
   ProcessMetricMap app_metrics_;
 
+  bool disable_hw_acceleration_ = false;
+  bool disable_domain_blocking_for_3DAPIs_ = false;
+
   DISALLOW_COPY_AND_ASSIGN(App);
 };
 

+ 9 - 5
shell/browser/api/electron_api_web_contents.cc

@@ -383,7 +383,8 @@ WebContents::WebContents(v8::Isolate* isolate,
     : content::WebContentsObserver(web_contents),
       type_(Type::REMOTE),
       weak_factory_(this) {
-  web_contents->SetUserAgentOverride(GetBrowserContext()->GetUserAgent(),
+  web_contents->SetUserAgentOverride(blink::UserAgentOverride::UserAgentOnly(
+                                         GetBrowserContext()->GetUserAgent()),
                                      false);
   Init(isolate);
   AttachAsUserData(web_contents);
@@ -561,7 +562,8 @@ void WebContents::InitWithSessionAndOptions(
       &WebContents::OnElectronBrowserConnectionError, base::Unretained(this)));
   AutofillDriverFactory::CreateForWebContents(web_contents());
 
-  web_contents()->SetUserAgentOverride(GetBrowserContext()->GetUserAgent(),
+  web_contents()->SetUserAgentOverride(blink::UserAgentOverride::UserAgentOnly(
+                                           GetBrowserContext()->GetUserAgent()),
                                        false);
 
   if (IsGuest()) {
@@ -1436,7 +1438,8 @@ void WebContents::LoadURL(const GURL& url,
 
   std::string user_agent;
   if (options.Get("userAgent", &user_agent))
-    web_contents()->SetUserAgentOverride(user_agent, false);
+    web_contents()->SetUserAgentOverride(
+        blink::UserAgentOverride::UserAgentOnly(user_agent), false);
 
   std::string extra_headers;
   if (options.Get("extraHeaders", &extra_headers))
@@ -1562,11 +1565,12 @@ bool WebContents::IsCrashed() const {
 
 void WebContents::SetUserAgent(const std::string& user_agent,
                                gin_helper::Arguments* args) {
-  web_contents()->SetUserAgentOverride(user_agent, false);
+  web_contents()->SetUserAgentOverride(
+      blink::UserAgentOverride::UserAgentOnly(user_agent), false);
 }
 
 std::string WebContents::GetUserAgent() {
-  return web_contents()->GetUserAgentOverride();
+  return web_contents()->GetUserAgentOverride().ua_string_override;
 }
 
 v8::Local<v8::Promise> WebContents::SavePage(

+ 2 - 0
shell/browser/api/frame_subscriber.cc

@@ -145,6 +145,8 @@ void FrameSubscriber::OnFrameCaptured(
 
 void FrameSubscriber::OnStopped() {}
 
+void FrameSubscriber::OnLog(const std::string& message) {}
+
 void FrameSubscriber::Done(const gfx::Rect& damage, const SkBitmap& frame) {
   if (frame.drawsNothing())
     return;

+ 2 - 0
shell/browser/api/frame_subscriber.h

@@ -6,6 +6,7 @@
 #define SHELL_BROWSER_API_FRAME_SUBSCRIBER_H_
 
 #include <memory>
+#include <string>
 
 #include "base/callback.h"
 #include "base/memory/weak_ptr.h"
@@ -53,6 +54,7 @@ class FrameSubscriber : public content::WebContentsObserver,
       mojo::PendingRemote<viz::mojom::FrameSinkVideoConsumerFrameCallbacks>
           callbacks) override;
   void OnStopped() override;
+  void OnLog(const std::string& message) override;
 
   void Done(const gfx::Rect& damage, const SkBitmap& frame);
 

+ 6 - 0
shell/browser/browser.cc

@@ -202,6 +202,12 @@ void Browser::PreMainMessageLoopRun() {
   }
 }
 
+void Browser::PreCreateThreads() {
+  for (BrowserObserver& observer : observers_) {
+    observer.OnPreCreateThreads();
+  }
+}
+
 void Browser::SetMainMessageLoopQuitClosure(base::OnceClosure quit_closure) {
   if (is_shutdown_)
     RunQuitClosure(std::move(quit_closure));

+ 1 - 0
shell/browser/browser.h

@@ -251,6 +251,7 @@ class Browser : public WindowListObserver {
   void OnAccessibilitySupportChanged();
 
   void PreMainMessageLoopRun();
+  void PreCreateThreads();
 
   // Stores the supplied |quit_closure|, to be run when the last Browser
   // instance is destroyed.

+ 1 - 1
shell/browser/browser_linux.cc

@@ -16,8 +16,8 @@
 #include "shell/common/application_info.h"
 
 #if defined(USE_X11)
-#include "chrome/browser/ui/gtk/gtk_util.h"
 #include "shell/browser/linux/unity_service.h"
+#include "ui/gtk/gtk_util.h"
 #endif
 
 namespace electron {

+ 5 - 0
shell/browser/browser_observer.h

@@ -55,6 +55,11 @@ class BrowserObserver : public base::CheckedObserver {
   // The app message loop is ready
   virtual void OnPreMainMessageLoopRun() {}
 
+  // Called just before app threads are created, this is where first access
+  // to in-process GpuDataManager should be made.
+  // Refer https://chromium-review.googlesource.com/c/chromium/src/+/2134864
+  virtual void OnPreCreateThreads() {}
+
 #if defined(OS_MACOSX)
   // The browser wants to report that an user activity will resume. (macOS only)
   virtual void OnWillContinueUserActivity(bool* prevent_default,

+ 5 - 2
shell/browser/electron_browser_main_parts.cc

@@ -64,14 +64,14 @@
 #include "base/environment.h"
 #include "base/nix/xdg_util.h"
 #include "base/threading/thread_task_runner_handle.h"
-#include "chrome/browser/ui/gtk/gtk_ui.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
 #include "ui/base/x/x11_util.h"
 #include "ui/base/x/x11_util_internal.h"
 #include "ui/events/devices/x11/touch_factory_x11.h"
 #include "ui/gfx/x/x11_types.h"
+#include "ui/gtk/gtk_ui.h"
 #include "ui/gtk/gtk_ui_delegate.h"
 #include "ui/gtk/gtk_ui_delegate_x11.h"
+#include "ui/gtk/gtk_util.h"
 #include "ui/views/linux_ui/linux_ui.h"
 #endif
 
@@ -383,6 +383,9 @@ int ElectronBrowserMainParts::PreCreateThreads() {
 
   fake_browser_process_->PreCreateThreads();
 
+  // Notify observers.
+  Browser::Get()->PreCreateThreads();
+
   return 0;
 }
 

+ 1 - 1
shell/browser/notifications/linux/libnotify_notification.cc

@@ -12,12 +12,12 @@
 #include "base/logging.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
 #include "shell/browser/notifications/notification_delegate.h"
 #include "shell/browser/ui/gtk_util.h"
 #include "shell/common/application_info.h"
 #include "shell/common/platform_util.h"
 #include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gtk/gtk_util.h"
 
 namespace electron {
 

+ 2 - 0
shell/browser/osr/osr_video_consumer.cc

@@ -126,6 +126,8 @@ void OffScreenVideoConsumer::OnFrameCaptured(
 
 void OffScreenVideoConsumer::OnStopped() {}
 
+void OffScreenVideoConsumer::OnLog(const std::string& message) {}
+
 bool OffScreenVideoConsumer::CheckContentRect(const gfx::Rect& content_rect) {
   gfx::Size view_size = view_->SizeInPixels();
   gfx::Size content_size = content_rect.size();

+ 2 - 0
shell/browser/osr/osr_video_consumer.h

@@ -6,6 +6,7 @@
 #define SHELL_BROWSER_OSR_OSR_VIDEO_CONSUMER_H_
 
 #include <memory>
+#include <string>
 
 #include "base/callback.h"
 #include "base/memory/weak_ptr.h"
@@ -38,6 +39,7 @@ class OffScreenVideoConsumer : public viz::mojom::FrameSinkVideoConsumer {
       mojo::PendingRemote<viz::mojom::FrameSinkVideoConsumerFrameCallbacks>
           callbacks) override;
   void OnStopped() override;
+  void OnLog(const std::string& message) override;
 
   bool CheckContentRect(const gfx::Rect& content_rect);
 

+ 5 - 18
shell/browser/ui/autofill_popup.cc

@@ -9,7 +9,7 @@
 #include <vector>
 
 #include "base/i18n/rtl.h"
-#include "chrome/browser/ui/autofill/popup_view_common.h"
+#include "chrome/browser/ui/views/autofill/autofill_popup_view_utils.h"
 #include "electron/buildflags/buildflags.h"
 #include "mojo/public/cpp/bindings/associated_remote.h"
 #include "shell/browser/native_window_views.h"
@@ -31,19 +31,6 @@
 
 namespace electron {
 
-class PopupViewCommon : public autofill::PopupViewCommon {
- public:
-  explicit PopupViewCommon(const gfx::Rect& window_bounds)
-      : window_bounds_(window_bounds) {}
-
-  gfx::Rect GetWindowBounds(gfx::NativeView container_view) override {
-    return window_bounds_;
-  }
-
- private:
-  gfx::Rect window_bounds_;
-};
-
 AutofillPopup::AutofillPopup() {
   bold_font_list_ = gfx::FontList().DeriveWithWeight(gfx::Font::Weight::BOLD);
   smaller_font_list_ =
@@ -127,10 +114,10 @@ void AutofillPopup::UpdatePopupBounds() {
   gfx::Rect bounds(origin, element_bounds_.size());
   gfx::Rect window_bounds = parent_->GetBoundsInScreen();
 
-  PopupViewCommon popup_view_common(window_bounds);
-  popup_bounds_ = popup_view_common.CalculatePopupBounds(
-      GetDesiredPopupWidth(), GetDesiredPopupHeight(), bounds,
-      gfx::NativeView(), base::i18n::IsRTL());
+  gfx::Size preferred_size =
+      gfx::Size(GetDesiredPopupWidth(), GetDesiredPopupHeight());
+  popup_bounds_ = CalculatePopupBounds(preferred_size, window_bounds, bounds,
+                                       base::i18n::IsRTL());
 }
 
 gfx::Rect AutofillPopup::popup_bounds_in_view() {

+ 2 - 2
shell/browser/ui/file_dialog_gtk.cc

@@ -10,12 +10,12 @@
 #include "base/callback.h"
 #include "base/files/file_util.h"
 #include "base/strings/string_util.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
 #include "shell/browser/native_window_views.h"
 #include "shell/browser/unresponsive_suppressor.h"
 #include "shell/common/gin_converters/file_path_converter.h"
 #include "ui/base/glib/glib_signal.h"
-#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
+#include "ui/events/platform/x11/x11_event_source.h"
+#include "ui/gtk/gtk_util.h"
 
 namespace file_dialog {
 

+ 2 - 2
shell/browser/ui/message_box_gtk.cc

@@ -8,14 +8,14 @@
 #include "base/callback.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
 #include "shell/browser/browser.h"
 #include "shell/browser/native_window_observer.h"
 #include "shell/browser/native_window_views.h"
 #include "shell/browser/unresponsive_suppressor.h"
 #include "ui/base/glib/glib_signal.h"
+#include "ui/events/platform/x11/x11_event_source.h"
 #include "ui/gfx/image/image_skia.h"
-#include "ui/views/widget/desktop_aura/x11_desktop_handler.h"
+#include "ui/gtk/gtk_util.h"
 
 #define ANSI_FOREGROUND_RED "\x1b[31m"
 #define ANSI_FOREGROUND_BLACK "\x1b[30m"

+ 1 - 1
shell/browser/ui/views/menu_bar.cc

@@ -18,7 +18,7 @@
 #include "ui/views/widget/widget.h"
 
 #if defined(USE_X11)
-#include "chrome/browser/ui/gtk/gtk_util.h"
+#include "ui/gtk/gtk_util.h"
 #endif
 
 #if defined(OS_WIN)

+ 1 - 1
shell/common/application_info_linux.cc

@@ -12,9 +12,9 @@
 
 #include "base/environment.h"
 #include "base/logging.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
 #include "electron/electron_version.h"
 #include "shell/common/platform_util.h"
+#include "ui/gtk/gtk_util.h"
 
 namespace {
 

+ 1 - 1
shell/common/platform_util_linux.cc

@@ -12,7 +12,7 @@
 #include "base/nix/xdg_util.h"
 #include "base/process/kill.h"
 #include "base/process/launch.h"
-#include "chrome/browser/ui/gtk/gtk_util.h"
+#include "ui/gtk/gtk_util.h"
 #include "url/gurl.h"
 
 #define ELECTRON_TRASH "ELECTRON_TRASH"

+ 1 - 1
spec-main/extensions-spec.ts

@@ -296,7 +296,7 @@ ifdescribe(process.electronBinding('features').isExtensionsEnabled())('chrome ex
       const customSession = session.fromPartition(`persist:${require('uuid').v4()}`);
       customSession.loadExtension(path.join(fixtures, 'extensions', 'devtools-extension'));
       const w = new BrowserWindow({ show: true, webPreferences: { session: customSession, nodeIntegration: true } });
-      await w.loadURL('data:text/html,hello');
+      await w.loadURL(url);
       w.webContents.openDevTools();
       showLastDevToolsPanel(w);
       await emittedOnce(ipcMain, 'winning');

+ 1 - 1
spec-main/fixtures/pages/webview-devtools.html

@@ -4,7 +4,7 @@
     <meta charset="utf-8">
   </head>
   <body>
-    <webview nodeintegration src="about:blank"></webview>
+    <webview nodeintegration></webview>
     <script>
         var wv = document.querySelector('webview')
         wv.addEventListener('dom-ready', () => {

+ 10 - 1
spec-main/webview-spec.ts

@@ -4,7 +4,7 @@ import { closeAllWindows } from './window-helpers';
 import { emittedOnce } from './events-helpers';
 import { expect } from 'chai';
 
-async function loadWebView (w: WebContents, attributes: Record<string, string>): Promise<void> {
+async function loadWebView (w: WebContents, attributes: Record<string, string>, openDevTools: boolean = false): Promise<void> {
   await w.executeJavaScript(`
     new Promise((resolve, reject) => {
       const webview = new WebView()
@@ -12,6 +12,11 @@ async function loadWebView (w: WebContents, attributes: Record<string, string>):
         webview.setAttribute(k, v)
       }
       document.body.appendChild(webview)
+      webview.addEventListener('dom-ready', () => {
+        if (${openDevTools}) {
+          webview.openDevTools()
+        }
+      })
       webview.addEventListener('did-finish-load', () => {
         resolve()
       })
@@ -165,6 +170,10 @@ describe('<webview> tag', function () {
     await BrowserWindow.addDevToolsExtension(extensionPath);
 
     w.loadFile(path.join(__dirname, 'fixtures', 'pages', 'webview-devtools.html'));
+    loadWebView(w.webContents, {
+      nodeintegration: 'on',
+      src: `file://${path.join(__dirname, 'fixtures', 'blank.html')}`
+    }, true);
     let childWebContentsId = 0;
     app.once('web-contents-created', (e, webContents) => {
       childWebContentsId = webContents.id;