From cc01272a8d8fef921508f387e73e2a4ba03af2b1 Mon Sep 17 00:00:00 2001 From: "electron-roller[bot]" <84116207+electron-roller[bot]@users.noreply.github.com> Date: Tue, 5 Oct 2021 19:21:00 -0700 Subject: [PATCH] chore: bump chromium to 96.0.4647.0 (main) (#30814) * chore: bump chromium in DEPS to 95.0.4630.0 * 3133701: Fix chrome root store codegen for cross-compile builds. https://chromium-review.googlesource.com/c/chromium/src/+/3133701 * 49125: Include SHA512-256 in EVP_get_digestbyname and EVP_MD_do_all. https://boringssl-review.googlesource.com/c/boringssl/+/49125 * chore: fixup patch indices * 3131662: [Code Health] Remove ListValue::Append(Integer|Boolean) https://chromium-review.googlesource.com/c/chromium/src/+/3131662 * chore: bump chromium in DEPS to 95.0.4631.0 * chore: update patches * chore: bump chromium in DEPS to 95.0.4635.0 * chore: update patches * chore: bump chromium in DEPS to 95.0.4636.0 * chore: bump chromium in DEPS to 95.0.4637.0 * chore: update patches * refactor: move PlatformNotificationService into BrowserContext Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3137256 * refactor: ListValue::GetSize and ListValue::AppendString were removed Refs: https://chromium-review.googlesource.com/c/chromium/src/+/3144540 * chore: bump chromium in DEPS to 95.0.4638.0 * chore: bump chromium in DEPS to 95.0.4638.4 * chore: bump chromium in DEPS to 96.0.4640.0 * chore: bump chromium in DEPS to 96.0.4641.0 * chore: bump chromium in DEPS to 96.0.4642.0 * chore: update patches Co-authored-by: Michaela Laurencin * 3134756: Move extensions/browser/value_store to components/value_store. Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3134756 * 3150092: [Autofill] Allow aligning Autofill suggestions to the field's center Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3150092 * chore: bump chromium in DEPS to 96.0.4643.0 * chore: update patches * chore: bump chromium in DEPS to 96.0.4644.0 * chore: update patches * chore: bump chromium in DEPS to 96.0.4645.0 * chore: update patches * chore: bump chromium in DEPS to 96.0.4646.0 * chore: bump chromium in DEPS to 96.0.4647.0 * chore: update patches Ref (for chromium): https://chromium-review.googlesource.com/c/chromium/src/+/3165772 * 3162087: Reland "Ensure Branch Target Identification is enabled for executable pages." Ref: https://chromium-review.googlesource.com/c/chromium/src/+/3162087 * chore: update evert_add_inline_and_inline_origin_records_to_symbol_file.patch Xref: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3166678 Xref: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3166674 * chore: update Allocator construction Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3135195 Change RefCount::kAllowed/Disallowed semantics into BackupRefPtr::kEnabled/Disabled * chore: add UseConfigurablePool to v8::ArrayBuffer::Allocator invocation Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3090845 * chore: do not set network_context_params.context_name Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3155743 Remove name field from mojom::NetworkContext * fix: use ForEachRenderFrameHost to iterate frames. Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3163336 New implementation partially cribbed from https://source.chromium.org/chromium/chromium/src/+/main:extensions/browser/script_executor.cc;drc=f894f106c6d5fac8e0b75158f622256e0f34f593;l=109 * [Blink Cleanup] Remove WebLocalFrame::RequestExecuteScriptAndReturnValue() Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3149699 ExecuteJavaScript's RequestExecuteScript() new params are cribbed from https://chromium-review.googlesource.com/c/chromium/src/+/3149699/4/third_party/blink/renderer/core/frame/web_local_frame_impl.cc * Remove IsDescendantOf API on RenderFrameHost. Xref: https://chromium-review.googlesource.com/c/chromium/src/+/3165357 function is trivial to implement, so make a local copy in anon namespace * Rewrite IsDescendantOf check to check GetParentOrOuterDocument. https://chromium-review.googlesource.com/c/chromium/src/+/3160061 * Remove GetFramesInSubtree from RenderFrameHost https://chromium-review.googlesource.com/c/chromium/src/+/3163336 * fix: dump_syms for macOS * chore: update patches * [Code Health] Remove ListValue::AppendString and ListValue::GetSize https://chromium-review.googlesource.com/c/chromium/src/+/3144540 * fix: gn check https://chromium-review.googlesource.com/c/chromium/src/+/3163890 * fix: crash with Isolate::GetHeapCodeAndMetadataStatistics https://chromium-review.googlesource.com/c/v8/v8/+/3175820 * chore: update patches * chore: fix windows build * Add kPrintWithPostScriptType42Fonts feature. https://chromium-review.googlesource.com/c/chromium/src/+/3150776 * chore: update patches * chore: fix tests * ozone/x11: fix VA-API. https://chromium-review.googlesource.com/c/chromium/src/+/3141878 * Revert "ozone/x11: fix VA-API." This reverts commit 23e742acb1032bf4afc1a45e4bed38e42184fd01. * Reland "Make Ozone/X11 default." https://chromium-review.googlesource.com/c/chromium/src/+/3114071 * fixup Reland "Make Ozone/X11 default." * fixup Reland "Make Ozone/X11 default." for clipboard Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard Co-authored-by: VerteDinde Co-authored-by: Michaela Laurencin Co-authored-by: VerteDinde Co-authored-by: Charles Kerr Co-authored-by: deepak1556 Co-authored-by: John Kleinschmidt Co-authored-by: John Kleinschmidt --- BUILD.gn | 1 + DEPS | 2 +- chromium_src/BUILD.gn | 1 + patches/boringssl/.patches | 1 - ...hash_to_rsa_pss_params_st_for_compat.patch | 26 - patches/boringssl/expose_aes-cfb.patch | 2 +- patches/boringssl/expose_des-ede3.patch | 2 +- patches/boringssl/expose_ripemd160.patch | 18 +- patches/breakpad/.patches | 2 - ...inline_origin_records_to_symbol_file.patch | 1199 ----------------- ...arning_about_unknown_abstract_origin.patch | 47 - patches/chromium/.patches | 1 - .../add_didinstallconditionalfeatures.patch | 14 +- ..._scheduler_throttling_per_renderview.patch | 12 +- patches/chromium/blink_local_frame.patch | 2 +- .../build_add_electron_tracing_category.patch | 2 +- ..._depend_on_packed_resource_integrity.patch | 16 +- patches/chromium/build_gn.patch | 2 +- patches/chromium/can_create_window.patch | 32 +- ...screationoverridden_with_full_params.patch | 28 +- ...esources_not_chrome_for_spellchecker.patch | 6 +- patches/chromium/command-ismediakey.patch | 4 +- .../crash_allow_setting_more_options.patch | 6 +- ...ay_lock_the_protocol_scheme_registry.patch | 4 +- patches/chromium/desktop_media_list.patch | 8 +- patches/chromium/disable-redraw-lock.patch | 12 +- .../disable_color_correct_rendering.patch | 16 +- .../disable_compositor_recycling.patch | 4 +- patches/chromium/disable_hidden.patch | 14 +- patches/chromium/disable_unload_metrics.patch | 6 +- ...ll_getwebframe_-_view_when_get_blink.patch | 4 +- .../chromium/enable_reset_aspect_ratio.patch | 8 +- ...locator_for_usage_outside_of_the_gin.patch | 20 +- ...xpose_setuseragent_on_networkcontext.patch | 14 +- ...g_the_base_spellchecker_download_url.patch | 4 +- ...to_add_observers_on_created_hunspell.patch | 12 +- ...screen_rendering_with_viz_compositor.patch | 2 +- ..._raw_response_headers_from_urlloader.patch | 32 +- ...ore_codegen_for_cross-compile_builds.patch | 101 -- ...ntcapturercount_in_web_contents_impl.patch | 8 +- ...out_profile_refs_in_accessibility_ui.patch | 6 +- patches/chromium/frame_host_manager.patch | 6 +- .../gin_enable_disable_v8_platform.patch | 2 +- ...gpu_notify_when_dxdiag_request_fails.patch | 2 +- .../chromium/gritsettings_resource_ids.patch | 4 +- patches/chromium/gtk_visibility.patch | 4 +- ...sync_with_host_os_mac_on_linux_in_ci.patch | 2 +- ...mas_avoid_usage_of_pthread_fchdir_np.patch | 6 +- .../mas_disable_remote_accessibility.patch | 22 +- .../chromium/mas_disable_remote_layer.patch | 6 +- patches/chromium/mas_no_private_api.patch | 39 +- ...emote_certificate_verification_logic.patch | 18 +- .../chromium/notification_provenance.patch | 27 +- patches/chromium/pepper_plugin_support.patch | 4 +- patches/chromium/picture-in-picture.patch | 12 +- patches/chromium/printing.patch | 63 +- patches/chromium/process_singleton.patch | 38 +- patches/chromium/proxy_config_monitor.patch | 6 +- ...r_changes_to_the_webcontentsobserver.patch | 20 +- .../render_widget_host_view_base.patch | 12 +- .../render_widget_host_view_mac.patch | 10 +- patches/chromium/resource_file_conflict.patch | 6 +- patches/chromium/scroll_bounce_flag.patch | 4 +- .../support_mixed_sandbox_with_zygote.patch | 10 +- patches/chromium/ui_gtk_public_header.patch | 2 +- patches/chromium/web_contents.patch | 8 +- patches/chromium/webview_cross_drag.patch | 4 +- patches/chromium/webview_fullscreen.patch | 4 +- .../worker_context_will_destroy.patch | 10 +- ...feat_add_hook_to_notify_script_ready.patch | 10 +- patches/config.json | 4 +- patches/v8/.patches | 3 +- ...seline_skip_deoptimization_data_size.patch | 31 + patches/v8/build_gn.patch | 8 +- ...ager_traced_value_in_ephemeron_pairs.patch | 208 --- patches/v8/dcheck.patch | 8 +- ...export_private_v8_symbols_on_windows.patch | 8 +- patches/v8/expose_mksnapshot.patch | 4 +- ...iling_cctest_for_irregexp_reentrancy.patch | 109 -- ...p_allow_reentrant_irregexp_execution.patch | 18 +- shell/browser/api/electron_api_event.cc | 2 +- shell/browser/api/electron_api_session.cc | 2 +- .../browser/api/electron_api_web_contents.cc | 2 +- .../api/electron_api_web_frame_main.cc | 19 +- shell/browser/electron_browser_client.cc | 3 +- shell/browser/electron_browser_client.h | 4 +- shell/browser/electron_browser_context.cc | 7 +- shell/browser/electron_browser_context.h | 2 + shell/browser/electron_browser_main_parts.cc | 3 +- shell/browser/event_emitter_mixin.h | 2 +- .../extensions/electron_extension_system.cc | 7 +- .../extensions/electron_extension_system.h | 6 +- shell/browser/file_select_helper.cc | 9 +- shell/browser/javascript_environment.cc | 3 +- shell/browser/mac/dict_util.mm | 8 +- shell/browser/native_window_views.cc | 239 ++-- .../net/system_network_context_manager.cc | 2 - shell/browser/ui/autofill_popup.cc | 16 +- shell/browser/ui/file_dialog_gtk.cc | 12 +- shell/browser/ui/gtk/menu_util.cc | 14 +- shell/browser/ui/message_box_gtk.cc | 12 +- .../browser/web_contents_permission_helper.cc | 4 +- shell/common/asar/archive.cc | 2 +- shell/common/gin_converters/net_converter.cc | 2 +- shell/common/gin_helper/event_emitter.cc | 8 +- shell/common/gin_helper/event_emitter.h | 11 +- shell/common/v8_value_converter.cc | 4 +- shell/renderer/api/electron_api_web_frame.cc | 22 +- spec/api-clipboard-spec.js | 4 +- 109 files changed, 629 insertions(+), 2265 deletions(-) delete mode 100644 patches/boringssl/add_maskhash_to_rsa_pss_params_st_for_compat.patch delete mode 100644 patches/breakpad/.patches delete mode 100644 patches/breakpad/revert_add_inline_and_inline_origin_records_to_symbol_file.patch delete mode 100644 patches/breakpad/revert_remove_warning_about_unknown_abstract_origin.patch delete mode 100644 patches/chromium/fix_chrome_root_store_codegen_for_cross-compile_builds.patch create mode 100644 patches/v8/baseline_skip_deoptimization_data_size.patch delete mode 100644 patches/v8/cppgc-js_support_eager_traced_value_in_ephemeron_pairs.patch delete mode 100644 patches/v8/regexp_add_a_currently_failing_cctest_for_irregexp_reentrancy.patch diff --git a/BUILD.gn b/BUILD.gn index 671780c8c06f..7543cbff158e 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -347,6 +347,7 @@ source_set("electron_lib") { "//base/allocator:buildflags", "//chrome/app:command_ids", "//chrome/app/resources:platform_locale_settings", + "//components/autofill/core/common:features", "//components/certificate_transparency", "//components/language/core/browser", "//components/net_log", diff --git a/DEPS b/DEPS index 511cc565657f..d9095fcf1b19 100644 --- a/DEPS +++ b/DEPS @@ -15,7 +15,7 @@ gclient_gn_args = [ vars = { 'chromium_version': - '95.0.4629.0', + '96.0.4647.0', 'node_version': 'v16.10.0', 'nan_version': diff --git a/chromium_src/BUILD.gn b/chromium_src/BUILD.gn index 00aa4d88a2bc..5316e55c5301 100644 --- a/chromium_src/BUILD.gn +++ b/chromium_src/BUILD.gn @@ -212,6 +212,7 @@ static_library("chrome") { "//components/services/print_compositor", "//components/services/print_compositor/public/cpp", "//components/services/print_compositor/public/mojom", + "//printing/backend", ] deps += [ diff --git a/patches/boringssl/.patches b/patches/boringssl/.patches index ea99b0d7e721..21fb526862dc 100644 --- a/patches/boringssl/.patches +++ b/patches/boringssl/.patches @@ -2,5 +2,4 @@ expose_ripemd160.patch expose_aes-cfb.patch expose_des-ede3.patch fix_sync_evp_get_cipherbynid_and_evp_get_cipherbyname.patch -add_maskhash_to_rsa_pss_params_st_for_compat.patch enable_x509_v_flag_trusted_first_flag.patch diff --git a/patches/boringssl/add_maskhash_to_rsa_pss_params_st_for_compat.patch b/patches/boringssl/add_maskhash_to_rsa_pss_params_st_for_compat.patch deleted file mode 100644 index 8300d0de6766..000000000000 --- a/patches/boringssl/add_maskhash_to_rsa_pss_params_st_for_compat.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Shelley Vohr -Date: Wed, 8 Sep 2021 10:59:51 +0200 -Subject: Add maskHash to rsa_pss_params_st for compat - -This CL adds a maskHash member to the rsa_pss_params_st struct for -increased compatibility with OpenSSL. - -Node.js recently began to make use of this member in -https://github.com/nodejs/node/pull/39851 -and without this member Electron sees compilation errors. - -Upstreamed at https://boringssl-review.googlesource.com/c/boringssl/+/49365 - -diff --git a/include/openssl/x509.h b/include/openssl/x509.h -index fa333ca057dd8e90a3e38c51db6269815de7b85f..0f4a6d79514739fb4c719f9e5b41db364e775417 100644 ---- a/include/openssl/x509.h -+++ b/include/openssl/x509.h -@@ -1949,6 +1949,7 @@ typedef struct rsa_pss_params_st { - X509_ALGOR *maskGenAlgorithm; - ASN1_INTEGER *saltLength; - ASN1_INTEGER *trailerField; -+ X509_ALGOR *maskHash; - } RSA_PSS_PARAMS; - - DECLARE_ASN1_FUNCTIONS(RSA_PSS_PARAMS) diff --git a/patches/boringssl/expose_aes-cfb.patch b/patches/boringssl/expose_aes-cfb.patch index 0ab27b410621..8b6ceaf52443 100644 --- a/patches/boringssl/expose_aes-cfb.patch +++ b/patches/boringssl/expose_aes-cfb.patch @@ -31,7 +31,7 @@ index 786a5d5fb13d7ceafc9b7d58c0aaccb88552506d..5ede89f9f0761d1da1baa899e9a02b77 return EVP_aes_128_ctr(); } else if (OPENSSL_strcasecmp(name, "aes-192-ctr") == 0) { diff --git a/decrepit/evp/evp_do_all.c b/decrepit/evp/evp_do_all.c -index 5a41a7b7dc9afee65d9004c497da735073715bd3..c6c901eaff474eaa3f06128ea825b8203d064a52 100644 +index 852b76bea69988e0b3ac76a17b603128f239dde0..d443f4dc2daea0b7aa86ae75d31d995fae667ba9 100644 --- a/decrepit/evp/evp_do_all.c +++ b/decrepit/evp/evp_do_all.c @@ -20,8 +20,10 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher, diff --git a/patches/boringssl/expose_des-ede3.patch b/patches/boringssl/expose_des-ede3.patch index 39520879c940..45177d0b62fa 100644 --- a/patches/boringssl/expose_des-ede3.patch +++ b/patches/boringssl/expose_des-ede3.patch @@ -19,7 +19,7 @@ index 5ede89f9f0761d1da1baa899e9a02b77ffcffe93..8205e121c152fe4e2d8df34a1ac2fe04 // This is not a name used by OpenSSL, but tcpdump registers it // with |EVP_add_cipher_alias|. Our |EVP_add_cipher_alias| is a diff --git a/decrepit/evp/evp_do_all.c b/decrepit/evp/evp_do_all.c -index c6c901eaff474eaa3f06128ea825b8203d064a52..f577cd23bf72b94b2651fe5eeb757106f5adaea2 100644 +index d443f4dc2daea0b7aa86ae75d31d995fae667ba9..5e71420b765019edea82a33884ace539cd91bda5 100644 --- a/decrepit/evp/evp_do_all.c +++ b/decrepit/evp/evp_do_all.c @@ -39,6 +39,7 @@ void EVP_CIPHER_do_all_sorted(void (*callback)(const EVP_CIPHER *cipher, diff --git a/patches/boringssl/expose_ripemd160.patch b/patches/boringssl/expose_ripemd160.patch index cc31f9c69acd..8671efe04dca 100644 --- a/patches/boringssl/expose_ripemd160.patch +++ b/patches/boringssl/expose_ripemd160.patch @@ -10,12 +10,12 @@ this patch is required to provide ripemd160 support in the nodejs crypto module. diff --git a/crypto/digest_extra/digest_extra.c b/crypto/digest_extra/digest_extra.c -index a93601c170dc407f7d6d628fb7e2d2f0788467f3..00911ee69bb99a34b938ea6a62cd10bc930ec95c 100644 +index 8cbb28e3afde3dbae3887b22e8b607fa7303e89f..32caba196eb9f0823f774dac9e91314035b3ff7f 100644 --- a/crypto/digest_extra/digest_extra.c +++ b/crypto/digest_extra/digest_extra.c -@@ -84,6 +84,7 @@ static const struct nid_to_digest nid_to_digest_mapping[] = { - {NID_sha384, EVP_sha384, SN_sha384, LN_sha384}, +@@ -85,6 +85,7 @@ static const struct nid_to_digest nid_to_digest_mapping[] = { {NID_sha512, EVP_sha512, SN_sha512, LN_sha512}, + {NID_sha512_256, EVP_sha512_256, SN_sha512_256, LN_sha512_256}, {NID_md5_sha1, EVP_md5_sha1, SN_md5_sha1, LN_md5_sha1}, + {NID_ripemd160, EVP_ripemd160, SN_ripemd160, LN_ripemd160}, // As a remnant of signing |EVP_MD|s, OpenSSL returned the corresponding @@ -62,21 +62,21 @@ index f006ebbc53eea78ce0337a076a05285f22da7a18..7b9309f39a2e5dc6e61bb89e5d32b176 + #undef CHECK diff --git a/decrepit/evp/evp_do_all.c b/decrepit/evp/evp_do_all.c -index d8023e08f70a060aed083212fefd1de3ecc142e4..5a41a7b7dc9afee65d9004c497da735073715bd3 100644 +index a3fb077b9b9e66d1bc524fd7987622e73aa4776a..852b76bea69988e0b3ac76a17b603128f239dde0 100644 --- a/decrepit/evp/evp_do_all.c +++ b/decrepit/evp/evp_do_all.c -@@ -78,6 +78,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher, - callback(EVP_sha256(), "SHA256", NULL, arg); +@@ -79,6 +79,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher, callback(EVP_sha384(), "SHA384", NULL, arg); callback(EVP_sha512(), "SHA512", NULL, arg); -+ callback(EVP_ripemd160(), "RIPEMD160", NULL, arg); + callback(EVP_sha512_256(), "SHA512-256", NULL, arg); ++ callback(EVP_ripemd160(), "ripemd160", NULL, arg); callback(EVP_md4(), "md4", NULL, arg); callback(EVP_md5(), "md5", NULL, arg); -@@ -86,6 +87,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher, - callback(EVP_sha256(), "sha256", NULL, arg); +@@ -88,6 +89,7 @@ void EVP_MD_do_all_sorted(void (*callback)(const EVP_MD *cipher, callback(EVP_sha384(), "sha384", NULL, arg); callback(EVP_sha512(), "sha512", NULL, arg); + callback(EVP_sha512_256(), "sha512-256", NULL, arg); + callback(EVP_ripemd160(), "ripemd160", NULL, arg); } diff --git a/patches/breakpad/.patches b/patches/breakpad/.patches deleted file mode 100644 index 97646d62eda7..000000000000 --- a/patches/breakpad/.patches +++ /dev/null @@ -1,2 +0,0 @@ -revert_remove_warning_about_unknown_abstract_origin.patch -revert_add_inline_and_inline_origin_records_to_symbol_file.patch diff --git a/patches/breakpad/revert_add_inline_and_inline_origin_records_to_symbol_file.patch b/patches/breakpad/revert_add_inline_and_inline_origin_records_to_symbol_file.patch deleted file mode 100644 index 59fb75afa8ef..000000000000 --- a/patches/breakpad/revert_add_inline_and_inline_origin_records_to_symbol_file.patch +++ /dev/null @@ -1,1199 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Samuel Attard -Date: Thu, 2 Sep 2021 22:58:02 +0000 -Subject: Revert "Add INLINE and INLINE_ORIGIN records to symbol file." - -This reverts commit 4f5b814790301e7b8252535e0732bee11f4bb801. - -diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc -index c51514b7575c2e961aaae3ff883be00d80e3ec15..d129fba4fde3227d191b18bfcb2f23dbb58904c7 100644 ---- a/src/common/dwarf_cu_to_module.cc -+++ b/src/common/dwarf_cu_to_module.cc -@@ -44,7 +44,6 @@ - #include - - #include --#include - #include - #include - -@@ -59,7 +58,6 @@ using std::map; - using std::pair; - using std::sort; - using std::vector; --using std::unique_ptr; - - // Data provided by a DWARF specification DIE. - // -@@ -100,71 +98,6 @@ struct AbstractOrigin { - - typedef map AbstractOriginByOffset; - --using InlineOriginByOffset = map; -- --class InlineOriginMap { -- public: -- Module::InlineOrigin* GetOrCreateInlineOrigin(uint64_t offset, -- const string& name) { -- uint64_t specification_offset = references_[offset]; -- if (inline_origins_.find(specification_offset) != inline_origins_.end()) { -- if (inline_origins_[specification_offset]->name == "") { -- inline_origins_[specification_offset]->name = name; -- } -- return inline_origins_[specification_offset]; -- } -- inline_origins_[specification_offset] = new Module::InlineOrigin(name); -- return inline_origins_[specification_offset]; -- } -- -- // offset is the offset of a DW_TAG_subprogram. specification_offset is the -- // value of its DW_AT_specification or equals to offset if DW_AT_specification -- // doesn't exist in that DIE. -- void SetReference(uint64_t offset, uint64_t specification_offset) { -- // If we haven't seen this doesn't exist in reference map, always add it. -- if (references_.find(offset) == references_.end()) { -- references_[offset] = specification_offset; -- return; -- } -- // If offset equals specification_offset and offset exists in references_, -- // there is no need to update the references_ map. This early return is -- // necessary because the call to erase in following if will remove the entry -- // of specification_offset in inline_origins_. -- // If specification_offset equals to references_[offset], it might be -- // duplicate debug info. -- if (offset == specification_offset || -- specification_offset == references_[offset]) -- return; -- -- // Fix up mapping in inline_origins_. -- auto remove = inline_origins_.find(references_[offset]); -- if (remove != inline_origins_.end()) { -- inline_origins_[specification_offset] = remove->second; -- inline_origins_.erase(remove); -- } -- references_[offset] = specification_offset; -- } -- -- void AssignFilesToInlineOrigins(vector& inline_origin_offsets, -- Module::File* file) { -- for (uint64_t offset : inline_origin_offsets) -- if (references_.find(offset) != references_.end()) { -- auto origin = inline_origins_.find(references_[offset]); -- if (origin != inline_origins_.end()) -- origin->second->file = file; -- } -- } -- -- private: -- // A map from a DW_TAG_subprogram's offset to the DW_TAG_subprogram. -- InlineOriginByOffset inline_origins_; -- -- // A map from a DW_TAG_subprogram's offset to the offset of its specification -- // or abstract origin subprogram. The set of values in this map should always -- // be the same set of keys in inline_origins_. -- map references_; --}; -- - // Data global to the DWARF-bearing file that is private to the - // DWARF-to-Module process. - struct DwarfCUToModule::FilePrivate { -@@ -197,8 +130,6 @@ struct DwarfCUToModule::FilePrivate { - // Keep a list of forward references from DW_AT_abstract_origin and - // DW_AT_specification attributes so names can be fixed up. - std::map forward_ref_die_to_func; -- -- InlineOriginMap inline_origin_map; - }; - - DwarfCUToModule::FileContext::FileContext(const string& filename, -@@ -341,9 +272,6 @@ struct DwarfCUToModule::CUContext { - - // A map of function pointers to the its forward specification DIE's offset. - map spec_function_offsets; -- -- // From file index to vector of subprogram's offset in this CU. -- map> inline_origins; - }; - - // Information about the context of a particular DIE. This is for -@@ -376,8 +304,7 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { - offset_(offset), - declaration_(false), - specification_(NULL), -- abstract_origin_(NULL), -- forward_ref_die_offset_(0), specification_offset_(0) { } -+ forward_ref_die_offset_(0) { } - - // Derived classes' ProcessAttributeUnsigned can defer to this to - // handle DW_AT_declaration, or simply not override it. -@@ -429,19 +356,11 @@ class DwarfCUToModule::GenericDIEHandler: public DIEHandler { - // Otherwise, this is NULL. - Specification* specification_; - -- // If this DIE has a DW_AT_abstract_origin attribute, this is the -- // AbstractOrigin structure for the DIE the attribute refers to. -- // Otherwise, this is NULL. -- const AbstractOrigin* abstract_origin_; -- - // If this DIE has a DW_AT_specification or DW_AT_abstract_origin and it is a - // forward reference, no Specification will be available. Track the reference - // to be fixed up when the DIE is parsed. - uint64_t forward_ref_die_offset_; - -- // The root offset of Specification or abstract origin. -- uint64_t specification_offset_; -- - // The value of the DW_AT_name attribute, or the empty string if the - // DIE has no such attribute. - string name_attribute_; -@@ -493,21 +412,6 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference( - } else { - cu_context_->reporter->UnknownSpecification(offset_, data); - } -- specification_offset_ = data; -- break; -- } -- case DW_AT_abstract_origin: { -- const AbstractOriginByOffset& origins = -- cu_context_->file_context->file_private_->origins; -- AbstractOriginByOffset::const_iterator origin = origins.find(data); -- if (origin != origins.end()) { -- abstract_origin_ = &(origin->second); -- } else if (data > offset_) { -- forward_ref_die_offset_ = data; -- } else { -- cu_context_->reporter->UnknownAbstractOrigin(offset_, data); -- } -- specification_offset_ = data; - break; - } - default: break; -@@ -615,163 +519,6 @@ string DwarfCUToModule::GenericDIEHandler::ComputeQualifiedName() { - return return_value; - } - --static bool IsEmptyRange(const vector& ranges) { -- uint64_t size = accumulate(ranges.cbegin(), ranges.cend(), 0, -- [](uint64_t total, Module::Range entry) { -- return total + entry.size; -- } -- ); -- -- return size == 0; --} -- -- --// A handler for DW_TAG_inlined_subroutine DIEs. --class DwarfCUToModule::InlineHandler : public GenericDIEHandler { -- public: -- InlineHandler(CUContext* cu_context, -- DIEContext* parent_context, -- uint64_t offset, -- int inline_nest_level, -- vector>& inlines) -- : GenericDIEHandler(cu_context, parent_context, offset), -- low_pc_(0), -- high_pc_(0), -- high_pc_form_(DW_FORM_addr), -- ranges_form_(DW_FORM_sec_offset), -- ranges_data_(0), -- call_site_line_(0), -- inline_nest_level_(inline_nest_level), -- inlines_(inlines) {} -- -- void ProcessAttributeUnsigned(enum DwarfAttribute attr, -- enum DwarfForm form, -- uint64_t data); -- DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); -- bool EndAttributes(); -- void Finish(); -- -- private: -- // The fully-qualified name, as derived from name_attribute_, -- // specification_, parent_context_. Computed in EndAttributes. -- string name_; -- uint64_t low_pc_; // DW_AT_low_pc -- uint64_t high_pc_; // DW_AT_high_pc -- DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. -- DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx -- uint64_t ranges_data_; // DW_AT_ranges -- int call_site_line_; -- int inline_nest_level_; -- // A vector of inlines in the same nest level. It's owned by its parent -- // function/inline. At Finish(), add this inline into the vector. -- vector>& inlines_; -- // A vector of child inlines. -- vector> child_inlines_; --}; -- --void DwarfCUToModule::InlineHandler::ProcessAttributeUnsigned( -- enum DwarfAttribute attr, -- enum DwarfForm form, -- uint64_t data) { -- switch (attr) { -- case DW_AT_low_pc: -- low_pc_ = data; -- break; -- case DW_AT_high_pc: -- high_pc_form_ = form; -- high_pc_ = data; -- break; -- case DW_AT_ranges: -- ranges_data_ = data; -- ranges_form_ = form; -- break; -- case DW_AT_call_line: -- call_site_line_ = data; -- break; -- default: -- GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); -- break; -- } --} -- --DIEHandler* DwarfCUToModule::InlineHandler::FindChildHandler( -- uint64_t offset, -- enum DwarfTag tag) { -- switch (tag) { -- case DW_TAG_inlined_subroutine: -- return new InlineHandler(cu_context_, new DIEContext(), offset, -- inline_nest_level_ + 1, child_inlines_); -- default: -- return NULL; -- } --} -- --bool DwarfCUToModule::InlineHandler::EndAttributes() { -- if (abstract_origin_) -- name_ = abstract_origin_->name; -- if (name_.empty()) { -- // We haven't seen the abstract origin yet, which might appears later and we -- // will fix the name after calling -- // InlineOriginMap::GetOrCreateInlineOrigin with right name. -- name_ = ""; -- } -- return true; --} -- --void DwarfCUToModule::InlineHandler::Finish() { -- vector ranges; -- -- if (low_pc_ && high_pc_) { -- if (high_pc_form_ != DW_FORM_addr && -- high_pc_form_ != DW_FORM_GNU_addr_index && -- high_pc_form_ != DW_FORM_addrx && -- high_pc_form_ != DW_FORM_addrx1 && -- high_pc_form_ != DW_FORM_addrx2 && -- high_pc_form_ != DW_FORM_addrx3 && -- high_pc_form_ != DW_FORM_addrx4) { -- high_pc_ += low_pc_; -- } -- -- Module::Range range(low_pc_, high_pc_ - low_pc_); -- ranges.push_back(range); -- } else { -- RangesHandler* ranges_handler = cu_context_->ranges_handler; -- if (ranges_handler) { -- RangeListReader::CURangesInfo cu_info; -- if (cu_context_->AssembleRangeListInfo(&cu_info)) { -- if (!ranges_handler->ReadRanges(ranges_form_, ranges_data_, -- &cu_info, &ranges)) { -- ranges.clear(); -- cu_context_->reporter->MalformedRangeList(ranges_data_); -- } -- } else { -- cu_context_->reporter->MissingRanges(); -- } -- } -- } -- -- // Malformed DWARF may omit the name, but all Module::Functions must -- // have names. -- // If we have a forward reference to a DW_AT_specification or -- // DW_AT_abstract_origin, then don't warn, the name will be fixed up -- // later -- if (name_.empty() && forward_ref_die_offset_ == 0) -- cu_context_->reporter->UnnamedFunction(offset_); -- -- // Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin. -- assert(specification_offset_ != 0); -- -- cu_context_->file_context->file_private_->inline_origin_map.SetReference( -- specification_offset_, specification_offset_); -- Module::InlineOrigin* origin = -- cu_context_->file_context->file_private_->inline_origin_map -- .GetOrCreateInlineOrigin(specification_offset_, name_); -- unique_ptr in( -- new Module::Inline(origin, ranges, call_site_line_, inline_nest_level_, -- std::move(child_inlines_))); -- inlines_.push_back(std::move(in)); --} -- - // A handler class for DW_TAG_subprogram DIEs. - class DwarfCUToModule::FuncHandler: public GenericDIEHandler { - public: -@@ -780,7 +527,7 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { - : GenericDIEHandler(cu_context, parent_context, offset), - low_pc_(0), high_pc_(0), high_pc_form_(DW_FORM_addr), - ranges_form_(DW_FORM_sec_offset), ranges_data_(0), -- decl_file_data_(UINT64_MAX), inline_(false) { } -+ abstract_origin_(NULL), inline_(false) { } - - void ProcessAttributeUnsigned(enum DwarfAttribute attr, - enum DwarfForm form, -@@ -788,7 +535,10 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { - void ProcessAttributeSigned(enum DwarfAttribute attr, - enum DwarfForm form, - int64_t data); -- DIEHandler* FindChildHandler(uint64_t offset, enum DwarfTag tag); -+ void ProcessAttributeReference(enum DwarfAttribute attr, -+ enum DwarfForm form, -+ uint64_t data); -+ - bool EndAttributes(); - void Finish(); - -@@ -800,10 +550,8 @@ class DwarfCUToModule::FuncHandler: public GenericDIEHandler { - DwarfForm high_pc_form_; // DW_AT_high_pc can be length or address. - DwarfForm ranges_form_; // DW_FORM_sec_offset or DW_FORM_rnglistx - uint64_t ranges_data_; // DW_AT_ranges -- // DW_AT_decl_file, value of UINT64_MAX means undefined. -- uint64_t decl_file_data_; -+ const AbstractOrigin* abstract_origin_; - bool inline_; -- vector> child_inlines_; - }; - - void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( -@@ -825,9 +573,7 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeUnsigned( - ranges_data_ = data; - ranges_form_ = form; - break; -- case DW_AT_decl_file: -- decl_file_data_ = data; -- break; -+ - default: - GenericDIEHandler::ProcessAttributeUnsigned(attr, form, data); - break; -@@ -849,15 +595,27 @@ void DwarfCUToModule::FuncHandler::ProcessAttributeSigned( - } - } - --DIEHandler* DwarfCUToModule::FuncHandler::FindChildHandler( -- uint64_t offset, -- enum DwarfTag tag) { -- switch (tag) { -- case DW_TAG_inlined_subroutine: -- return new InlineHandler(cu_context_, new DIEContext(), offset, 0, -- child_inlines_); -+void DwarfCUToModule::FuncHandler::ProcessAttributeReference( -+ enum DwarfAttribute attr, -+ enum DwarfForm form, -+ uint64_t data) { -+ switch (attr) { -+ case DW_AT_abstract_origin: { -+ const AbstractOriginByOffset& origins = -+ cu_context_->file_context->file_private_->origins; -+ AbstractOriginByOffset::const_iterator origin = origins.find(data); -+ if (origin != origins.end()) { -+ abstract_origin_ = &(origin->second); -+ } else if (data > offset_) { -+ forward_ref_die_offset_ = data; -+ } else { -+ cu_context_->reporter->UnknownAbstractOrigin(offset_, data); -+ } -+ break; -+ } - default: -- return NULL; -+ GenericDIEHandler::ProcessAttributeReference(attr, form, data); -+ break; - } - } - -@@ -870,6 +628,16 @@ bool DwarfCUToModule::FuncHandler::EndAttributes() { - return true; - } - -+static bool IsEmptyRange(const vector& ranges) { -+ uint64_t size = accumulate(ranges.cbegin(), ranges.cend(), 0, -+ [](uint64_t total, Module::Range entry) { -+ return total + entry.size; -+ } -+ ); -+ -+ return size == 0; -+} -+ - void DwarfCUToModule::FuncHandler::Finish() { - vector ranges; - -@@ -915,12 +683,11 @@ void DwarfCUToModule::FuncHandler::Finish() { - } - } - -- bool empty_range = IsEmptyRange(ranges); - // Did we collect the information we need? Not all DWARF function - // entries are non-empty (for example, inlined functions that were never - // used), but all the ones we're interested in cover a non-empty range of - // bytes. -- if (!empty_range) { -+ if (!IsEmptyRange(ranges)) { - low_pc_ = ranges.front().address; - - // Malformed DWARF may omit the name, but all Module::Functions must -@@ -954,27 +721,11 @@ void DwarfCUToModule::FuncHandler::Finish() { - cu_context_->spec_function_offsets[cu_context_->functions.back()] = - forward_ref_die_offset_; - } -- -- cu_context_->functions.back()->inlines.swap(child_inlines_); - } - } else if (inline_) { - AbstractOrigin origin(name_); - cu_context_->file_context->file_private_->origins[offset_] = origin; - } -- -- // Only keep track of DW_TAG_subprogram which have the attributes we are -- // interested. -- if (!empty_range || inline_ || decl_file_data_ != UINT64_MAX) { -- uint64_t offset = -- specification_offset_ != 0 ? specification_offset_ : offset_; -- cu_context_->file_context->file_private_->inline_origin_map.SetReference( -- offset_, offset); -- cu_context_->file_context->file_private_->inline_origin_map -- .GetOrCreateInlineOrigin(offset_, -- name_.empty() ? "" : name_); -- if (decl_file_data_ != UINT64_MAX) -- cu_context_->inline_origins[decl_file_data_].push_back(offset_); -- } - } - - // A handler for DIEs that contain functions and contribute a -@@ -1290,7 +1041,7 @@ void DwarfCUToModule::ReadSourceLines(uint64_t offset) { - line_section_start, line_section_length, - string_section_start, string_section_length, - line_string_section_start, line_string_section_length, -- cu_context_->file_context->module_, &lines_, &files_); -+ cu_context_->file_context->module_, &lines_); - } - - namespace { -@@ -1549,14 +1300,6 @@ void DwarfCUToModule::AssignLinesToFunctions() { - } - } - --void DwarfCUToModule::AssignFilesToInlines() { -- for (auto iter : files_) { -- cu_context_->file_context->file_private_->inline_origin_map -- .AssignFilesToInlineOrigins(cu_context_->inline_origins[iter.first], -- iter.second); -- } --} -- - void DwarfCUToModule::Finish() { - // Assembly language files have no function data, and that gives us - // no place to store our line numbers (even though the GNU toolchain -@@ -1575,8 +1318,6 @@ void DwarfCUToModule::Finish() { - // Dole out lines to the appropriate functions. - AssignLinesToFunctions(); - -- AssignFilesToInlines(); -- - // Add our functions, which now have source lines assigned to them, - // to module_, and remove duplicate functions. - for (Module::Function* func : *functions) -diff --git a/src/common/dwarf_cu_to_module.h b/src/common/dwarf_cu_to_module.h -index 99dcd879181aac4018080e8d0cb2c413efc67ebe..1320ccc2c885b5d591a877b41fd7d2af5a2ab65f 100644 ---- a/src/common/dwarf_cu_to_module.h -+++ b/src/common/dwarf_cu_to_module.h -@@ -156,8 +156,7 @@ class DwarfCUToModule: public RootDIEHandler { - uint64_t string_section_length, - const uint8_t* line_string_section, - uint64_t line_string_length, -- Module* module, vector* lines, -- map* files) = 0; -+ Module* module, vector* lines) = 0; - }; - - // The interface DwarfCUToModule uses to report warnings. The member -@@ -290,7 +289,6 @@ class DwarfCUToModule: public RootDIEHandler { - struct Specification; - class GenericDIEHandler; - class FuncHandler; -- class InlineHandler; - class NamedScopeHandler; - - // A map from section offsets to specifications. -@@ -311,8 +309,6 @@ class DwarfCUToModule: public RootDIEHandler { - // lines belong to which functions, beyond their addresses.) - void AssignLinesToFunctions(); - -- void AssignFilesToInlines(); -- - // The only reason cu_context_ and child_context_ are pointers is - // that we want to keep their definitions private to - // dwarf_cu_to_module.cc, instead of listing them all here. They are -@@ -339,9 +335,6 @@ class DwarfCUToModule: public RootDIEHandler { - // during parsing. Then, in Finish, we call AssignLinesToFunctions - // to dole them out to the appropriate functions. - vector lines_; -- -- // The map from file index to File* in this CU. -- std::map files_; - }; - - } // namespace google_breakpad -diff --git a/src/common/dwarf_cu_to_module_unittest.cc b/src/common/dwarf_cu_to_module_unittest.cc -index cb943ae3f085c7074ba48bb8036b669eb71de374..2ce69d73c6043a1f66c2d3406389287bbd557ece 100644 ---- a/src/common/dwarf_cu_to_module_unittest.cc -+++ b/src/common/dwarf_cu_to_module_unittest.cc -@@ -67,13 +67,12 @@ using ::testing::ValuesIn; - class MockLineToModuleHandler: public DwarfCUToModule::LineToModuleHandler { - public: - MOCK_METHOD1(StartCompilationUnit, void(const string& compilation_dir)); -- MOCK_METHOD9(ReadProgram, void(const uint8_t* program, uint64_t length, -+ MOCK_METHOD8(ReadProgram, void(const uint8_t* program, uint64_t length, - const uint8_t* string_section, - uint64_t string_section_length, - const uint8_t* line_string_section, - uint64_t line_string_section_length, -- Module* module, vector* lines, -- std::map* files)); -+ Module* module, vector* lines)); - }; - - class MockWarningReporter: public DwarfCUToModule::WarningReporter { -@@ -123,8 +122,7 @@ class CUFixtureBase { - uint64_t string_section_length, - const uint8_t* line_string_section, - uint64_t line_string_section_length, -- Module *module, vector* lines, -- std::map* files) { -+ Module *module, vector* lines) { - lines->insert(lines->end(), lines_->begin(), lines_->end()); - } - private: -@@ -157,7 +155,7 @@ class CUFixtureBase { - // By default, expect the line program reader not to be invoked. We - // may override this in StartCU. - EXPECT_CALL(line_reader_, StartCompilationUnit(_)).Times(0); -- EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_,_,_,_,_,_)).Times(0); -+ EXPECT_CALL(line_reader_, ReadProgram(_,_,_,_,_,_,_,_)).Times(0); - - // The handler will consult this section map to decide what to - // pass to our line reader. -@@ -343,7 +341,7 @@ void CUFixtureBase::StartCU() { - EXPECT_CALL(line_reader_, - ReadProgram(&dummy_line_program_[0], dummy_line_size_, - _,_,_,_, -- &module_, _,_)) -+ &module_, _)) - .Times(AtMost(1)) - .WillOnce(DoAll(Invoke(appender_), Return())); - ASSERT_TRUE(root_handler_ -@@ -1519,7 +1517,7 @@ TEST_F(Specifications, InterCU) { - DwarfCUToModule::FileContext fc("dwarf-filename", &m, true); - EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return()); - MockLineToModuleHandler lr; -- EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_,_)).Times(0); -+ EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_)).Times(0); - - // Kludge: satisfy reporter_'s expectation. - reporter_.SetCUName("compilation-unit-name"); -@@ -1578,7 +1576,7 @@ TEST_F(Specifications, UnhandledInterCU) { - DwarfCUToModule::FileContext fc("dwarf-filename", &m, false); - EXPECT_CALL(reporter_, UncoveredFunction(_)).WillOnce(Return()); - MockLineToModuleHandler lr; -- EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_,_)).Times(0); -+ EXPECT_CALL(lr, ReadProgram(_,_,_,_,_,_,_,_)).Times(0); - - // Kludge: satisfy reporter_'s expectation. - reporter_.SetCUName("compilation-unit-name"); -diff --git a/src/common/dwarf_line_to_module.cc b/src/common/dwarf_line_to_module.cc -index 83bb8f1554f31030e6ca8c08d3e1173fbb431d95..fe808c0865e706e279c5d3bea5b317fc15d23298 100644 ---- a/src/common/dwarf_line_to_module.cc -+++ b/src/common/dwarf_line_to_module.cc -@@ -100,7 +100,7 @@ void DwarfLineToModule::DefineFile(const string& name, int32_t file_num, - - // Find a Module::File object of the given name, and add it to the - // file table. -- (*files_)[file_num] = module_->FindFile(full_name); -+ files_[file_num] = module_->FindFile(full_name); - } - - void DwarfLineToModule::AddLine(uint64_t address, uint64_t length, -@@ -122,7 +122,7 @@ void DwarfLineToModule::AddLine(uint64_t address, uint64_t length, - } - - // Find the source file being referred to. -- Module::File *file = (*files_)[file_num]; -+ Module::File *file = files_[file_num]; - if (!file) { - if (!warned_bad_file_number_) { - fprintf(stderr, "warning: DWARF line number data refers to " -diff --git a/src/common/dwarf_line_to_module.h b/src/common/dwarf_line_to_module.h -index da2c5f0ec51688165ffabd67d192be68006c84ae..496a7006d06afbe501c554d82477ba33287c97a5 100644 ---- a/src/common/dwarf_line_to_module.h -+++ b/src/common/dwarf_line_to_module.h -@@ -120,19 +120,16 @@ class DwarfLineToModule: public LineInfoHandler { - // end of the address space, we clip it. It's up to our client to - // sort out which lines belong to which functions; we don't add them - // to any particular function in MODULE ourselves. -- DwarfLineToModule(Module* module, -- const string& compilation_dir, -- vector* lines, -- std::map* files) -+ DwarfLineToModule(Module *module, const string& compilation_dir, -+ vector* lines) - : module_(module), - compilation_dir_(compilation_dir), - lines_(lines), -- files_(files), - highest_file_number_(-1), - omitted_line_end_(0), - warned_bad_file_number_(false), - warned_bad_directory_number_(false) { } -- -+ // empty line - ~DwarfLineToModule() { } - - void DefineDir(const string& name, uint32_t dir_num); -@@ -170,12 +167,12 @@ class DwarfLineToModule: public LineInfoHandler { - DirectoryTable directories_; - - // A table mapping file numbers to Module::File pointers. -- FileTable* files_; -+ FileTable files_; - - // The highest file number we've seen so far, or -1 if we've seen - // none. Used for dynamically defined file numbers. - int32_t highest_file_number_; -- -+ // empty line - // This is the ending address of the last line we omitted, or zero if we - // didn't omit the previous line. It is zero before we have received any - // AddLine calls. -diff --git a/src/common/dwarf_line_to_module_unittest.cc b/src/common/dwarf_line_to_module_unittest.cc -index 34cb02ed486e33c8b45685529a29c7666e0ed319..90b6570d8ddebb2f6caf384e7b23901cfa616b2b 100644 ---- a/src/common/dwarf_line_to_module_unittest.cc -+++ b/src/common/dwarf_line_to_module_unittest.cc -@@ -45,8 +45,7 @@ using google_breakpad::Module; - TEST(SimpleModule, One) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("file1", 0x30bf0f27, 0, 0, 0); - h.AddLine(0x6fd126fbf74f2680LL, 0x63c9a14cf556712bLL, 0x30bf0f27, -@@ -67,8 +66,7 @@ TEST(SimpleModule, One) { - TEST(SimpleModule, Many) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("directory1", 0x838299ab); - h.DefineDir("directory2", 0xf85de023); -@@ -128,8 +126,7 @@ TEST(SimpleModule, Many) { - TEST(Filenames, Absolute) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("directory1", 1); - h.DefineFile("/absolute", 1, 1, 0, 0); -@@ -147,8 +144,7 @@ TEST(Filenames, Absolute) { - TEST(Filenames, Relative) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("directory1", 1); - h.DefineFile("relative", 1, 1, 0, 0); -@@ -166,8 +162,7 @@ TEST(Filenames, Relative) { - TEST(Filenames, StrangeFile) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("directory1", 1); - h.DefineFile("", 1, 1, 0, 0); -@@ -180,8 +175,7 @@ TEST(Filenames, StrangeFile) { - TEST(Filenames, StrangeDirectory) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("", 1); - h.DefineFile("file1", 1, 1, 0, 0); -@@ -194,8 +188,7 @@ TEST(Filenames, StrangeDirectory) { - TEST(Filenames, StrangeDirectoryAndFile) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("", 1); - h.DefineFile("", 1, 1, 0, 0); -@@ -210,8 +203,7 @@ TEST(Filenames, StrangeDirectoryAndFile) { - TEST(Filenames, DirectoryZeroFileIsRelativeToCompilationDir) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "src/build", &lines, &cu_files); -+ DwarfLineToModule h(&m, "src/build", &lines); - - h.DefineDir("Dir", 1); - h.DefineFile("File", 1, 0, 0, 0); -@@ -227,8 +219,7 @@ TEST(Filenames, DirectoryZeroFileIsRelativeToCompilationDir) { - TEST(Filenames, IncludeDirectoryRelativeToDirectoryZero) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "src/build", &lines, &cu_files); -+ DwarfLineToModule h(&m, "src/build", &lines); - - h.DefineDir("Dir", 1); - h.DefineFile("File", 1, 1, 0, 0); -@@ -244,8 +235,7 @@ TEST(Filenames, IncludeDirectoryRelativeToDirectoryZero) { - TEST(Filenames, IncludeDirectoryAbsolute) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "src/build", &lines, &cu_files); -+ DwarfLineToModule h(&m, "src/build", &lines); - - h.DefineDir("/Dir", 1); - h.DefineFile("File", 1, 1, 0, 0); -@@ -261,8 +251,7 @@ TEST(Filenames, IncludeDirectoryAbsolute) { - TEST(ModuleErrors, DirectoryZero) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("directory0", 0); // should be ignored - h.DefineFile("relative", 1, 0, 0, 0); -@@ -278,8 +267,7 @@ TEST(ModuleErrors, DirectoryZero) { - TEST(ModuleErrors, BadFileNumber) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("relative", 1, 0, 0, 0); - h.AddLine(1, 1, 2, 0, 0); // bad file number -@@ -293,8 +281,7 @@ TEST(ModuleErrors, BadFileNumber) { - TEST(ModuleErrors, BadDirectoryNumber) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineDir("directory1", 1); - h.DefineFile("baddirnumber1", 1, 2, 0, 0); // bad directory number -@@ -309,8 +296,7 @@ TEST(ModuleErrors, BadDirectoryNumber) { - TEST(ModuleErrors, EmptyLine) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("filename1", 1, 0, 0, 0); - h.AddLine(1, 0, 1, 0, 0); -@@ -323,8 +309,7 @@ TEST(ModuleErrors, EmptyLine) { - TEST(ModuleErrors, BigLine) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("filename1", 1, 0, 0, 0); - h.AddLine(0xffffffffffffffffULL, 2, 1, 0, 0); -@@ -341,8 +326,7 @@ TEST(ModuleErrors, BigLine) { - TEST(Omitted, DroppedThenGood) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("filename1", 1, 0, 0, 0); - h.AddLine(0, 10, 1, 83816211, 0); // should be omitted -@@ -355,8 +339,7 @@ TEST(Omitted, DroppedThenGood) { - TEST(Omitted, GoodThenDropped) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("filename1", 1, 0, 0, 0); - h.AddLine(0x9dd6a372, 10, 1, 41454594, 0); // should be recorded -@@ -369,8 +352,7 @@ TEST(Omitted, GoodThenDropped) { - TEST(Omitted, Mix1) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("filename1", 1, 0, 0, 0); - h.AddLine(0x679ed72f, 10, 1, 58932642, 0); // should be recorded -@@ -391,8 +373,7 @@ TEST(Omitted, Mix1) { - TEST(Omitted, Mix2) { - Module m("name", "os", "architecture", "id"); - vector lines; -- std::map cu_files; -- DwarfLineToModule h(&m, "/", &lines, &cu_files); -+ DwarfLineToModule h(&m, "/", &lines); - - h.DefineFile("filename1", 1, 0, 0, 0); - h.AddLine(0, 0xf2, 1, 58802211, 0); // should be omitted -diff --git a/src/common/linux/dump_symbols.cc b/src/common/linux/dump_symbols.cc -index 92a260baf3187db55043eb8c3f3fb36d13276cdd..5909d6ba1f9840a5f649e8530b9a97d4c9380c50 100644 ---- a/src/common/linux/dump_symbols.cc -+++ b/src/common/linux/dump_symbols.cc -@@ -260,16 +260,13 @@ class DumperLineToModule: public DwarfCUToModule::LineToModuleHandler { - void StartCompilationUnit(const string& compilation_dir) { - compilation_dir_ = compilation_dir; - } -- void ReadProgram(const uint8_t* program, -- uint64_t length, -+ void ReadProgram(const uint8_t* program, uint64_t length, - const uint8_t* string_section, - uint64_t string_section_length, - const uint8_t* line_string_section, - uint64_t line_string_section_length, -- Module* module, -- std::vector* lines, -- std::map* files) { -- DwarfLineToModule handler(module, compilation_dir_, lines, files); -+ Module* module, std::vector* lines) { -+ DwarfLineToModule handler(module, compilation_dir_, lines); - google_breakpad::LineInfo parser(program, length, byte_reader_, - string_section, string_section_length, - line_string_section, -diff --git a/src/common/mac/dump_syms.cc b/src/common/mac/dump_syms.cc -index 3592e4bb1afee19979054ff1551563520174594b..e30d8ea952c76f59028763dbc823e08575267c3c 100644 ---- a/src/common/mac/dump_syms.cc -+++ b/src/common/mac/dump_syms.cc -@@ -351,18 +351,15 @@ class DumpSymbols::DumperLineToModule: - compilation_dir_ = compilation_dir; - } - -- void ReadProgram(const uint8_t* program, -- uint64_t length, -+ void ReadProgram(const uint8_t* program, uint64_t length, - const uint8_t* string_section, - uint64_t string_section_length, - const uint8_t* line_string_section, - uint64_t line_string_section_length, -- Module* module, -- vector* lines, -- std::map* files) { -- DwarfLineToModule handler(module, compilation_dir_, lines, files); -- LineInfo parser(program, length, byte_reader_, nullptr, 0, -- nullptr, 0, &handler); -+ Module* module, vector* lines) { -+ DwarfLineToModule handler(module, compilation_dir_, lines); -+ LineInfo parser(program, length, byte_reader_, -+ nullptr, 0, nullptr, 0, &handler); - parser.Start(); - } - private: -diff --git a/src/common/module.cc b/src/common/module.cc -index eccd01f0957eaf623dcf417fffe379cbfa76322c..0ecf6ca6eb8611e0a06d3631fd76b9f73957c6b6 100644 ---- a/src/common/module.cc -+++ b/src/common/module.cc -@@ -38,16 +38,14 @@ - #include - #include - --#include - #include --#include - #include - - namespace google_breakpad { - - using std::dec; - using std::hex; --using std::unique_ptr; -+ - - Module::Module(const string& name, const string& os, - const string& architecture, const string& id, -@@ -216,13 +214,6 @@ void Module::AssignSourceIds() { - line_it != func->lines.end(); ++line_it) - line_it->file->source_id = 0; - } -- // Also mark all files cited by inline functions by setting each one's source -- // id to zero. -- for (InlineOrigin* origin : inline_origins_) -- // There are some artificial inline functions which don't belong to -- // any file. Those will have file id -1. -- if (origin->file) -- origin->file->source_id = 0; - - // Finally, assign source ids to those files that have been marked. - // We could have just assigned source id numbers while traversing -@@ -236,33 +227,6 @@ void Module::AssignSourceIds() { - } - } - --static void InlineDFS( -- vector>& inlines, -- std::function&)> const& forEach) { -- for (unique_ptr& in : inlines) { -- forEach(in); -- InlineDFS(in->child_inlines, forEach); -- } --} -- --void Module::CreateInlineOrigins() { -- // Only add origins that have file and deduplicate origins with same name and -- // file id by doing a DFS. -- auto addInlineOrigins = [&](unique_ptr &in) { -- auto it = inline_origins_.find(in->origin); -- if (it == inline_origins_.end()) -- inline_origins_.insert(in->origin); -- else -- in->origin = *it; -- }; -- for (Function* func : functions_) -- InlineDFS(func->inlines, addInlineOrigins); -- int next_id = 0; -- for (InlineOrigin* origin: inline_origins_) { -- origin->id = next_id++; -- } --} -- - bool Module::ReportError() { - fprintf(stderr, "error writing symbol file: %s\n", - strerror(errno)); -@@ -303,8 +267,6 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { - } - - if (symbol_data & SYMBOLS_AND_FILES) { -- if (symbol_data & INLINES) -- CreateInlineOrigins(); - AssignSourceIds(); - - // Write out files. -@@ -317,17 +279,8 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { - return ReportError(); - } - } -- // Write out inline origins. -- if (symbol_data & INLINES) { -- for (InlineOrigin* origin : inline_origins_) { -- stream << "INLINE_ORIGIN " << origin->id << " " << origin->getFileID() -- << " " << origin->name << "\n"; -- if (!stream.good()) -- return ReportError(); -- } -- } - -- // Write out functions and their inlines and lines. -+ // Write out functions and their lines. - for (FunctionSet::const_iterator func_it = functions_.begin(); - func_it != functions_.end(); ++func_it) { - Function* func = *func_it; -@@ -343,21 +296,6 @@ bool Module::Write(std::ostream& stream, SymbolData symbol_data) { - if (!stream.good()) - return ReportError(); - -- // Write out inlines. -- if (symbol_data & INLINES) { -- auto write_inline = [&](unique_ptr& in) { -- stream << "INLINE "; -- stream << in->inline_nest_level << " " << in->call_site_line << " " -- << in->origin->id << hex; -- for (const Range& r : in->ranges) -- stream << " " << (r.address - load_address_) << " " << r.size; -- stream << dec << "\n"; -- }; -- InlineDFS(func->inlines, write_inline); -- if (!stream.good()) -- return ReportError(); -- } -- - while ((line_it != func->lines.end()) && - (line_it->address >= range_it->address) && - (line_it->address < (range_it->address + range_it->size))) { -diff --git a/src/common/module.h b/src/common/module.h -index e8678914ff962e35ca3fb35febd7283813762603..f2fff4909a28ad52542f1c7ea95881849e039478 100644 ---- a/src/common/module.h -+++ b/src/common/module.h -@@ -41,7 +41,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -67,8 +66,6 @@ class Module { - static constexpr uint64_t kMaxAddress = std::numeric_limits
::max(); - struct File; - struct Function; -- struct InlineOrigin; -- struct Inline; - struct Line; - struct Extern; - -@@ -123,50 +120,6 @@ class Module { - // Source lines belonging to this function, sorted by increasing - // address. - vector lines; -- -- // Inlined call sites belonging to this functions. -- vector> inlines; -- }; -- -- struct InlineOrigin { -- InlineOrigin(const string& name): id(-1), name(name), file(NULL) {} -- -- // A unique id for each InlineOrigin object. INLINE records use the id to -- // refer to its INLINE_ORIGIN record. -- int id; -- -- // The inlined function's name. -- string name; -- -- File* file; -- -- int getFileID() const { return file ? file->source_id : -1; } -- }; -- -- // A inlined call site. -- struct Inline { -- Inline(InlineOrigin* origin, -- const vector& ranges, -- int call_site_line, -- int inline_nest_level, -- vector> child_inlines) -- : origin(origin), -- ranges(ranges), -- call_site_line(call_site_line), -- inline_nest_level(inline_nest_level), -- child_inlines(std::move(child_inlines)) {} -- -- InlineOrigin* origin; -- -- // The list of addresses and sizes. -- vector ranges; -- -- int call_site_line; -- -- int inline_nest_level; -- -- // A list of inlines which are children of this inline. -- vector> child_inlines; - }; - - // A source line. -@@ -226,14 +179,6 @@ class Module { - } - }; - -- struct InlineOriginCompare { -- bool operator() (const InlineOrigin* lhs, const InlineOrigin* rhs) const { -- if (lhs->getFileID() == rhs->getFileID()) -- return lhs->name < rhs->name; -- return lhs->getFileID() < rhs->getFileID(); -- } -- }; -- - struct ExternCompare { - bool operator() (const Extern* lhs, const Extern* rhs) const { - return lhs->address < rhs->address; -@@ -330,10 +275,6 @@ class Module { - // symbol file, at which point we omit any unused files. - void AssignSourceIds(); - -- // This function should be called before AssignSourceIds() to get the set of -- // valid InlineOrigins*. -- void CreateInlineOrigins(); -- - // Call AssignSourceIds, and write this module to STREAM in the - // breakpad symbol format. Return true if all goes well, or false if - // an error occurs. This method writes out: -@@ -393,9 +334,6 @@ class Module { - // A set containing Function structures, sorted by address. - typedef set FunctionSet; - -- // A set containing Function structures, sorted by address. -- typedef set InlineOriginSet; -- - // A set containing Extern structures, sorted by address. - typedef set ExternSet; - -@@ -404,7 +342,6 @@ class Module { - // point to. - FileByNameMap files_; // This module's source files. - FunctionSet functions_; // This module's functions. -- InlineOriginSet inline_origins_; // This module's inline origins. - - // The module owns all the call frame info entries that have been - // added to it. -diff --git a/src/tools/linux/dump_syms/dump_syms.cc b/src/tools/linux/dump_syms/dump_syms.cc -index b0f56e958960534e43febb001d23b11205640507..a562bffbfbf33a587d46824506a915b03abbe59d 100644 ---- a/src/tools/linux/dump_syms/dump_syms.cc -+++ b/src/tools/linux/dump_syms/dump_syms.cc -@@ -50,7 +50,6 @@ int usage(const char* self) { - fprintf(stderr, "Options:\n"); - fprintf(stderr, " -i: Output module header information only.\n"); - fprintf(stderr, " -c Do not generate CFI section\n"); -- fprintf(stderr, " -d Generate INLINE/INLINE_ORIGIN records\n"); - fprintf(stderr, " -r Do not handle inter-compilation " - "unit references\n"); - fprintf(stderr, " -v Print all warnings to stderr\n"); -@@ -65,7 +64,6 @@ int main(int argc, char** argv) { - return usage(argv[0]); - bool header_only = false; - bool cfi = true; -- bool handle_inlines = false; - bool handle_inter_cu_refs = true; - bool log_to_stderr = false; - std::string obj_name; -@@ -77,8 +75,6 @@ int main(int argc, char** argv) { - header_only = true; - } else if (strcmp("-c", argv[arg_index]) == 0) { - cfi = false; -- } else if (strcmp("-d", argv[arg_index]) == 0) { -- handle_inlines = true; - } else if (strcmp("-r", argv[arg_index]) == 0) { - handle_inter_cu_refs = false; - } else if (strcmp("-v", argv[arg_index]) == 0) { -@@ -131,8 +127,8 @@ int main(int argc, char** argv) { - return 1; - } - } else { -- SymbolData symbol_data = (handle_inlines ? INLINES : NO_DATA) | -- (cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; -+ SymbolData symbol_data = -+ INLINES | (cfi ? CFI : NO_DATA) | SYMBOLS_AND_FILES; - google_breakpad::DumpOptions options(symbol_data, handle_inter_cu_refs); - if (!WriteSymbolFile(binary, obj_name, obj_os, debug_dirs, options, - std::cout)) { diff --git a/patches/breakpad/revert_remove_warning_about_unknown_abstract_origin.patch b/patches/breakpad/revert_remove_warning_about_unknown_abstract_origin.patch deleted file mode 100644 index 1cc0307a1740..000000000000 --- a/patches/breakpad/revert_remove_warning_about_unknown_abstract_origin.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Samuel Attard -Date: Thu, 2 Sep 2021 22:55:25 +0000 -Subject: Revert "Remove warning about unknown abstract origin" - -This reverts commit 7933ec0a69bac134b7cee4b60a5dc80743b2b1a9. - -diff --git a/src/common/dwarf_cu_to_module.cc b/src/common/dwarf_cu_to_module.cc -index dacc9cbe4b0e13d19b5969fe91ba7a867e64a36c..c51514b7575c2e961aaae3ff883be00d80e3ec15 100644 ---- a/src/common/dwarf_cu_to_module.cc -+++ b/src/common/dwarf_cu_to_module.cc -@@ -504,6 +504,8 @@ void DwarfCUToModule::GenericDIEHandler::ProcessAttributeReference( - abstract_origin_ = &(origin->second); - } else if (data > offset_) { - forward_ref_die_offset_ = data; -+ } else { -+ cu_context_->reporter->UnknownAbstractOrigin(offset_, data); - } - specification_offset_ = data; - break; -@@ -748,6 +750,14 @@ void DwarfCUToModule::InlineHandler::Finish() { - } - } - -+ // Malformed DWARF may omit the name, but all Module::Functions must -+ // have names. -+ // If we have a forward reference to a DW_AT_specification or -+ // DW_AT_abstract_origin, then don't warn, the name will be fixed up -+ // later -+ if (name_.empty() && forward_ref_die_offset_ == 0) -+ cu_context_->reporter->UnnamedFunction(offset_); -+ - // Every DW_TAG_inlined_subroutine should have a DW_AT_abstract_origin. - assert(specification_offset_ != 0); - -@@ -919,6 +929,11 @@ void DwarfCUToModule::FuncHandler::Finish() { - if (!name_.empty()) { - name = name_; - } else { -+ // If we have a forward reference to a DW_AT_specification or -+ // DW_AT_abstract_origin, then don't warn, the name will be fixed up -+ // later -+ if (forward_ref_die_offset_ == 0) -+ cu_context_->reporter->UnnamedFunction(offset_); - name = ""; - } - diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 7ae543d44b83..817f56dc9b0d 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -104,6 +104,5 @@ logging_win32_only_create_a_console_if_logging_to_stderr.patch fix_media_key_usage_with_globalshortcuts.patch feat_expose_raw_response_headers_from_urlloader.patch chore_do_not_use_chrome_windows_in_cryptotoken_webrequestsender.patch -fix_chrome_root_store_codegen_for_cross-compile_builds.patch process_singleton.patch fix_expose_decrementcapturercount_in_web_contents_impl.patch diff --git a/patches/chromium/add_didinstallconditionalfeatures.patch b/patches/chromium/add_didinstallconditionalfeatures.patch index 8a6debd1add1..8a9819adb68c 100644 --- a/patches/chromium/add_didinstallconditionalfeatures.patch +++ b/patches/chromium/add_didinstallconditionalfeatures.patch @@ -10,7 +10,7 @@ DidCreateScriptContext is called, not all JS APIs are available in the context, which can cause some preload scripts to trip. diff --git a/content/public/renderer/render_frame_observer.h b/content/public/renderer/render_frame_observer.h -index 794a89ded73c415403d0d590780869c8d8b4ae38..5eb76debe9804a5195747cb6b90707fd0a242ec6 100644 +index 808bbcb0a13bbf069b2354bf39aabcd6d316d514..20e4cbe56bdb8dca3883778b16b9c127aca34793 100644 --- a/content/public/renderer/render_frame_observer.h +++ b/content/public/renderer/render_frame_observer.h @@ -127,6 +127,8 @@ class CONTENT_EXPORT RenderFrameObserver : public IPC::Listener, @@ -23,10 +23,10 @@ index 794a89ded73c415403d0d590780869c8d8b4ae38..5eb76debe9804a5195747cb6b90707fd int32_t world_id) {} virtual void DidClearWindowObject() {} diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 173952d4545d59ecb1b99aa07b6c8f8bcd1b2e86..395bb615c0a2d5a49cfbc6d8a9e9f3d9a809b595 100644 +index 4560b2e363e7392467ff623691d3bd0302b5a502..ebf2d997f03c36e5242405002c7dce583aec31dc 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -4461,6 +4461,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, +@@ -4460,6 +4460,12 @@ void RenderFrameImpl::DidCreateScriptContext(v8::Local context, observer.DidCreateScriptContext(context, world_id); } @@ -40,10 +40,10 @@ index 173952d4545d59ecb1b99aa07b6c8f8bcd1b2e86..395bb615c0a2d5a49cfbc6d8a9e9f3d9 int world_id) { for (auto& observer : observers_) diff --git a/content/renderer/render_frame_impl.h b/content/renderer/render_frame_impl.h -index 4cd3901203e5399fb5a2855fca98e083fe0973d1..b11cb66d157023d36113f28399d57ff2b2f10abb 100644 +index 100e382cc73c1f107cd1b7e618b93e009a1f6c65..afebce99ebbcb28aff27d2d7044bb080ce9fd40e 100644 --- a/content/renderer/render_frame_impl.h +++ b/content/renderer/render_frame_impl.h -@@ -593,6 +593,8 @@ class CONTENT_EXPORT RenderFrameImpl +@@ -594,6 +594,8 @@ class CONTENT_EXPORT RenderFrameImpl blink::WebLocalFrameClient::LazyLoadBehavior lazy_load_behavior) override; void DidCreateScriptContext(v8::Local context, int world_id) override; @@ -123,10 +123,10 @@ index 57c9b6b733ebf5b9483d31959fbdccad8b72031c..13c7e6924a19717473379045ae1c1f0e int32_t world_id) override; diff --git a/third_party/blink/renderer/core/loader/empty_clients.h b/third_party/blink/renderer/core/loader/empty_clients.h -index 65356d0acdc5868cce8401ed88b90d75c6306f28..338ebba74360e09bfc93c5be943ab828d22b500b 100644 +index 0a4a0b8a4dc871dc86887774a6c81282ea98cda6..ab6ada68a78aa22e723080925d20cf14e8fe822a 100644 --- a/third_party/blink/renderer/core/loader/empty_clients.h +++ b/third_party/blink/renderer/core/loader/empty_clients.h -@@ -359,6 +359,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { +@@ -360,6 +360,8 @@ class CORE_EXPORT EmptyLocalFrameClient : public LocalFrameClient { void DidCreateScriptContext(v8::Local, int32_t world_id) override {} diff --git a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch index 50900cd0a86b..60938580d745 100644 --- a/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch +++ b/patches/chromium/allow_disabling_blink_scheduler_throttling_per_renderview.patch @@ -6,10 +6,10 @@ Subject: allow disabling blink scheduler throttling per RenderView This allows us to disable throttling for hidden windows. diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc -index e4f71e2ce9cf7cce68c0b2c336d6a7329a7cd564..30bd888e778d27c738eb67df2316db191a3c3066 100644 +index af75828e89e8cb1cca20c8acd64c9f864c0ffab7..182a6ebdf1ccad6b6ef7a2d45791bc0f5dc456f2 100644 --- a/content/browser/renderer_host/render_view_host_impl.cc +++ b/content/browser/renderer_host/render_view_host_impl.cc -@@ -616,6 +616,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { +@@ -627,6 +627,11 @@ void RenderViewHostImpl::SetBackgroundOpaque(bool opaque) { GetWidget()->GetAssociatedFrameWidget()->SetBackgroundOpaque(opaque); } @@ -22,10 +22,10 @@ index e4f71e2ce9cf7cce68c0b2c336d6a7329a7cd564..30bd888e778d27c738eb67df2316db19 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 b9a91d4cf22379408c296742f8ec66eb20c34f7e..f110151e555fc90f9ad863a43b6185c7481cf3b3 100644 +index b51bd8160bf63a75066d23514b727eb365a3918c..48413119621f6b118b80d681f777e74af8dc8ab7 100644 --- a/content/browser/renderer_host/render_view_host_impl.h +++ b/content/browser/renderer_host/render_view_host_impl.h -@@ -137,6 +137,7 @@ class CONTENT_EXPORT RenderViewHostImpl +@@ -135,6 +135,7 @@ class CONTENT_EXPORT RenderViewHostImpl bool IsRenderViewLive() override; void WriteIntoTrace(perfetto::TracedValue context) override; @@ -34,10 +34,10 @@ index b9a91d4cf22379408c296742f8ec66eb20c34f7e..f110151e555fc90f9ad863a43b6185c7 void SendRendererPreferencesToRenderer( const blink::RendererPreferences& preferences); diff --git a/content/public/browser/render_view_host.h b/content/public/browser/render_view_host.h -index 740d1c322b740d374dd0287d99daebc1fe39ceda..f6ed1402120c0d8b30356c87a52d88fe39ed08d9 100644 +index 8bb06dec16fbf205230a10e0e52daa787338bc23..9ebc42788391e838e78af75e2449dde4f1107f22 100644 --- a/content/public/browser/render_view_host.h +++ b/content/public/browser/render_view_host.h -@@ -90,6 +90,9 @@ class CONTENT_EXPORT RenderViewHost { +@@ -84,6 +84,9 @@ class CONTENT_EXPORT RenderViewHost { // Write a representation of this object into a trace. virtual void WriteIntoTrace(perfetto::TracedValue context) = 0; diff --git a/patches/chromium/blink_local_frame.patch b/patches/chromium/blink_local_frame.patch index 379e9c71bfc8..31966220a142 100644 --- a/patches/chromium/blink_local_frame.patch +++ b/patches/chromium/blink_local_frame.patch @@ -49,7 +49,7 @@ index 8bf6b4bc077cc41da5e0e6b13302bc343537c68f..01bddc0bcb7476408023c4cfc042a088 // its owning reference back to our owning LocalFrame. client_->Detached(type); diff --git a/third_party/blink/renderer/core/frame/local_frame.cc b/third_party/blink/renderer/core/frame/local_frame.cc -index cf505929c9f6eac724a22e5abcd362ed70aed710..b49500d62fb29f179ae802366108c84e2f891836 100644 +index be646cf80c0d3490979e3500821c5fc4351af2a7..dca161475f9e0cd86db8675faec3d375d94c490f 100644 --- a/third_party/blink/renderer/core/frame/local_frame.cc +++ b/third_party/blink/renderer/core/frame/local_frame.cc @@ -553,10 +553,6 @@ bool LocalFrame::DetachImpl(FrameDetachType type) { diff --git a/patches/chromium/build_add_electron_tracing_category.patch b/patches/chromium/build_add_electron_tracing_category.patch index fc0724439af5..e3f02f336039 100644 --- a/patches/chromium/build_add_electron_tracing_category.patch +++ b/patches/chromium/build_add_electron_tracing_category.patch @@ -8,7 +8,7 @@ categories in use are known / declared. This patch is required for us to introduce a new Electron category for Electron-specific tracing. diff --git a/base/trace_event/builtin_categories.h b/base/trace_event/builtin_categories.h -index efa8e6578dbdda31a9cfafe680d03c809617f84c..46affd2c438a5108440848943fb20efe070e6ed0 100644 +index 702ac1a5464635acb1064ca31f7ef211cc0b4a66..6adcf56ca83237d93cd289744b4eb29d7f9e39d6 100644 --- a/base/trace_event/builtin_categories.h +++ b/base/trace_event/builtin_categories.h @@ -77,6 +77,7 @@ diff --git a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch index ec6fa3004552..b0cec519ee8f 100644 --- a/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch +++ b/patches/chromium/build_do_not_depend_on_packed_resource_integrity.patch @@ -11,7 +11,7 @@ if we ever align our .pak file generation with Chrome we can remove this patch. diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn -index 897e473cbb4c3e8b244210706e4e1549b1e71a0c..cde17f7fee3851e96afc181c92121867c97a0f95 100644 +index abab9c8e8c60a6d1690acca5133b3c54d0ccc793..f4378acd7c92193c6e6ac2785cd8a670bd9c650c 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn @@ -165,11 +165,16 @@ if (!is_android && !is_mac) { @@ -33,10 +33,10 @@ index 897e473cbb4c3e8b244210706e4e1549b1e71a0c..cde17f7fee3851e96afc181c92121867 "//base", "//build:branding_buildflags", diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn -index 3acfeb5e5bf721fabe2339e389193cd9e154e293..9cdea4ca822f74cf7398d3f474bcc5ccfd43f829 100644 +index 27f4f83da31dbd3a1e754279e760dddf00224e1b..5cdcad53c32d7f25fe041344cb7441bdd6c524a5 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -4398,7 +4398,7 @@ static_library("browser") { +@@ -4415,7 +4415,7 @@ static_library("browser") { # On Windows, the hashes are embedded in //chrome:chrome_initial rather # than here in :chrome_dll. @@ -46,10 +46,10 @@ index 3acfeb5e5bf721fabe2339e389193cd9e154e293..9cdea4ca822f74cf7398d3f474bcc5cc } diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn -index f8eeccc044eebd0c7f1a845ff29c7e46acf83252..d81d15061a88a7e38d7ee46ca7b0f6fcbe994961 100644 +index a7e09cea9b71e810e08790d109e805a8119c0825..52f9f2b0d4e3ee7d3221f04f122f41e1429f6016 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn -@@ -5353,7 +5353,6 @@ test("unit_tests") { +@@ -5482,7 +5482,6 @@ test("unit_tests") { assert(toolkit_views) sources += [ "../browser/ui/startup/credential_provider_signin_info_fetcher_win_unittest.cc" ] deps += [ @@ -57,7 +57,7 @@ index f8eeccc044eebd0c7f1a845ff29c7e46acf83252..d81d15061a88a7e38d7ee46ca7b0f6fc "//chrome/browser:chrome_process_finder", "//chrome/browser/safe_browsing/chrome_cleaner", "//chrome/browser/safe_browsing/chrome_cleaner:public", -@@ -5366,6 +5365,12 @@ test("unit_tests") { +@@ -5495,6 +5494,12 @@ test("unit_tests") { "//components/chrome_cleaner/public/proto", "//ui/events/devices:test_support", ] @@ -70,7 +70,7 @@ index f8eeccc044eebd0c7f1a845ff29c7e46acf83252..d81d15061a88a7e38d7ee46ca7b0f6fc } # TODO(crbug.com/931218): Ninja cannot handle certain characters appearing -@@ -5953,7 +5958,6 @@ test("unit_tests") { +@@ -6088,7 +6093,6 @@ test("unit_tests") { } deps += [ @@ -78,7 +78,7 @@ index f8eeccc044eebd0c7f1a845ff29c7e46acf83252..d81d15061a88a7e38d7ee46ca7b0f6fc "//chrome/browser:cart_db_content_proto", "//chrome/browser/media/router:test_support", "//chrome/browser/resource_coordinator:intervention_policy_database_proto", -@@ -5989,6 +5993,9 @@ test("unit_tests") { +@@ -6124,6 +6128,9 @@ test("unit_tests") { "//ui/native_theme:test_support", "//ui/webui/resources/js/browser_command:mojo_bindings", ] diff --git a/patches/chromium/build_gn.patch b/patches/chromium/build_gn.patch index a41d724db3f2..ee78c116ae23 100644 --- a/patches/chromium/build_gn.patch +++ b/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 725894d05274355be4ad5d6ac3388a489220a50c..e568780d699a9ac977e509165b2e9b0516cde779 100644 +index 62e7e4bcd3e6c1ef49e3c929af7ac4634a1e6e2b..4edb4b27d985f6cd836832cde49346089ebe579e 100644 --- a/build/config/BUILDCONFIG.gn +++ b/build/config/BUILDCONFIG.gn @@ -123,6 +123,9 @@ if (current_os == "") { diff --git a/patches/chromium/can_create_window.patch b/patches/chromium/can_create_window.patch index 4f689cf61876..4c2a3c917302 100644 --- a/patches/chromium/can_create_window.patch +++ b/patches/chromium/can_create_window.patch @@ -9,10 +9,10 @@ potentially prevent a window from being created. TODO(loc): this patch is currently broken. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index befd11fbac2068e6ac303989528ee609263ae9b2..ea22c655ae4e5c1e023d68fbedb2a684edabe1fe 100644 +index 78eb422f2ac9c56f7a601f2e82a759817be23f82..1a62a9669484980a69d658ca6729e7caf3db96fb 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -6406,6 +6406,7 @@ void RenderFrameHostImpl::CreateNewWindow( +@@ -6533,6 +6533,7 @@ void RenderFrameHostImpl::CreateNewWindow( last_committed_origin_, params->window_container_type, params->target_url, params->referrer.To(), params->frame_name, params->disposition, *params->features, @@ -21,10 +21,10 @@ index befd11fbac2068e6ac303989528ee609263ae9b2..ea22c655ae4e5c1e023d68fbedb2a684 &no_javascript_access); diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index afee3ed1f21aa9b95e2dc48191445d0f18049bbb..0ba0990cf02624cc7cf1b304a0d9b63692cd464d 100644 +index b9aa5d69242727e1a01df7a0d00d592c58e3815a..5a86229bf1fc52e6cccbf609ed029fe88d35cd8f 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3739,6 +3739,14 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -3734,6 +3734,14 @@ FrameTree* WebContentsImpl::CreateNewWindow( } auto* new_contents_impl = new_contents.get(); @@ -39,7 +39,7 @@ index afee3ed1f21aa9b95e2dc48191445d0f18049bbb..0ba0990cf02624cc7cf1b304a0d9b636 new_contents_impl->GetController().SetSessionStorageNamespace( partition_id, session_storage_namespace); -@@ -3781,12 +3789,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -3776,12 +3784,6 @@ FrameTree* WebContentsImpl::CreateNewWindow( AddWebContentsDestructionObserver(new_contents_impl); } @@ -68,10 +68,10 @@ index 74ed9ae0eae10e77dace6905b5108a834b07f8b4..924d6b43d444ccb919d6985c975eb886 // 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 9f8dbbc7a63cf8a1a8166dd67efd452eab791426..8a45f8c39fe160829de316c513e73327dabfc391 100644 +index 0cf1f777dc5ffbca606fff558ef6a41e8ed60a99..40bd443cb3c82d9671c4716900a1f19b3c26de69 100644 --- a/content/public/browser/content_browser_client.cc +++ b/content/public/browser/content_browser_client.cc -@@ -557,6 +557,8 @@ bool ContentBrowserClient::CanCreateWindow( +@@ -555,6 +555,8 @@ bool ContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -81,10 +81,10 @@ index 9f8dbbc7a63cf8a1a8166dd67efd452eab791426..8a45f8c39fe160829de316c513e73327 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 4db050cb8e5e328f84d4a5fc92aee7d743ee16c4..bb30bb3604a793cbe37d20a3a18b21d5abfd6530 100644 +index b6dae0082a297a6dbafd63bd56729b77ffb832fc..66ff9593b8f3d62c486ef83c4c682edf73081d88 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h -@@ -166,6 +166,7 @@ class NetworkService; +@@ -167,6 +167,7 @@ class NetworkService; class TrustedURLLoaderHeaderClient; } // namespace mojom struct ResourceRequest; @@ -92,7 +92,7 @@ index 4db050cb8e5e328f84d4a5fc92aee7d743ee16c4..bb30bb3604a793cbe37d20a3a18b21d5 } // namespace network namespace sandbox { -@@ -924,6 +925,8 @@ class CONTENT_EXPORT ContentBrowserClient { +@@ -922,6 +923,8 @@ class CONTENT_EXPORT ContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -173,10 +173,10 @@ index ea22a86dc1a6e5cdb3e3dfa31a929a3dd14b9e61..215b059bb2dfcead6c709c99b39578f8 /*is_opener_navigation=*/false, request.HasUserGesture(), // `openee_can_access_opener_origin` only matters for opener navigations, diff --git a/content/web_test/browser/web_test_content_browser_client.cc b/content/web_test/browser/web_test_content_browser_client.cc -index c6872573086e628a894f482877db2d417552c6a1..5e67b6a59c3e3d6881f738985ab947a2d7902f0a 100644 +index 520b6f8146361cf8c00079c1cc0f5394f747d405..77f58cc157229eb01ce9a35aa5814f64d6e8f2f2 100644 --- a/content/web_test/browser/web_test_content_browser_client.cc +++ b/content/web_test/browser/web_test_content_browser_client.cc -@@ -450,6 +450,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( +@@ -438,6 +438,8 @@ bool WebTestContentBrowserClient::CanCreateWindow( const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -186,10 +186,10 @@ index c6872573086e628a894f482877db2d417552c6a1..5e67b6a59c3e3d6881f738985ab947a2 bool opener_suppressed, bool* no_javascript_access) { diff --git a/content/web_test/browser/web_test_content_browser_client.h b/content/web_test/browser/web_test_content_browser_client.h -index 427656a1a01a9305459a8f1d6616fd0666413b39..c8e296286cdd148348932d2bdfa4d064f8cbe36d 100644 +index 1580bd13ea123740dc7a8813680a8d2448d49969..5c0809733b366ecff02c5a4b77dac9530eb15fbf 100644 --- a/content/web_test/browser/web_test_content_browser_client.h +++ b/content/web_test/browser/web_test_content_browser_client.h -@@ -83,6 +83,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient { +@@ -80,6 +80,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient { const std::string& frame_name, WindowOpenDisposition disposition, const blink::mojom::WindowFeatures& features, @@ -220,10 +220,10 @@ index 84d32491a56528a84b4395fba1d54cdbb38d522b..09998a83c449ef8cd9f360fbcdcf7edc } // 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 10e40d408bb0b1526534918add49906e65d17368..b6a0473ad93f8ef1adc53536411e8fd62c106b5d 100644 +index 3915f0df47d5a2ae1a5f2909d2aa59192c0cc44b..ada26f26f2ac0fab4a2dc02a5b64c72614c06965 100644 --- a/third_party/blink/renderer/core/frame/local_dom_window.cc +++ b/third_party/blink/renderer/core/frame/local_dom_window.cc -@@ -2022,6 +2022,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, +@@ -2027,6 +2027,7 @@ DOMWindow* LocalDOMWindow::open(v8::Isolate* isolate, WebWindowFeatures window_features = GetWindowFeaturesFromString(features, incumbent_window); diff --git a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch index e20f2880d02f..f5657d311cce 100644 --- a/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch +++ b/patches/chromium/chore_provide_iswebcontentscreationoverridden_with_full_params.patch @@ -35,10 +35,10 @@ index 5b4d70991e19edcdfee731c56251932bf43e535f..fe1977c5e6ce0f5b30e8be529b9efa51 #endif // CHROME_BROWSER_ANDROID_DOCUMENT_DOCUMENT_WEB_CONTENTS_DELEGATE_H_ diff --git a/chrome/browser/media/offscreen_tab.cc b/chrome/browser/media/offscreen_tab.cc -index d6295d809381f4f4a86a9948762079232ba6c93c..ad429250984cf367e1194bda67bc56a886f650ae 100644 +index c0823105ecc86ce2e60ede44be29a14889dad887..bb0f2672c6e565657500e617b4eb416c0575dac7 100644 --- a/chrome/browser/media/offscreen_tab.cc +++ b/chrome/browser/media/offscreen_tab.cc -@@ -283,8 +283,7 @@ bool OffscreenTab::IsWebContentsCreationOverridden( +@@ -284,8 +284,7 @@ bool OffscreenTab::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -49,10 +49,10 @@ index d6295d809381f4f4a86a9948762079232ba6c93c..ad429250984cf367e1194bda67bc56a8 // uses this to spawn new windows/tabs, which is also not allowed for // offscreen tabs. diff --git a/chrome/browser/media/offscreen_tab.h b/chrome/browser/media/offscreen_tab.h -index 3fd38bcb861174f99369d0e53b9946c632baf21a..de1a4df623538cc2857f8bb85b05e17d411c45a0 100644 +index c80128b816cc77b95af215384fdc36b2150f95ea..3fe773e671d1c087eaf1303ca60883597c0c3907 100644 --- a/chrome/browser/media/offscreen_tab.h +++ b/chrome/browser/media/offscreen_tab.h -@@ -103,8 +103,7 @@ class OffscreenTab final : public ProfileObserver, +@@ -107,8 +107,7 @@ class OffscreenTab final : public ProfileObserver, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -94,10 +94,10 @@ index 07014765f33bdddebcc5bc32a2713d6523faf394..f866f69f9c810d89f1a0e9e4952293f6 content::WebContents* source, const content::OpenURLParams& params) override; diff --git a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc -index ef84e04d628fb5cdbaf8fbbf84af3bf23e00c522..f1ee0bee5bfd08227a29498f8410d5d3582e02c3 100644 +index ba376cca99e6b8b367c6a4cfc9925b940728b9fc..f1b831507d628d35cc65f697ffc832568fc28193 100644 --- a/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc +++ b/chrome/browser/ui/ash/keyboard/chrome_keyboard_web_contents.cc -@@ -66,8 +66,7 @@ class ChromeKeyboardContentsDelegate : public content::WebContentsDelegate, +@@ -72,8 +72,7 @@ class ChromeKeyboardContentsDelegate : public content::WebContentsDelegate, content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -108,10 +108,10 @@ index ef84e04d628fb5cdbaf8fbbf84af3bf23e00c522..f1ee0bee5bfd08227a29498f8410d5d3 } diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc -index 61724ab53609f80cf5a0139c8bdb2ad1fb0413b2..b8647710bf9a16e8ffc3ca3b25aa4f6c584fa9be 100644 +index c8d3c04475fe3ee60ec4671ee47c18aa78840dd1..e5d95132b4f20f17f328e41cf6d0cf839787222a 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc -@@ -1789,12 +1789,11 @@ bool Browser::IsWebContentsCreationOverridden( +@@ -1790,12 +1790,11 @@ bool Browser::IsWebContentsCreationOverridden( content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -155,10 +155,10 @@ index ff97ac6e97c688d677053a5f01546a4c2d91ff1d..1da6a9c32b883a17975e61d603639182 // uses this to spawn new windows/tabs, which is also not allowed for // local presentations. diff --git a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h -index 058ec72442d59989c4d6df4a7c791ecfeff0ef99..f7c8c2139382cb2e290c561624291afe647383cf 100644 +index 45cd02ecf7b7acb107f95656b3fa07a5fca2ea95..b06ca2dbdd0c21554802ab3b99576b381d0e4ddb 100644 --- a/chrome/browser/ui/media_router/presentation_receiver_window_controller.h +++ b/chrome/browser/ui/media_router/presentation_receiver_window_controller.h -@@ -99,8 +99,7 @@ class PresentationReceiverWindowController final +@@ -104,8 +104,7 @@ class PresentationReceiverWindowController final content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, @@ -232,10 +232,10 @@ index c5c5a7b63b5b3b62a9517cbef3ae23ce57a3c89c..4f1b7e88d6d2ae89a60311c8aeb1fcee void AddNewContents(content::WebContents* source, std::unique_ptr new_contents, diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index bc84aa5826d4ca8aef8f496acd3569152007b7a8..b6524566b96a141ba710441ab70d17f46e5b1b9a 100644 +index ad1b4abe0390215e007ad2db8d972661470e94ed..d3593a6f3e9f6cba5823169d36fd93a6f97608ae 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -3687,8 +3687,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( +@@ -3682,8 +3682,7 @@ FrameTree* WebContentsImpl::CreateNewWindow( if (delegate_ && delegate_->IsWebContentsCreationOverridden( source_site_instance, params.window_container_type, @@ -316,10 +316,10 @@ index b794ee4204fb8eaf90084e762f80988af13609b4..ac4e00f2ef1d2a722851d88531c28e65 } diff --git a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -index bb90319f768ed2f3a3e530d64bf622de585ce163..d84de1d218267887f6b8624f913438ebc4aa7a79 100644 +index 647a9bdf39c60f61cf3c9520bc7e57e206678cd0..59860dc143467168e2ce596f26c84ed8a26be6ed 100644 --- a/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h +++ b/extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest.h -@@ -158,8 +158,7 @@ class MimeHandlerViewGuest +@@ -167,8 +167,7 @@ class MimeHandlerViewGuest content::SiteInstance* source_site_instance, content::mojom::WindowContainerType window_container_type, const GURL& opener_url, diff --git a/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch b/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch index f153e95542c0..4caafe3dae6e 100644 --- a/patches/chromium/chore_use_electron_resources_not_chrome_for_spellchecker.patch +++ b/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 8847ed67e305d746c671afb49b445afaf24b85b3..3acfeb5e5bf721fabe2339e389193cd9e154e293 100644 +index 7f050d074a057b9226444432625e3df856c5d1d8..27f4f83da31dbd3a1e754279e760dddf00224e1b 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn -@@ -6689,6 +6689,7 @@ static_library("browser") { +@@ -6736,6 +6736,7 @@ static_library("browser") { deps += [ "//components/spellcheck/browser", "//components/spellcheck/common", @@ -32,7 +32,7 @@ index 2b7aa1add57dccbcbf8202cead5b7d2d5a174270..2ba03fc045f2e4bb12f173aacb6581cc #include "components/pref_registry/pref_registry_syncable.h" #include "components/prefs/pref_service.h" diff --git a/components/language/core/browser/BUILD.gn b/components/language/core/browser/BUILD.gn -index 1ece01a38683e81fdf07ec475c2bf1bf19fab891..668789ca5c0b3b6381313dbb4cccf119b80e9b66 100644 +index e2f54334ed199b0cb4658c1b1c956dd8bc8b2bf0..0241849170f6d589d011c28127abfd9bc830e5e5 100644 --- a/components/language/core/browser/BUILD.gn +++ b/components/language/core/browser/BUILD.gn @@ -28,6 +28,7 @@ static_library("browser") { diff --git a/patches/chromium/command-ismediakey.patch b/patches/chromium/command-ismediakey.patch index 06dcbac7d5d7..db5a310f7d43 100644 --- a/patches/chromium/command-ismediakey.patch +++ b/patches/chromium/command-ismediakey.patch @@ -52,10 +52,10 @@ index d6d896b87bb327bd7387335bd5bbac4616316f1e..ec0293ba8b66df5c9a34435cb2a0c9a3 NotifyKeyPressed(ui::Accelerator(key_code, modifiers)); } diff --git a/chrome/browser/extensions/global_shortcut_listener_ozone.h b/chrome/browser/extensions/global_shortcut_listener_ozone.h -index 27655641551afe9763cd76afe366f04e56efbbc6..14ff891a057464a1bd570cb14e127ce865d9ba91 100644 +index 866c4e6c1ff8c1a2399d943837fce1753c8ea1a5..ecde46fe5f8c5f250a7cb505c86ae59cfa1bd623 100644 --- a/chrome/browser/extensions/global_shortcut_listener_ozone.h +++ b/chrome/browser/extensions/global_shortcut_listener_ozone.h -@@ -41,7 +41,8 @@ class GlobalShortcutListenerOzone +@@ -46,7 +46,8 @@ class GlobalShortcutListenerOzone void OnKeyPressed(ui::KeyboardCode key_code, bool is_alt_down, bool is_ctrl_down, diff --git a/patches/chromium/crash_allow_setting_more_options.patch b/patches/chromium/crash_allow_setting_more_options.patch index e531afa4335a..821638acb48a 100644 --- a/patches/chromium/crash_allow_setting_more_options.patch +++ b/patches/chromium/crash_allow_setting_more_options.patch @@ -75,10 +75,10 @@ index 39557cce474439238255ecd28030215085db0c81..5b3f980837911c710686ab91a2a81c31 // Used by WebView to sample crashes without generating the unwanted dumps. If // the returned value is less than 100, crash dumping will be sampled to that diff --git a/components/crash/core/app/crashpad_linux.cc b/components/crash/core/app/crashpad_linux.cc -index 1abde7faf44a4526d7c622e6ce2d6fafe957a4c8..68d745567c1a0e37fa4ebc9e7e705d2a24f3e1fe 100644 +index 99e5ee6eeadb9ff12b7b027ceba4c838a8fedc6d..838ccd82b5828c1c58b3089064b7baeb35982f7e 100644 --- a/components/crash/core/app/crashpad_linux.cc +++ b/components/crash/core/app/crashpad_linux.cc -@@ -165,6 +165,7 @@ base::FilePath PlatformCrashpadInitialization( +@@ -178,6 +178,7 @@ base::FilePath PlatformCrashpadInitialization( // where crash_reporter provides it's own values for lsb-release. annotations["lsb-release"] = base::GetLinuxDistro(); #endif @@ -86,7 +86,7 @@ index 1abde7faf44a4526d7c622e6ce2d6fafe957a4c8..68d745567c1a0e37fa4ebc9e7e705d2a std::vector arguments; if (crash_reporter_client->ShouldMonitorCrashHandlerExpensively()) { -@@ -186,6 +187,13 @@ base::FilePath PlatformCrashpadInitialization( +@@ -199,6 +200,13 @@ base::FilePath PlatformCrashpadInitialization( } #endif diff --git a/patches/chromium/delay_lock_the_protocol_scheme_registry.patch b/patches/chromium/delay_lock_the_protocol_scheme_registry.patch index 5a9221c4e9dd..8459ba4a71d7 100644 --- a/patches/chromium/delay_lock_the_protocol_scheme_registry.patch +++ b/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 7e7a16e6f9cb187a834ecc44b27f288c9146b6a6..a2aca80f9a95c345e6d394b78d3341534fd0450f 100644 +index 29fd158813a0d4ecd5f7cb41cd2c9a6bf8a29f6c..b3f2e64cb729f43faeb0e3af39ca5469d77fb503 100644 --- a/content/app/content_main_runner_impl.cc +++ b/content/app/content_main_runner_impl.cc -@@ -751,7 +751,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { +@@ -752,7 +752,7 @@ int ContentMainRunnerImpl::Initialize(const ContentMainParams& params) { } #endif diff --git a/patches/chromium/desktop_media_list.patch b/patches/chromium/desktop_media_list.patch index a62388ee5958..931b181e4df7 100644 --- a/patches/chromium/desktop_media_list.patch +++ b/patches/chromium/desktop_media_list.patch @@ -38,10 +38,10 @@ index a3e1de40e843b5450f417a0455e0e7d7dee1d1bd..63befdc162a4b4a16e8c5099abb0f5af int DesktopMediaListBase::GetSourceCount() const { diff --git a/chrome/browser/media/webrtc/desktop_media_list_base.h b/chrome/browser/media/webrtc/desktop_media_list_base.h -index a1038183d5b44ca760576bff55534b5841e2e9d2..e9cc308271c561b249ace7dc9e703b549fcfbbd2 100644 +index c87535950fdc6cf1c5641835a69971d0e1654025..a6151407ae3ac3456d0af07330db3d1ae82bd6a9 100644 --- a/chrome/browser/media/webrtc/desktop_media_list_base.h +++ b/chrome/browser/media/webrtc/desktop_media_list_base.h -@@ -31,7 +31,7 @@ class DesktopMediaListBase : public DesktopMediaList { +@@ -35,7 +35,7 @@ class DesktopMediaListBase : public DesktopMediaList { void SetThumbnailSize(const gfx::Size& thumbnail_size) override; void SetViewDialogWindowId(content::DesktopMediaID dialog_id) override; void StartUpdating(DesktopMediaListObserver* observer) override; @@ -51,7 +51,7 @@ index a1038183d5b44ca760576bff55534b5841e2e9d2..e9cc308271c561b249ace7dc9e703b54 const Source& GetSource(int index) const override; DesktopMediaList::Type GetMediaListType() const override; diff --git a/chrome/browser/media/webrtc/native_desktop_media_list.cc b/chrome/browser/media/webrtc/native_desktop_media_list.cc -index 5a851f4c89b4ed2b41640bf8bad47b7d8eba8ca1..2dc65acfc355180dc966aab76b39fc1956325b84 100644 +index 4c822ebcca602ecbd30fbc79d72a1ecabc273229..d9f45c280ce4f5771c379033d8034e68681e42f8 100644 --- a/chrome/browser/media/webrtc/native_desktop_media_list.cc +++ b/chrome/browser/media/webrtc/native_desktop_media_list.cc @@ -16,7 +16,7 @@ @@ -74,7 +74,7 @@ index 5a851f4c89b4ed2b41640bf8bad47b7d8eba8ca1..2dc65acfc355180dc966aab76b39fc19 #endif } // namespace -@@ -425,6 +426,8 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows( +@@ -427,6 +428,8 @@ void NativeDesktopMediaList::RefreshForVizFrameSinkWindows( FROM_HERE, base::BindOnce(&Worker::RefreshThumbnails, base::Unretained(worker_.get()), std::move(native_ids), thumbnail_size_)); diff --git a/patches/chromium/disable-redraw-lock.patch b/patches/chromium/disable-redraw-lock.patch index 599d5858f56f..f431e5db19e1 100644 --- a/patches/chromium/disable-redraw-lock.patch +++ b/patches/chromium/disable-redraw-lock.patch @@ -15,10 +15,10 @@ 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 21e96caaa87538f962b7446dc889bd0ece3ca986..21d64ed9c116088fb5f4becad8a5e827ff47f1c4 100644 +index 81132959080d21a341fcc418fcd7c73cf62b78c4..9cac7284aeacda2d877502f97d9e442ae4fdadd3 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -307,6 +307,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500; +@@ -309,6 +309,10 @@ constexpr int kSynthesizedMouseMessagesTimeDifference = 500; } // namespace @@ -29,7 +29,7 @@ index 21e96caaa87538f962b7446dc889bd0ece3ca986..21d64ed9c116088fb5f4becad8a5e827 // A scoping class that prevents a window from being able to redraw in response // to invalidations that may occur within it for the lifetime of the object. // -@@ -358,6 +362,7 @@ class HWNDMessageHandler::ScopedRedrawLock { +@@ -360,6 +364,7 @@ class HWNDMessageHandler::ScopedRedrawLock { cancel_unlock_(false), should_lock_(owner_->IsVisible() && !owner->HasChildRenderingWindow() && ::IsWindow(hwnd_) && @@ -37,7 +37,7 @@ index 21e96caaa87538f962b7446dc889bd0ece3ca986..21d64ed9c116088fb5f4becad8a5e827 (!(GetWindowLong(hwnd_, GWL_STYLE) & WS_CAPTION) || !ui::win::IsAeroGlassEnabled())) { if (should_lock_) -@@ -976,6 +981,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() { +@@ -979,6 +984,10 @@ HWNDMessageHandler::RegisterUnadjustedMouseEvent() { return scoped_enable; } @@ -49,10 +49,10 @@ index 21e96caaa87538f962b7446dc889bd0ece3ca986..21d64ed9c116088fb5f4becad8a5e827 // HWNDMessageHandler, gfx::WindowImpl overrides: diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h -index a338ec40a4052a40304d7cf8c4e222f539412e68..6c109dde127bb04b33d18f030ffe4ec2a2e044c6 100644 +index fd402c3d6b0130dc91d6d369bc3337f9955ccf6d..36caa4704af99a6769cf359582a11b025a2b24a0 100644 --- a/ui/views/win/hwnd_message_handler.h +++ b/ui/views/win/hwnd_message_handler.h -@@ -202,6 +202,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, +@@ -206,6 +206,8 @@ class VIEWS_EXPORT HWNDMessageHandler : public gfx::WindowImpl, using TouchIDs = std::set; enum class DwmFrameState { kOff, kOn }; diff --git a/patches/chromium/disable_color_correct_rendering.patch b/patches/chromium/disable_color_correct_rendering.patch index c88acd3554f4..65566628b0d0 100644 --- a/patches/chromium/disable_color_correct_rendering.patch +++ b/patches/chromium/disable_color_correct_rendering.patch @@ -20,10 +20,10 @@ to deal with color spaces. That is being tracked at https://crbug.com/634542 and https://crbug.com/711107. diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc -index 3be9e62159ad6ac98e1cd0790c7c06921effe5e3..356a8f451061b0bddeb1fcc1b64d7e48b7e8c8a6 100644 +index c841d7f51ea7a99fe2e806e4102bf91d75853ed0..ed983081afb0f4ead01da32cd56d61ecb63d33dd 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc -@@ -1802,6 +1802,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( +@@ -1789,6 +1789,10 @@ void LayerTreeHostImpl::SetIsLikelyToRequireADraw( gfx::ColorSpace LayerTreeHostImpl::GetRasterColorSpace( gfx::ContentColorUsage content_color_usage) const { @@ -60,7 +60,7 @@ index e58b4023652785fa8ea47236a5ad7237c7ea6ed2..4ec673ea93410ee00b1af4330fdc8b52 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 f919df4d79a1168269c1538ac13a2a944586cf4e..fc34cf5d7dab95e7b6fc0576674b3e2be1792c65 100644 +index aab0c5d1dbdfce9b56ada8861a0a7ffb42704a96..430ad6cfc7bba31bc097e654765fb94d42bcdfe5 100644 --- a/components/viz/host/renderer_settings_creation.cc +++ b/components/viz/host/renderer_settings_creation.cc @@ -17,6 +17,7 @@ @@ -229,7 +229,7 @@ index 1e2ad6423a5e316a9a1713abab7579ea0d2a82f9..22df5e1728e5dc2879c9b96911f6e734 + +#undef PATCH_CS diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc -index cc90e0aae77c0ca80eeab84eee8ff89a1295dbd2..fa96e7fa8c4f5d14da548398e533b10f153723ed 100644 +index 49d6d4107c0e4e0c37471394c5b7bdf84b3c823a..f0773c8fe1ccf0a3f920c840719ad7ee07d5d0db 100644 --- a/content/browser/gpu/gpu_process_host.cc +++ b/content/browser/gpu/gpu_process_host.cc @@ -224,6 +224,7 @@ GpuTerminationStatus ConvertToGpuTerminationStatus( @@ -241,10 +241,10 @@ index cc90e0aae77c0ca80eeab84eee8ff89a1295dbd2..fa96e7fa8c4f5d14da548398e533b10f sandbox::policy::switches::kGpuSandboxAllowSysVShm, sandbox::policy::switches::kGpuSandboxFailuresFatal, diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index 0a53d80feb2cdaa599da3ea87a8a6a8f8327ae92..532e82ca5145853b218c1e835d0b71bc1b158564 100644 +index 3555928a29b3c6022621c4e9b65531edbefa7797..9b36af8cd02f56810b6b8ed86d1c8ba544567233 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -183,6 +183,7 @@ +@@ -182,6 +182,7 @@ #include "ui/accessibility/accessibility_switches.h" #include "ui/base/ui_base_switches.h" #include "ui/display/display_switches.h" @@ -252,7 +252,7 @@ index 0a53d80feb2cdaa599da3ea87a8a6a8f8327ae92..532e82ca5145853b218c1e835d0b71bc #include "ui/gl/gl_switches.h" #include "url/gurl.h" #include "url/origin.h" -@@ -3375,6 +3376,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer( +@@ -3416,6 +3417,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[] = { @@ -293,7 +293,7 @@ index 94ca8fd75212fa5c7b90823a112309dd7961353b..566393827ef739eb8fc0e24e6ee505e1 } diff --git a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc -index 083e7c6d49574ae5d1beeba02b334ae864d60afb..85626cd2354b0c13caceb8a1b4f7d585f400cb2c 100644 +index 62ff201dae894250b84ad3c32f477ff9324e1906..e53116a55c234f1cbc2d8f05cc8090e931095f1a 100644 --- a/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc +++ b/third_party/blink/renderer/platform/widget/compositing/layer_tree_settings.cc @@ -25,6 +25,7 @@ diff --git a/patches/chromium/disable_compositor_recycling.patch b/patches/chromium/disable_compositor_recycling.patch index dc011ac38a5f..a4ba8282d9a7 100644 --- a/patches/chromium/disable_compositor_recycling.patch +++ b/patches/chromium/disable_compositor_recycling.patch @@ -6,10 +6,10 @@ Subject: fix: disabling compositor recycling Compositor recycling is useful for Chrome because there can be many tabs and spinning up a compositor for each one would be costly. In practice, Chrome uses the parent compositor code path of browser_compositor_view_mac.mm; the NSView of each tab is detached when it's hidden and attached when it's shown. For Electron, there is no parent compositor, so we're forced into the "own compositor" code path, which seems to be non-optimal and pretty ruthless in terms of the release of resources. Electron has no real concept of multiple tabs per window, so it should be okay to disable this ruthless recycling altogether in Electron. diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index 515d1588c0de8daa503df91338dc3a5c072c5690..b524f3125f955ba065c2d87e992606ec88b95b55 100644 +index 5aac5fcfe781e282b748630c07341d1b465d99ac..987b0e85ead3a33c8d0a93ac9a6c95782b22af96 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -483,7 +483,11 @@ +@@ -491,7 +491,11 @@ return; host()->WasHidden(); diff --git a/patches/chromium/disable_hidden.patch b/patches/chromium/disable_hidden.patch index 09872b803a12..31ce398df5f3 100644 --- a/patches/chromium/disable_hidden.patch +++ b/patches/chromium/disable_hidden.patch @@ -6,10 +6,10 @@ Subject: disable_hidden.patch Electron uses this to disable background throttling for hidden windows. diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 095ae394b95b07f17295611dc1ade9ae7b4f2c1c..b72e3f6ab2a43e8a7f707e9634fb3a4abb87e993 100644 +index 3ec7188cc015df085e46d3dac1374af1d92ae4d3..a1632e19959d163eecafef484204aa0dba919897 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -773,6 +773,9 @@ void RenderWidgetHostImpl::WasHidden() { +@@ -776,6 +776,9 @@ void RenderWidgetHostImpl::WasHidden() { if (is_hidden_) return; @@ -20,12 +20,12 @@ index 095ae394b95b07f17295611dc1ade9ae7b4f2c1c..b72e3f6ab2a43e8a7f707e9634fb3a4a blink::mojom::PointerLockResult::kWrongDocument); diff --git a/content/browser/renderer_host/render_widget_host_impl.h b/content/browser/renderer_host/render_widget_host_impl.h -index 59b0439a6ba6959b5c37c316fcb955a1486c343d..2b93a57863f4e0e5e41fbf4a640510d70b794830 100644 +index b7a3b2bc9032934a8537a49b8e1fd895eae721dd..aa864537cf2c3002623427ecd10ff62c88e75aba 100644 --- a/content/browser/renderer_host/render_widget_host_impl.h +++ b/content/browser/renderer_host/render_widget_host_impl.h -@@ -856,6 +856,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl - mojom::CreateFrameWidgetParamsPtr - BindAndGenerateCreateFrameWidgetParamsForNewWindow(); +@@ -864,6 +864,9 @@ class CONTENT_EXPORT RenderWidgetHostImpl + void OnLocalSurfaceIdChanged( + const cc::RenderFrameMetadata& metadata) override; + // Electron: Prevents the widget from getting hidden. + bool disable_hidden_ = false; @@ -34,7 +34,7 @@ index 59b0439a6ba6959b5c37c316fcb955a1486c343d..2b93a57863f4e0e5e41fbf4a640510d7 // |routing_id| must not be MSG_ROUTING_NONE. // If this object outlives |delegate|, DetachDelegate() must be called when diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc -index 2f508cbb53a9d5734c1be40827b5b4794b639056..555937e97250f62d68860ec86026efafe6a5d616 100644 +index afdd5aa89be899a1176a770c7a4c06f7fa2579ef..0ea6f2ee5bfd41bfb36db6de19a42128b4894dd8 100644 --- a/content/browser/renderer_host/render_widget_host_view_aura.cc +++ b/content/browser/renderer_host/render_widget_host_view_aura.cc @@ -605,7 +605,7 @@ void RenderWidgetHostViewAura::HideImpl() { diff --git a/patches/chromium/disable_unload_metrics.patch b/patches/chromium/disable_unload_metrics.patch index 4d84314cf082..c6544c3f319b 100644 --- a/patches/chromium/disable_unload_metrics.patch +++ b/patches/chromium/disable_unload_metrics.patch @@ -24,10 +24,10 @@ This patch temporarily disables the metrics so we can have green CI, and we should continue seeking for a real fix. diff --git a/content/browser/renderer_host/navigator.cc b/content/browser/renderer_host/navigator.cc -index cd3055cb99e117868d6b1d2d7a4faedca0a3981f..5f5bf984b28c5f708db632f1771601b08f23a3b1 100644 +index cb2bde331db92cd29a3af5ca2c065bbf02b39208..46ba89e09cf228bc022142e040763b5a9332764c 100644 --- a/content/browser/renderer_host/navigator.cc +++ b/content/browser/renderer_host/navigator.cc -@@ -1098,6 +1098,7 @@ void Navigator::RecordNavigationMetrics( +@@ -1105,6 +1105,7 @@ void Navigator::RecordNavigationMetrics( .InMilliseconds()); } @@ -35,7 +35,7 @@ index cd3055cb99e117868d6b1d2d7a4faedca0a3981f..5f5bf984b28c5f708db632f1771601b0 // If this is a same-process navigation and we have timestamps for unload // durations, fill those metrics out as well. if (params.unload_start && params.unload_end && -@@ -1144,6 +1145,7 @@ void Navigator::RecordNavigationMetrics( +@@ -1151,6 +1152,7 @@ void Navigator::RecordNavigationMetrics( first_before_unload_start_time) .InMilliseconds()); } diff --git a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch index 96cbd2fc1bf1..9fb5bd6dba42 100644 --- a/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch +++ b/patches/chromium/don_t_use_potentially_null_getwebframe_-_view_when_get_blink.patch @@ -11,10 +11,10 @@ This regressed in https://chromium-review.googlesource.com/c/chromium/src/+/2572 Upstream: https://chromium-review.googlesource.com/c/chromium/src/+/2598393 diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc -index 395bb615c0a2d5a49cfbc6d8a9e9f3d9a809b595..dcf47a194713764d0ccb588ff07de7fc43e30bdc 100644 +index ebf2d997f03c36e5242405002c7dce583aec31dc..2cf1ac25f3c4ca0348502a37dbf84111842ced93 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc -@@ -2357,7 +2357,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const { +@@ -2347,7 +2347,7 @@ const blink::WebView* RenderFrameImpl::GetWebView() const { } const blink::web_pref::WebPreferences& RenderFrameImpl::GetBlinkPreferences() { diff --git a/patches/chromium/enable_reset_aspect_ratio.patch b/patches/chromium/enable_reset_aspect_ratio.patch index e1309d986dc8..7925b617b0fe 100644 --- a/patches/chromium/enable_reset_aspect_ratio.patch +++ b/patches/chromium/enable_reset_aspect_ratio.patch @@ -6,10 +6,10 @@ Subject: feat: enable setting aspect ratio to 0 Make SetAspectRatio accept 0 as valid input, which would reset to null. diff --git a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -index 17668789847d1a7f7037b9507adb824c02f1cb31..6401d9b00d6c7071c16ca44866a3d53116ddfb89 100644 +index d8411ddc4fd88a1416181cce366b112df3f48d63..a33ec53b96fec67feacc92e71fa6ed17c5e47d7d 100644 --- a/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc +++ b/ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc -@@ -527,7 +527,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) { +@@ -525,7 +525,7 @@ void DesktopWindowTreeHostWin::SetOpacity(float opacity) { } void DesktopWindowTreeHostWin::SetAspectRatio(const gfx::SizeF& aspect_ratio) { @@ -19,10 +19,10 @@ index 17668789847d1a7f7037b9507adb824c02f1cb31..6401d9b00d6c7071c16ca44866a3d531 aspect_ratio.height()); } diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc -index 21d64ed9c116088fb5f4becad8a5e827ff47f1c4..7f6ab51b2d83a8c555de1d1e19a40b93b438fbd4 100644 +index 9cac7284aeacda2d877502f97d9e442ae4fdadd3..33c533665589f78425488547b550876c5161f010 100644 --- a/ui/views/win/hwnd_message_handler.cc +++ b/ui/views/win/hwnd_message_handler.cc -@@ -926,8 +926,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) { +@@ -929,8 +929,11 @@ void HWNDMessageHandler::SetFullscreen(bool fullscreen) { } void HWNDMessageHandler::SetAspectRatio(float aspect_ratio) { diff --git a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch index b4a82e8fca0b..0a3ebff5c48e 100644 --- a/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch +++ b/patches/chromium/export_gin_v8platform_pageallocator_for_usage_outside_of_the_gin.patch @@ -9,26 +9,26 @@ correctly tagged with MAP_JIT we need to use gins page allocator instead of the default V8 allocator. This probably can't be usptreamed. diff --git a/gin/public/v8_platform.h b/gin/public/v8_platform.h -index fa0e7faad9296b9be8d662324c52f40e502f2e38..a579b359c684ccd72dcbe43f40b4aa7b4779c36b 100644 +index e5da06566ffef8d0b394c0d7fde3916ce49da06e..76bbdf35f4751c87a6d25cc5e8db7aebf43bc821 100644 --- a/gin/public/v8_platform.h +++ b/gin/public/v8_platform.h -@@ -25,6 +25,7 @@ class GIN_EXPORT V8Platform : public v8::Platform { - // Some configurations do not use page_allocator. - #if BUILDFLAG(USE_PARTITION_ALLOC) - v8::PageAllocator* GetPageAllocator() override; -+ static v8::PageAllocator* PageAllocator(); +@@ -30,6 +30,7 @@ class GIN_EXPORT V8Platform : public v8::Platform { + // enabling Arm's Branch Target Instructions for executable pages. This is + // verified in the tests for gin::PageAllocator. + PageAllocator* GetPageAllocator() override; ++ static PageAllocator* PageAllocator(); void OnCriticalMemoryPressure() override; #endif - std::shared_ptr GetForegroundTaskRunner( + diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc -index 6acf18c405774774fa9074f1b3d5daeefbda120e..9147b28b0f7f016a26e3d9e346f1eeb72d719a79 100644 +index 44f8ffeda27cbfebcfc57e1312e9e9f4ca3ab576..356b5a7c8f39fab97ff434850038f8f6cee750c8 100644 --- a/gin/v8_platform.cc +++ b/gin/v8_platform.cc -@@ -472,6 +472,10 @@ v8::PageAllocator* V8Platform::GetPageAllocator() { +@@ -368,6 +368,10 @@ PageAllocator* V8Platform::GetPageAllocator() { return g_page_allocator.Pointer(); } -+v8::PageAllocator* V8Platform::PageAllocator() { ++PageAllocator* V8Platform::PageAllocator() { + return g_page_allocator.Pointer(); +} + diff --git a/patches/chromium/expose_setuseragent_on_networkcontext.patch b/patches/chromium/expose_setuseragent_on_networkcontext.patch index 8122eb598dee..6ce000a61883 100644 --- a/patches/chromium/expose_setuseragent_on_networkcontext.patch +++ b/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 3896a834cbb17bfe6ecfc602886ea7d77d7d5167..4f752b1e961e23cf2f0e07a93dfe3867bbd56737 100644 +index 7bd73dae3a77cb16cf282d2df7f4ff7a8f412805..3d3795cd1911647f026addf0d6e6bcc18325f641 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc -@@ -1285,6 +1285,13 @@ void NetworkContext::SetNetworkConditions( +@@ -1292,6 +1292,13 @@ void NetworkContext::SetNetworkConditions( std::move(network_conditions)); } @@ -51,10 +51,10 @@ index 3896a834cbb17bfe6ecfc602886ea7d77d7d5167..4f752b1e961e23cf2f0e07a93dfe3867 // 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 00bcb6e3b31b7e61a36c6df96d39cd0d5cc5e28a..aacda36b0a14beb415592a1f0e478dc1964d82eb 100644 +index 049c8e5e0e34454f03a823b31a5f7755d67cfb07..d928b8c314f8c3384215a87aacd01a7f570316c9 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h -@@ -270,6 +270,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -271,6 +271,7 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext void CloseIdleConnections(CloseIdleConnectionsCallback callback) override; void SetNetworkConditions(const base::UnguessableToken& throttling_profile_id, mojom::NetworkConditionsPtr conditions) override; @@ -63,10 +63,10 @@ index 00bcb6e3b31b7e61a36c6df96d39cd0d5cc5e28a..aacda36b0a14beb415592a1f0e478dc1 void SetEnableReferrers(bool enable_referrers) override; #if BUILDFLAG(IS_CHROMEOS_ASH) diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 9a4ab0a7493688e31acd119b816de69bfb47d9d7..751769a979c0fc8d3cdcded177ee23c227fcd103 100644 +index d8e7d0d35317fe1124bf81f60faf2b35ae19a3d7..eed5109002dd99a6e65c8882530a5fd2a69ce28c 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -998,6 +998,9 @@ interface NetworkContext { +@@ -1029,6 +1029,9 @@ interface NetworkContext { SetNetworkConditions(mojo_base.mojom.UnguessableToken throttling_profile_id, NetworkConditions? conditions); @@ -77,7 +77,7 @@ index 9a4ab0a7493688e31acd119b816de69bfb47d9d7..751769a979c0fc8d3cdcded177ee23c2 SetAcceptLanguage(string new_accept_language); diff --git a/services/network/test/test_network_context.h b/services/network/test/test_network_context.h -index 6bf98a5e9028cc162aa5493a5dc6910f59aa10d7..48d1f1414894c3ca71de74a7cb5e49eb98a1bf30 100644 +index f1fbbf10df01876e8ae3418b72cd0f4fcbda542b..780ccbe1a9ff8ab91b39fdcef74cd5805ba8583d 100644 --- a/services/network/test/test_network_context.h +++ b/services/network/test/test_network_context.h @@ -134,6 +134,7 @@ class TestNetworkContext : public mojom::NetworkContext { diff --git a/patches/chromium/feat_add_support_for_overriding_the_base_spellchecker_download_url.patch b/patches/chromium/feat_add_support_for_overriding_the_base_spellchecker_download_url.patch index 2f7269e63690..38a1c20dc9a3 100644 --- a/patches/chromium/feat_add_support_for_overriding_the_base_spellchecker_download_url.patch +++ b/patches/chromium/feat_add_support_for_overriding_the_base_spellchecker_download_url.patch @@ -44,10 +44,10 @@ index 182721f9238683321ef5645d5506d2e88816f45f..31958788b8b2f110ecedcd9f0ba3b8ec "https://redirector.gvt1.com/edgedl/chrome/dict/"; diff --git a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h -index a8acd00dc449812d336364229fade2a16e21ccbc..8d8eca3c7de3080111043dc465ed4316af026c0b 100644 +index f2eb0abec4d5fb05dee09b51e02619ba47336025..77667a70584c5a102bddbc46cb71aa616b672384 100644 --- a/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h +++ b/chrome/browser/spellchecker/spellcheck_hunspell_dictionary.h -@@ -88,6 +88,8 @@ class SpellcheckHunspellDictionary +@@ -93,6 +93,8 @@ class SpellcheckHunspellDictionary // Tests use this method to set a custom URL for downloading dictionaries. static void SetDownloadURLForTesting(const GURL url); diff --git a/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch b/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch index 6a88cfc72cde..ccf312679c66 100644 --- a/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch +++ b/patches/chromium/feat_allow_embedders_to_add_observers_on_created_hunspell.patch @@ -7,10 +7,10 @@ Subject: feat: allow embedders to add observers on created hunspell This patch is used by Electron to implement spellchecker events. diff --git a/chrome/browser/spellchecker/spellcheck_service.cc b/chrome/browser/spellchecker/spellcheck_service.cc -index 23980dfd5e35ac9160b82bd0d29bd98762897d1f..aece7fe0a4d45a40afbc0339073ffffb2c0d4f5e 100644 +index 7e6846c8bbb2d773c0b0ec97da928871d828bcbf..7a5f0d5034270dcfb287d9c46b2cd0431098d37e 100644 --- a/chrome/browser/spellchecker/spellcheck_service.cc +++ b/chrome/browser/spellchecker/spellcheck_service.cc -@@ -466,6 +466,9 @@ void SpellcheckService::LoadDictionaries() { +@@ -467,6 +467,9 @@ void SpellcheckService::LoadDictionaries() { std::make_unique( dictionary, platform_spellcheck_language, context_, this)); hunspell_dictionaries_.back()->AddObserver(this); @@ -20,7 +20,7 @@ index 23980dfd5e35ac9160b82bd0d29bd98762897d1f..aece7fe0a4d45a40afbc0339073ffffb hunspell_dictionaries_.back()->Load(); } -@@ -518,6 +521,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const { +@@ -519,6 +522,20 @@ bool SpellcheckService::IsSpellcheckEnabled() const { (!hunspell_dictionaries_.empty() || enable_if_uninitialized); } @@ -42,10 +42,10 @@ index 23980dfd5e35ac9160b82bd0d29bd98762897d1f..aece7fe0a4d45a40afbc0339073ffffb const content::NotificationSource& source, const content::NotificationDetails& details) { diff --git a/chrome/browser/spellchecker/spellcheck_service.h b/chrome/browser/spellchecker/spellcheck_service.h -index a810ed516cce5f491ea75ae2d0bbda65e066ad3e..fcfd3f5801a967fdd7b3e99094a35eddb1a31789 100644 +index b417b23feb1f53c949d8d8c677ff36431cee2a62..bdc67f1de727983a67ea360b502d791af8b22479 100644 --- a/chrome/browser/spellchecker/spellcheck_service.h +++ b/chrome/browser/spellchecker/spellcheck_service.h -@@ -134,6 +134,8 @@ class SpellcheckService : public KeyedService, +@@ -138,6 +138,8 @@ class SpellcheckService : public KeyedService, // dictionaries available. bool IsSpellcheckEnabled() const; @@ -54,7 +54,7 @@ index a810ed516cce5f491ea75ae2d0bbda65e066ad3e..fcfd3f5801a967fdd7b3e99094a35edd // NotificationProfile implementation. void Observe(int type, const content::NotificationSource& source, -@@ -301,6 +303,8 @@ class SpellcheckService : public KeyedService, +@@ -305,6 +307,8 @@ class SpellcheckService : public KeyedService, // A pointer to the BrowserContext which this service refers to. content::BrowserContext* context_; diff --git a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch index e59efd8ffd70..3bdace751c99 100644 --- a/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch +++ b/patches/chromium/feat_enable_offscreen_rendering_with_viz_compositor.patch @@ -81,7 +81,7 @@ index 1026b739d283f0fc252fa2af83a6d4cf51bc8553..fe562ab60ce98b8bb0c5080a6428deb3 private: const HWND hwnd_; diff --git a/components/viz/service/BUILD.gn b/components/viz/service/BUILD.gn -index f0eb025056501c5d87a0ef814ec4070a3df29bcc..148adf8b17209eeb142c02674a2a24312e588e80 100644 +index 34dad16dac56631dae62e2c38b8ed7bf6ca2eb41..25f114ceb4c18a88bd23975c85fab67a6311f808 100644 --- a/components/viz/service/BUILD.gn +++ b/components/viz/service/BUILD.gn @@ -137,6 +137,8 @@ viz_component("service") { diff --git a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch index c2664b252905..1b0c37be79f0 100644 --- a/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch +++ b/patches/chromium/feat_expose_raw_response_headers_from_urlloader.patch @@ -17,10 +17,10 @@ headers, moving forward we should find a way in upstream to provide access to these headers for loader clients created on the browser process. diff --git a/services/network/public/cpp/resource_request.cc b/services/network/public/cpp/resource_request.cc -index 5fc02ead27db692a54a5b7efd7dd9cde3c8ee20a..0e42c2c51d6c599ccac560890c4499ba70216ffc 100644 +index b405a82fd2bfed451f86907e66ae3a4ab5838fbb..988aa62b2d78b736b34e947e42f965fd6b2b563f 100644 --- a/services/network/public/cpp/resource_request.cc +++ b/services/network/public/cpp/resource_request.cc -@@ -227,6 +227,7 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { +@@ -231,6 +231,7 @@ bool ResourceRequest::EqualsForTesting(const ResourceRequest& request) const { do_not_prompt_for_login == request.do_not_prompt_for_login && is_main_frame == request.is_main_frame && transition_type == request.transition_type && @@ -29,10 +29,10 @@ index 5fc02ead27db692a54a5b7efd7dd9cde3c8ee20a..0e42c2c51d6c599ccac560890c4499ba upgrade_if_insecure == request.upgrade_if_insecure && is_revalidating == request.is_revalidating && diff --git a/services/network/public/cpp/resource_request.h b/services/network/public/cpp/resource_request.h -index 72bc778a6320dba7e453848ab95ddc6bf43181ba..3de6baf98396a2623ca8d5b74840c913d6f5c4b8 100644 +index 2b7832dd2c2d006bf8ef382cdf3f7f52e0edd385..f872596bc1236323ecdf1de699c513e40c42592c 100644 --- a/services/network/public/cpp/resource_request.h +++ b/services/network/public/cpp/resource_request.h -@@ -150,6 +150,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest { +@@ -160,6 +160,7 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) ResourceRequest { bool do_not_prompt_for_login = false; bool is_main_frame = false; int transition_type = 0; @@ -41,10 +41,10 @@ index 72bc778a6320dba7e453848ab95ddc6bf43181ba..3de6baf98396a2623ca8d5b74840c913 bool upgrade_if_insecure = false; bool is_revalidating = false; diff --git a/services/network/public/cpp/url_request_mojom_traits.cc b/services/network/public/cpp/url_request_mojom_traits.cc -index cc75591aa2955525e928f74941049cf6b0f47e17..4deae021c5f00ab018f440a1869db84f40b98579 100644 +index 0bcf9231f6a20d5b673d601e84e91f5db34274dd..6b3f5169f9495e8d2b9bb63b12e22b20000fe88d 100644 --- a/services/network/public/cpp/url_request_mojom_traits.cc +++ b/services/network/public/cpp/url_request_mojom_traits.cc -@@ -188,6 +188,7 @@ bool StructTraits< +@@ -197,6 +197,7 @@ bool StructTraits< out->do_not_prompt_for_login = data.do_not_prompt_for_login(); out->is_main_frame = data.is_main_frame(); out->transition_type = data.transition_type(); @@ -53,10 +53,10 @@ index cc75591aa2955525e928f74941049cf6b0f47e17..4deae021c5f00ab018f440a1869db84f out->upgrade_if_insecure = data.upgrade_if_insecure(); out->is_revalidating = data.is_revalidating(); diff --git a/services/network/public/cpp/url_request_mojom_traits.h b/services/network/public/cpp/url_request_mojom_traits.h -index 7390c691d2c7ffd8504aeb94ccb44a3c03c3c103..cda9b2f4ba3c7ed04ba23e46a2dfef8353dfb4a2 100644 +index 2ad640951ae17588ac98d9cf2ade197786178257..a617132e8db8f059c15ba26438ac3a70382f4cd6 100644 --- a/services/network/public/cpp/url_request_mojom_traits.h +++ b/services/network/public/cpp/url_request_mojom_traits.h -@@ -253,6 +253,9 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) +@@ -266,6 +266,9 @@ struct COMPONENT_EXPORT(NETWORK_CPP_BASE) static int32_t transition_type(const network::ResourceRequest& request) { return request.transition_type; } @@ -67,10 +67,10 @@ index 7390c691d2c7ffd8504aeb94ccb44a3c03c3c103..cda9b2f4ba3c7ed04ba23e46a2dfef83 return request.previews_state; } diff --git a/services/network/public/mojom/url_request.mojom b/services/network/public/mojom/url_request.mojom -index 4b0ba93acfb6aa61138469801547edebb1c8d91b..8996a1eaf64c2a96181450e486d785bc6b7edf3c 100644 +index 8ad56cb2ba2195ec5edd9d36a88ebc3f73b720ff..09dfa592e2960cc82541bb8d2dce3522d5d0142e 100644 --- a/services/network/public/mojom/url_request.mojom +++ b/services/network/public/mojom/url_request.mojom -@@ -303,6 +303,9 @@ struct URLRequest { +@@ -313,6 +313,9 @@ struct URLRequest { // about this. int32 transition_type; @@ -103,10 +103,10 @@ index cea1fb864ab46b4b0eabf1db11a0392d6cd575c1..df033f65d50b088778268827e506963a string mime_type; diff --git a/services/network/url_loader.cc b/services/network/url_loader.cc -index c8e3249c79063c001028add6acd3a451074df214..b6cb6ee4ae623e25abeec62b156002eb7b987028 100644 +index e8d83ecd221e28182be3443fca89ba6a125622a1..9206c91efe2b08d9b2a4c829fa0135d31244b3fc 100644 --- a/services/network/url_loader.cc +++ b/services/network/url_loader.cc -@@ -489,6 +489,7 @@ URLLoader::URLLoader( +@@ -490,6 +490,7 @@ URLLoader::URLLoader( peer_closed_handle_watcher_(FROM_HERE, mojo::SimpleWatcher::ArmingPolicy::MANUAL, base::SequencedTaskRunnerHandle::Get()), @@ -114,7 +114,7 @@ index c8e3249c79063c001028add6acd3a451074df214..b6cb6ee4ae623e25abeec62b156002eb devtools_request_id_(request.devtools_request_id), request_mode_(request.mode), request_credentials_mode_(request.credentials_mode), -@@ -626,7 +627,7 @@ URLLoader::URLLoader( +@@ -632,7 +633,7 @@ URLLoader::URLLoader( url_request_->SetRequestHeadersCallback(base::BindRepeating( &URLLoader::SetRawRequestHeadersAndNotify, base::Unretained(this))); @@ -123,7 +123,7 @@ index c8e3249c79063c001028add6acd3a451074df214..b6cb6ee4ae623e25abeec62b156002eb url_request_->SetResponseHeadersCallback(base::BindRepeating( &URLLoader::SetRawResponseHeaders, base::Unretained(this))); } -@@ -1259,6 +1260,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { +@@ -1255,6 +1256,19 @@ void URLLoader::OnResponseStarted(net::URLRequest* url_request, int net_error) { response_ = network::mojom::URLResponseHead::New(); PopulateResourceResponse(url_request_.get(), is_load_timing_enabled_, options_, response_.get()); @@ -144,10 +144,10 @@ index c8e3249c79063c001028add6acd3a451074df214..b6cb6ee4ae623e25abeec62b156002eb // Parse and remove the Trust Tokens response headers, if any are expected, // potentially failing the request if an error occurs. diff --git a/services/network/url_loader.h b/services/network/url_loader.h -index de2d9f23ad3907562445ba2d3c911f76f1376f5b..254e0ca7cca7332a15cedc324e41481e68831bbf 100644 +index 6d53bc8f9eef1446d764cb92943a3f9723390ed6..171f2015f09040297afba25218292c304a864758 100644 --- a/services/network/url_loader.h +++ b/services/network/url_loader.h -@@ -466,6 +466,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader +@@ -467,6 +467,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) URLLoader std::unique_ptr resource_scheduler_request_handle_; diff --git a/patches/chromium/fix_chrome_root_store_codegen_for_cross-compile_builds.patch b/patches/chromium/fix_chrome_root_store_codegen_for_cross-compile_builds.patch deleted file mode 100644 index 591267ea33d7..000000000000 --- a/patches/chromium/fix_chrome_root_store_codegen_for_cross-compile_builds.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Hubert Chao -Date: Tue, 31 Aug 2021 23:20:50 +0000 -Subject: Fix chrome root store codegen for cross-compile builds. - -Assuming that the textproto file was underneath base::DIR_SOURCE_ROOT -didn't work for cross-compile builds, so change the build system to -pass the absolute path to the root_store_dir. - -Bug: 1244436 -Change-Id: I06bd6e5729f23e725bfca0c8f0195fcc89d70ba1 -Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3133701 -Commit-Queue: Hubert Chao -Reviewed-by: David Benjamin -Cr-Commit-Position: refs/heads/main@{#917023} - -diff --git a/net/data/ssl/chrome_root_store/BUILD.gn b/net/data/ssl/chrome_root_store/BUILD.gn -index 185d53ec0555fe37be208be488ec1626f1d220ac..92ad13431a3addafdc210cd79501c754a539c38d 100644 ---- a/net/data/ssl/chrome_root_store/BUILD.gn -+++ b/net/data/ssl/chrome_root_store/BUILD.gn -@@ -135,9 +135,11 @@ compiled_action("gen_root_store_inc") { - "store/certs/fd73dad31c644ff1b43bef0ccdda96710b9cd9875eca7e31707af3e96d522bbd.pem", - ] - outputs = [ "${target_gen_dir}/chrome-root-store-inc.cc" ] -- args = [ "--write-cpp=" + -- rebase_path("${target_gen_dir}/chrome-root-store-inc.cc", -- root_build_dir) ] -+ args = [ -+ "--root-store-dir=" + rebase_path("//net/data/ssl/chrome_root_store/store"), -+ "--write-cpp=" + rebase_path("${target_gen_dir}/chrome-root-store-inc.cc", -+ root_build_dir), -+ ] - } - - compiled_action("gen_root_store_test_inc") { -@@ -153,7 +155,8 @@ compiled_action("gen_root_store_test_inc") { - ] - outputs = [ "${target_gen_dir}/chrome-root-store-test-data-inc.cc" ] - args = [ -- "--root-store-dir=net/data/ssl/chrome_root_store/testdata", -+ "--root-store-dir=" + -+ rebase_path("//net/data/ssl/chrome_root_store/testdata"), - "--write-cpp=" + - rebase_path("${target_gen_dir}/chrome-root-store-test-data-inc.cc", - root_build_dir), -diff --git a/net/tools/root_store_tool/root_store_tool.cc b/net/tools/root_store_tool/root_store_tool.cc -index a41379e7a6f83fd2f14e63955337c3fc0ef9f7f3..b16344d9999ed07954f57a88409edc0c69c4e918 100644 ---- a/net/tools/root_store_tool/root_store_tool.cc -+++ b/net/tools/root_store_tool/root_store_tool.cc -@@ -123,37 +123,29 @@ int main(int argc, char** argv) { - base::CommandLine& command_line = *base::CommandLine::ForCurrentProcess(); - base::FilePath proto_path = command_line.GetSwitchValuePath("write-proto"); - base::FilePath cpp_path = command_line.GetSwitchValuePath("write-cpp"); -- if ((proto_path.empty() && cpp_path.empty()) || -- command_line.HasSwitch("help")) { -- std::cerr << "Usage: root_store_tool " -- << "[--root-store-dir=] " -- << "[--write-proto=PROTO_FILE] " -- << "[--write-cpp=CPP_FILE]" << std::endl; -- return 1; -- } -- -- // Find root store directory. Assumptions: -- // - Root store directory is relative to base::DIR_SOURCE_ROOT -- // -+ // Get root store directory. Assumptions: - // - $(ROOT_STORE_DIR)/root_store.textproto contains the textproto definition - // of the root store - // - // - Any certificate files referenced in - // $(ROOT_STORE_DIR)/root_store.textproto exist in the - // $(ROOT_STORE_DIR)/certs/ subdirectory. -+ // -+ // We'd like to assume that Root store directory is relative to -+ // base::DIR_SOURCE_ROOT, but in cross-compile cases this gives the wrong -+ // result leading to broken builds. See https://crbug.com/1244436. - base::FilePath root_store_dir = - command_line.GetSwitchValuePath("root-store-dir"); -- base::FilePath source_root; -- CHECK(base::PathService::Get(base::DIR_SOURCE_ROOT, &source_root)); -- if (root_store_dir.empty()) { -- root_store_dir = source_root.AppendASCII("net") -- .AppendASCII("data") -- .AppendASCII("ssl") -- .AppendASCII("chrome_root_store") -- .AppendASCII("store"); -- } else { -- root_store_dir = source_root.Append(root_store_dir); -+ -+ if ((proto_path.empty() && cpp_path.empty()) || root_store_dir.empty() || -+ command_line.HasSwitch("help")) { -+ std::cerr << "Usage: root_store_tool " -+ << "--root-store-dir= " -+ << "[--write-proto=PROTO_FILE] " -+ << "[--write-cpp=CPP_FILE]" << std::endl; -+ return 1; - } -+ - absl::optional root_store = ReadTextRootStore(root_store_dir); - if (!root_store) { - return 1; diff --git a/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch b/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch index 296eebdc023b..19734f525f70 100644 --- a/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch +++ b/patches/chromium/fix_expose_decrementcapturercount_in_web_contents_impl.patch @@ -8,10 +8,10 @@ we invoke it in order to expose contents.decrementCapturerCount([stayHidden, sta to users. We should try to upstream this. diff --git a/content/browser/web_contents/web_contents_impl.h b/content/browser/web_contents/web_contents_impl.h -index 4fa272275ba3883d105ddfd8deeb4987071d1b06..7e7fb60540a113b8213a5a1b266b57f18d67b4a4 100644 +index 97e6ccbfbd58482299a831c63573890d1f7d46f3..1e6b5ed19688993a750af0fd1fee72a4f67eab28 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h -@@ -1773,7 +1773,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, +@@ -1765,7 +1765,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, // Called when the base::ScopedClosureRunner returned by // IncrementCapturerCount() is destructed. @@ -21,10 +21,10 @@ index 4fa272275ba3883d105ddfd8deeb4987071d1b06..7e7fb60540a113b8213a5a1b266b57f1 // Calculates the PageVisibilityState for |visibility|, taking the capturing // state into account. diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index 383d0fd95d7e807b83f4cd972c107fa27fefaac6..ae7a7f187b24bb3ec97bea37881f85ede8689936 100644 +index 95bcea15ea704f11e8daab49de6d958fb2d15127..f2e9a772fe9449fe0e4be55567019c46ef2d8c6a 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h -@@ -633,6 +633,8 @@ class WebContents : public PageNavigator, +@@ -645,6 +645,8 @@ class WebContents : public PageNavigator, bool stay_hidden, bool stay_awake) WARN_UNUSED_RESULT = 0; diff --git a/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch b/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch index 9841dd9ae92c..c950e8c76037 100644 --- a/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch +++ b/patches/chromium/fix_patch_out_profile_refs_in_accessibility_ui.patch @@ -7,7 +7,7 @@ This tweaks Chrome's Accessibility support at chrome://accessibility to make it usable from Electron by removing Profile references. diff --git a/chrome/browser/accessibility/accessibility_ui.cc b/chrome/browser/accessibility/accessibility_ui.cc -index aaf2d7839245b46d60f54bbaa8fd28ade00401f3..0b5efe1b330f7405d88748d80aad189182d408db 100644 +index 541c38f0048b609327cae88370d5123d9d9a3796..b48ffcf7fcc62aefc2d1146ed9d87ad6bebff933 100644 --- a/chrome/browser/accessibility/accessibility_ui.cc +++ b/chrome/browser/accessibility/accessibility_ui.cc @@ -20,7 +20,10 @@ @@ -136,7 +136,7 @@ index aaf2d7839245b46d60f54bbaa8fd28ade00401f3..0b5efe1b330f7405d88748d80aad1891 +#endif } diff --git a/chrome/browser/accessibility/accessibility_ui.h b/chrome/browser/accessibility/accessibility_ui.h -index c0453b9f8603ba99a83a747666a1b05b9c36ca14..b0c610de6322177baf5a7ba44b632a9658756ce8 100644 +index 8343169078d15f697bbf7aea86eb46cc9b991ef8..96665569cebe6f0c3bb0b074db96620773ee2d81 100644 --- a/chrome/browser/accessibility/accessibility_ui.h +++ b/chrome/browser/accessibility/accessibility_ui.h @@ -24,6 +24,8 @@ struct AXEventNotificationDetails; @@ -148,7 +148,7 @@ index c0453b9f8603ba99a83a747666a1b05b9c36ca14..b0c610de6322177baf5a7ba44b632a96 namespace user_prefs { class PrefRegistrySyncable; } // namespace user_prefs -@@ -60,6 +62,8 @@ class AccessibilityUIMessageHandler : public content::WebUIMessageHandler { +@@ -65,6 +67,8 @@ class AccessibilityUIMessageHandler : public content::WebUIMessageHandler { static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); private: diff --git a/patches/chromium/frame_host_manager.patch b/patches/chromium/frame_host_manager.patch index 01841f3ea6ad..e55ced4e7a0d 100644 --- a/patches/chromium/frame_host_manager.patch +++ b/patches/chromium/frame_host_manager.patch @@ -6,10 +6,10 @@ Subject: frame_host_manager.patch Allows embedder to intercept site instances created by chromium. diff --git a/content/browser/renderer_host/render_frame_host_manager.cc b/content/browser/renderer_host/render_frame_host_manager.cc -index 680efc8fe2df3b40cf20bc18c396e661f674a55f..c3e1a28ea8df5a20ba735e46bbc4bf749ba553d3 100644 +index 67bdf4ff62fd59e86df30e083110501f8181dbe6..b435953e8325046370b4d2b3550c9c069653d56a 100644 --- a/content/browser/renderer_host/render_frame_host_manager.cc +++ b/content/browser/renderer_host/render_frame_host_manager.cc -@@ -2986,6 +2986,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( +@@ -3035,6 +3035,9 @@ RenderFrameHostManager::GetSiteInstanceForNavigationRequest( request->ResetStateForSiteInstanceChange(); } @@ -20,7 +20,7 @@ index 680efc8fe2df3b40cf20bc18c396e661f674a55f..c3e1a28ea8df5a20ba735e46bbc4bf74 } diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h -index bb30bb3604a793cbe37d20a3a18b21d5abfd6530..24b8927b4224eb890b5377b88dd8060b4dcfd648 100644 +index 66ff9593b8f3d62c486ef83c4c682edf73081d88..7d0318a137ad2f2b7bc8743bbad419d3f8f9ce12 100644 --- a/content/public/browser/content_browser_client.h +++ b/content/public/browser/content_browser_client.h @@ -272,6 +272,11 @@ class CONTENT_EXPORT ContentBrowserClient { diff --git a/patches/chromium/gin_enable_disable_v8_platform.patch b/patches/chromium/gin_enable_disable_v8_platform.patch index 2b8c28383b23..7821adb15fbb 100644 --- a/patches/chromium/gin_enable_disable_v8_platform.patch +++ b/patches/chromium/gin_enable_disable_v8_platform.patch @@ -38,7 +38,7 @@ index f0a7d0c05fa3c68b22b1d36e2c0810fe70f5a8a0..8ecce17b5bb8b5106de913a2d0197fd3 // Returns whether `Initialize` has already been invoked in the process. // Initialization is a one-way operation (i.e., this method cannot return diff --git a/gin/v8_initializer.cc b/gin/v8_initializer.cc -index 941ced089ed7e201d348b58b38d9d0d74bc843b1..9c78e04219e5bcd8d8044e576367833d0891f7d6 100644 +index 8177563df293ae9b4bb8cc46cfe81402f2bf50e0..f2eb8677c095a6d24202a524991c3d8aea39c406 100644 --- a/gin/v8_initializer.cc +++ b/gin/v8_initializer.cc @@ -269,7 +269,8 @@ void SetV8FlagsIfOverridden(const base::Feature& feature, diff --git a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch index 198a2d296e6a..6de35937f251 100644 --- a/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch +++ b/patches/chromium/gpu_notify_when_dxdiag_request_fails.patch @@ -40,7 +40,7 @@ index a8c0d59cb825a791c44c54e55ad7f295ad07a309..a1ef53aa46fb0cfc7bcac121244f77af void UpdateDawnInfo(const std::vector& dawn_info_list); diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc -index 569c179aed6ab7b68b484f55d0abf9562044c389..9612ed45ed7d987c5d4e8f7ef348860ab4fc4252 100644 +index 8ec17755a906ae60a1424b75ee21bd29fb62ab3f..0d8642a1034abe817ea3434359185b2e5d985879 100644 --- a/content/browser/gpu/gpu_data_manager_impl_private.cc +++ b/content/browser/gpu/gpu_data_manager_impl_private.cc @@ -1219,6 +1219,12 @@ void GpuDataManagerImplPrivate::TerminateInfoCollectionGpuProcess() { diff --git a/patches/chromium/gritsettings_resource_ids.patch b/patches/chromium/gritsettings_resource_ids.patch index 4d91a2c86b23..17d04cccde46 100644 --- a/patches/chromium/gritsettings_resource_ids.patch +++ b/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 7a0344321c3050ec9a3c7c5346e2f391ab133b36..6f4750bb6bbbd0fde2c03596fba9de2e050aecc3 100644 +index 509687647e3566f48c89bfb2bebdfb17fa54fbc2..df1d19126456618529c951a70889edde12005a1c 100644 --- a/tools/gritsettings/resource_ids.spec +++ b/tools/gritsettings/resource_ids.spec -@@ -850,6 +850,11 @@ +@@ -851,6 +851,11 @@ "includes": [3880], }, diff --git a/patches/chromium/gtk_visibility.patch b/patches/chromium/gtk_visibility.patch index 102f6729ed82..2280dbe3a988 100644 --- a/patches/chromium/gtk_visibility.patch +++ b/patches/chromium/gtk_visibility.patch @@ -6,7 +6,7 @@ Subject: gtk_visibility.patch Allow electron to depend on GTK in the GN build. diff --git a/build/config/linux/gtk/BUILD.gn b/build/config/linux/gtk/BUILD.gn -index ecf95dda763b4c4515d9af890b93fbe69e300498..81748583fa032c48c11beb97b0d9eea41c1a9679 100644 +index 659002397184ad5017686585c0a5ad641e3312c5..85fdf6513403e7a713444213883fe3e0c101af42 100644 --- a/build/config/linux/gtk/BUILD.gn +++ b/build/config/linux/gtk/BUILD.gn @@ -33,6 +33,7 @@ pkg_config("gtk_internal_config") { @@ -17,7 +17,7 @@ index ecf95dda763b4c4515d9af890b93fbe69e300498..81748583fa032c48c11beb97b0d9eea4 # This is the only target that can depend on GTK. Do not add more targets # to this list. "//ui/gtk:gtk_stubs", -@@ -63,6 +64,9 @@ pkg_config("gtkprint_internal_config") { +@@ -64,6 +65,9 @@ pkg_config("gtkprint_internal_config") { } group("gtkprint") { diff --git a/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch b/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch index fa0198c2c531..83f65525ffea 100644 --- a/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch +++ b/patches/chromium/hack_to_allow_gclient_sync_with_host_os_mac_on_linux_in_ci.patch @@ -11,7 +11,7 @@ If removing this patch causes no sync failures, it's safe to delete :+1: Ref https://chromium-review.googlesource.com/c/chromium/src/+/2953903 diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py -index 95ba8a59241ed74b0c85ccf1fd480acb0bb9b82d..474f14af183e2fbbed9977b0f1d815fe7bf86889 100755 +index addc389948378353edb1f24e7416a2a9fbafed14..de2e861859efdcb99a5fd18a6d94efa0d2e17832 100755 --- a/tools/clang/scripts/update.py +++ b/tools/clang/scripts/update.py @@ -286,6 +286,8 @@ def main(): diff --git a/patches/chromium/mas_avoid_usage_of_pthread_fchdir_np.patch b/patches/chromium/mas_avoid_usage_of_pthread_fchdir_np.patch index 39974dd30a4f..5ea6286df620 100644 --- a/patches/chromium/mas_avoid_usage_of_pthread_fchdir_np.patch +++ b/patches/chromium/mas_avoid_usage_of_pthread_fchdir_np.patch @@ -6,7 +6,7 @@ Subject: mas: avoid usage of pthread_fchdir_np Disable usage of pthread_fchdir_np and pthread_chdir_np in MAS builds. diff --git a/base/process/launch_mac.cc b/base/process/launch_mac.cc -index a8713e15329431de6445e7935710d727872fd134..8874c300fd1b556a6eab5c6f20f00e5b2db9f3bc 100644 +index 184cfa25dbc6cfa2a32be3f8d964ea359254f807..c9bfc4d8ca1408206244305d7634dcd51e99377c 100644 --- a/base/process/launch_mac.cc +++ b/base/process/launch_mac.cc @@ -26,8 +26,10 @@ extern "C" { @@ -20,7 +20,7 @@ index a8713e15329431de6445e7935710d727872fd134..8874c300fd1b556a6eab5c6f20f00e5b int responsibility_spawnattrs_setdisclaim(posix_spawnattr_t attrs, int disclaim) API_AVAILABLE(macosx(10.14)); -@@ -95,21 +97,29 @@ class PosixSpawnFileActions { +@@ -96,21 +98,29 @@ class PosixSpawnFileActions { }; int ChangeCurrentThreadDirectory(const char* path) { @@ -50,7 +50,7 @@ index a8713e15329431de6445e7935710d727872fd134..8874c300fd1b556a6eab5c6f20f00e5b } struct GetAppOutputOptions { -@@ -229,11 +239,13 @@ Process LaunchProcess(const std::vector& argv, +@@ -230,11 +240,13 @@ Process LaunchProcess(const std::vector& argv, file_actions.Inherit(STDERR_FILENO); } diff --git a/patches/chromium/mas_disable_remote_accessibility.patch b/patches/chromium/mas_disable_remote_accessibility.patch index f3afdbc13a62..a4a425a4ce4d 100644 --- a/patches/chromium/mas_disable_remote_accessibility.patch +++ b/patches/chromium/mas_disable_remote_accessibility.patch @@ -87,10 +87,10 @@ index c3a9fbf0f9d2b80c1de42a22ad094a286f0b559b..02493d4b62c98a3aebd3e460c459218a DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostNSViewBridgeOwner); }; diff --git a/content/browser/renderer_host/render_widget_host_view_mac.h b/content/browser/renderer_host/render_widget_host_view_mac.h -index 0345506d7ca2a64737109f97524b563dd55ecc3a..3a58d7354feae315fff91ca12339da67f6cf3cfb 100644 +index e7a1a348280c96a31fac75616d6e3034d1863a06..7631c62e2e799770f6abbb9af158235c00ce6185 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.h +++ b/content/browser/renderer_host/render_widget_host_view_mac.h -@@ -48,7 +48,9 @@ class ScopedPasswordInputEnabler; +@@ -49,7 +49,9 @@ class ScopedPasswordInputEnabler; @protocol RenderWidgetHostViewMacDelegate; @@ -100,7 +100,7 @@ index 0345506d7ca2a64737109f97524b563dd55ecc3a..3a58d7354feae315fff91ca12339da67 @class RenderWidgetHostViewCocoa; namespace content { -@@ -653,10 +655,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac +@@ -657,10 +659,12 @@ class CONTENT_EXPORT RenderWidgetHostViewMac // EnsureSurfaceSynchronizedForWebTest(). uint32_t latest_capture_sequence_number_ = 0u; @@ -114,10 +114,10 @@ index 0345506d7ca2a64737109f97524b563dd55ecc3a..3a58d7354feae315fff91ca12339da67 // Used to force the NSApplication's focused accessibility element to be the // content::BrowserAccessibilityCocoa accessibility tree when the NSView for diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm -index d5a4cbe5cf985221451488a0440a63818e85dc87..515d1588c0de8daa503df91338dc3a5c072c5690 100644 +index 922e51e7debac09e5444027c87603d40b972ffc7..5aac5fcfe781e282b748630c07341d1b465d99ac 100644 --- a/content/browser/renderer_host/render_widget_host_view_mac.mm +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm -@@ -240,8 +240,10 @@ +@@ -251,8 +251,10 @@ void RenderWidgetHostViewMac::MigrateNSViewBridge( remote_cocoa::mojom::Application* remote_cocoa_application, uint64_t parent_ns_view_id) { @@ -128,7 +128,7 @@ index d5a4cbe5cf985221451488a0440a63818e85dc87..515d1588c0de8daa503df91338dc3a5c // Disconnect from the previous bridge (this will have the effect of // destroying the associated bridge), and close the receiver (to allow it -@@ -1439,8 +1441,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1469,8 +1471,10 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, gfx::NativeViewAccessible RenderWidgetHostViewMac::AccessibilityGetNativeViewAccessibleForWindow() { @@ -139,7 +139,7 @@ index d5a4cbe5cf985221451488a0440a63818e85dc87..515d1588c0de8daa503df91338dc3a5c return [GetInProcessNSView() window]; } -@@ -1484,9 +1488,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -1514,9 +1518,11 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, } void RenderWidgetHostViewMac::SetAccessibilityWindow(NSWindow* window) { @@ -151,7 +151,7 @@ index d5a4cbe5cf985221451488a0440a63818e85dc87..515d1588c0de8daa503df91338dc3a5c } bool RenderWidgetHostViewMac::SyncIsWidgetForMainFrame( -@@ -1980,12 +1986,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, +@@ -2009,12 +2015,14 @@ void CombineTextNodesAndMakeCallback(SpeechCallback callback, void RenderWidgetHostViewMac::SetRemoteAccessibilityWindowToken( const std::vector& window_token) { @@ -167,7 +167,7 @@ index d5a4cbe5cf985221451488a0440a63818e85dc87..515d1588c0de8daa503df91338dc3a5c /////////////////////////////////////////////////////////////////////////////// diff --git a/ui/base/BUILD.gn b/ui/base/BUILD.gn -index 32d0427d811b2c9b2c2591066c85fdd343850207..f93a10b1e2e37cb0d476ac7bdfa1302cf7864e7b 100644 +index ae61e09deae53071c3a00d054cde3c57a8ac143a..7f91c46cd437f269b76fda383fd2d6ab990d310c 100644 --- a/ui/base/BUILD.gn +++ b/ui/base/BUILD.gn @@ -322,6 +322,13 @@ component("base") { @@ -205,7 +205,7 @@ index e7adfee3210ec723c687adfcc4bee8827ef643e7..25a924a47eeb30d783ef83dbb4896c4b + #endif // UI_BASE_COCOA_REMOTE_ACCESSIBILITY_API_H_ diff --git a/ui/views/cocoa/native_widget_mac_ns_window_host.h b/ui/views/cocoa/native_widget_mac_ns_window_host.h -index 7277159ea1fae7778b6725bc97278a6721872a7e..787f5e072ea9e615bbd67b83ab0e9cc57d05549a 100644 +index 2d6816834ac6ca1f487d889e2a2a1715b8047beb..6369db1564d6f48d5290f356725ccfcafbc045c4 100644 --- a/ui/views/cocoa/native_widget_mac_ns_window_host.h +++ b/ui/views/cocoa/native_widget_mac_ns_window_host.h @@ -30,7 +30,9 @@ @@ -218,7 +218,7 @@ index 7277159ea1fae7778b6725bc97278a6721872a7e..787f5e072ea9e615bbd67b83ab0e9cc5 @class NSView; namespace remote_cocoa { -@@ -425,11 +427,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost +@@ -430,11 +432,13 @@ class VIEWS_EXPORT NativeWidgetMacNSWindowHost mojo::AssociatedRemote remote_ns_window_remote_; diff --git a/patches/chromium/mas_disable_remote_layer.patch b/patches/chromium/mas_disable_remote_layer.patch index 9c54053caa4a..afe2df43d0b7 100644 --- a/patches/chromium/mas_disable_remote_layer.patch +++ b/patches/chromium/mas_disable_remote_layer.patch @@ -16,7 +16,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 c49b1befb9cd7bdcb5982db014ced3203b4fd561..c2a9347da27bc51cc2216520801d410c467f9b0b 100644 +index caeaaf96088709486688ba1ca231b928f600c3f1..27024e051cf9e7424c9187f6af5e3b03ca1edaf2 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 @@ @@ -29,7 +29,7 @@ index c49b1befb9cd7bdcb5982db014ced3203b4fd561..c2a9347da27bc51cc2216520801d410c @class CALayer; namespace ui { -@@ -118,7 +120,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass, +@@ -119,7 +121,9 @@ class ImageTransportSurfaceOverlayMacBase : public BaseClass, base::WeakPtr delegate_; bool use_remote_layer_api_; @@ -40,7 +40,7 @@ index c49b1befb9cd7bdcb5982db014ced3203b4fd561..c2a9347da27bc51cc2216520801d410c 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 d7d7ab38ed248663bf0bb08a72b591c87e0b9459..07e243419f6d52af992fbdd009dce2d08f8adde2 100644 +index 54c5b7bcbe4ead3653bcea1f82ac34212d87392e..d7ce7c04e1fcab4949e1340901aacfac14bb383e 100644 --- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm +++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm @@ -53,7 +53,7 @@ diff --git a/patches/chromium/mas_no_private_api.patch b/patches/chromium/mas_no_private_api.patch index c2b0e40c8547..a8eff25f2f06 100644 --- a/patches/chromium/mas_no_private_api.patch +++ b/patches/chromium/mas_no_private_api.patch @@ -148,10 +148,10 @@ index 4ce4b7ebcf8be625619e6fee0cab4185add42454..eca83c0807e37c36022a29187b1dc1c8 OptionalNSObject MakePairArray(const OptionalNSObject& obj1, const OptionalNSObject& obj2) { diff --git a/content/browser/accessibility/browser_accessibility_cocoa.h b/content/browser/accessibility/browser_accessibility_cocoa.h -index eb62bcb05aa03a8ff0a09c1a5109af2bdb8c66b7..f14557a9ac49488b345bf64747125e51a3cf8139 100644 +index b2da63a5831595944b9e12ba8386167bd0bb6c7c..dac074cc081cc12948f0d9b2e2b89ef1b10cbb66 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.h +++ b/content/browser/accessibility/browser_accessibility_cocoa.h -@@ -161,7 +161,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); +@@ -160,7 +160,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); @property(nonatomic, readonly) NSNumber* enabled; // Returns a text marker that points to the last character in the document that // can be selected with Voiceover. @@ -161,7 +161,7 @@ index eb62bcb05aa03a8ff0a09c1a5109af2bdb8c66b7..f14557a9ac49488b345bf64747125e51 @property(nonatomic, readonly) NSNumber* expanded; @property(nonatomic, readonly) NSNumber* focused; @property(nonatomic, readonly) NSNumber* grabbed; -@@ -173,7 +175,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); +@@ -172,7 +174,9 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); // Index of a row, column, or tree item. @property(nonatomic, readonly) NSNumber* index; @property(nonatomic, readonly) NSNumber* treeItemRowIndex; @@ -171,7 +171,7 @@ index eb62bcb05aa03a8ff0a09c1a5109af2bdb8c66b7..f14557a9ac49488b345bf64747125e51 @property(nonatomic, readonly) NSString* invalid; @property(nonatomic, readonly) NSNumber* isMultiSelectable; @property(nonatomic, readonly) NSString* placeholderValue; -@@ -196,14 +200,18 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); +@@ -195,14 +199,18 @@ id AXTextMarkerRangeFrom(id anchor_text_marker, id focus_text_marker); // The object is selected as a whole. @property(nonatomic, readonly) NSNumber* selected; @property(nonatomic, readonly) NSArray* selectedChildren; @@ -191,7 +191,7 @@ index eb62bcb05aa03a8ff0a09c1a5109af2bdb8c66b7..f14557a9ac49488b345bf64747125e51 // 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 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f8fb9e36e 100644 +index 8ed0e510c5a0381c04c80f12d1ab415ffa6770d8..ad59de0943abe8fa856cf787cec917c1c314cbb4 100644 --- a/content/browser/accessibility/browser_accessibility_cocoa.mm +++ b/content/browser/accessibility/browser_accessibility_cocoa.mm @@ -206,6 +206,7 @@ @@ -281,7 +281,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f {NSAccessibilitySizeAttribute, @"size"}, {NSAccessibilitySortDirectionAttribute, @"sortDirection"}, {NSAccessibilitySubroleAttribute, @"subrole"}, -@@ -1408,6 +1422,7 @@ - (NSNumber*)enabled { +@@ -1412,6 +1426,7 @@ - (NSNumber*)enabled { ax::mojom::Restriction::kDisabled); } @@ -289,7 +289,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f // Returns a text marker that points to the last character in the document that // can be selected with VoiceOver. - (id)endTextMarker { -@@ -1416,6 +1431,7 @@ - (id)endTextMarker { +@@ -1420,6 +1435,7 @@ - (id)endTextMarker { BrowserAccessibility::AXPosition position = _owner->CreateTextPositionAt(0); return CreateTextMarker(position->CreatePositionAtEndOfContent()); } @@ -297,7 +297,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f - (NSNumber*)expanded { if (![self instanceActive]) -@@ -1616,6 +1632,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind +@@ -1620,6 +1636,7 @@ - (bool)findRowIndex:(BrowserAccessibilityCocoa*)toFind return false; } @@ -305,7 +305,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f - (NSNumber*)AXInsertionPointLineNumber { return [self insertionPointLineNumber]; } -@@ -1645,6 +1662,7 @@ - (NSNumber*)insertionPointLineNumber { +@@ -1649,6 +1666,7 @@ - (NSNumber*)insertionPointLineNumber { caretPosition->AsTextPosition()->text_offset()); return @(std::distance(lineBreaks.begin(), iterator)); } @@ -313,7 +313,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f // Returns whether or not this node should be ignored in the // accessibility tree. -@@ -2012,8 +2030,12 @@ - (BOOL)shouldExposeTitleUIElement { +@@ -2016,8 +2034,12 @@ - (BOOL)shouldExposeTitleUIElement { return content::AXTextEdit(newValue, std::u16string(), nil); } } @@ -325,7 +325,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f +#endif } - - (BOOL)instanceActive { + // internal @@ -2346,6 +2368,7 @@ - (NSArray*)selectedChildren { return ret; } @@ -415,7 +415,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f return nil; } -@@ -3971,6 +4005,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { +@@ -3968,6 +4002,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { ->AsTextSelectionPosition())); } } @@ -423,7 +423,7 @@ index 4ad415b3d71dfb8aa419088ef43436003b16a182..8ad9a55531ed17be240986036e0cf42f if ([attribute isEqualToString:NSAccessibilitySelectedTextMarkerRangeAttribute]) { BrowserAccessibility::AXRange range = CreateRangeFromTextMarkerRange(value); -@@ -3981,6 +4016,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { +@@ -3978,6 +4013,7 @@ - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute { range.anchor()->AsTextSelectionPosition(), range.focus()->AsTextSelectionPosition())); } @@ -673,7 +673,7 @@ index e0c31170acd13c9997c6b1d04c6de1420feaf422..0e561f97b33380bfbe52e64c2c4a6988 } // namespace sandbox diff --git a/sandbox/mac/seatbelt_extension.cc b/sandbox/mac/seatbelt_extension.cc -index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595c35cc4dc 100644 +index d59a16112d27e2696437163483c44eca414c225c..1ccd20fe7efa3cbae48f99d0660b025283dd370e 100644 --- a/sandbox/mac/seatbelt_extension.cc +++ b/sandbox/mac/seatbelt_extension.cc @@ -11,6 +11,7 @@ @@ -684,7 +684,7 @@ index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595 // libsandbox private API. extern "C" { extern const char* APP_SANDBOX_READ; -@@ -21,6 +22,7 @@ char* sandbox_extension_issue_file(const char* type, +@@ -22,6 +23,7 @@ char* sandbox_extension_issue_file(const char* type, const char* path, uint32_t flags); } @@ -692,7 +692,7 @@ index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595 namespace sandbox { -@@ -49,7 +51,11 @@ std::unique_ptr SeatbeltExtension::FromToken( +@@ -50,7 +52,11 @@ std::unique_ptr SeatbeltExtension::FromToken( bool SeatbeltExtension::Consume() { DCHECK(!token_.empty()); @@ -704,7 +704,7 @@ index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595 return handle_ > 0; } -@@ -61,7 +67,11 @@ bool SeatbeltExtension::ConsumePermanently() { +@@ -62,7 +68,11 @@ bool SeatbeltExtension::ConsumePermanently() { } bool SeatbeltExtension::Revoke() { @@ -716,7 +716,7 @@ index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595 handle_ = 0; token_.clear(); return rv == 0; -@@ -79,9 +89,11 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token) +@@ -80,12 +90,14 @@ SeatbeltExtension::SeatbeltExtension(const std::string& token) char* SeatbeltExtension::IssueToken(SeatbeltExtension::Type type, const std::string& resource) { switch (type) { @@ -724,6 +724,9 @@ index 84c7370a3bb98aa29cdc04730a25148c3adc162a..5175c2c210e13e41224ae7268528c595 case FILE_READ: return sandbox_extension_issue_file(APP_SANDBOX_READ, resource.c_str(), 0); + case FILE_READ_WRITE: + return sandbox_extension_issue_file(APP_SANDBOX_READ_WRITE, + resource.c_str(), 0); +#endif default: NOTREACHED(); diff --git a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch b/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch index d2623506fc3b..201983be5312 100644 --- a/patches/chromium/network_service_allow_remote_certificate_verification_logic.patch +++ b/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 13b458774a9b36388e2079231c786e38354974bc..3896a834cbb17bfe6ecfc602886ea7d77d7d5167 100644 +index 2dda0e753a89fcbf446212f429e90659ca289bf0..7bd73dae3a77cb16cf282d2df7f4ff7a8f412805 100644 --- a/services/network/network_context.cc +++ b/services/network/network_context.cc @@ -118,6 +118,11 @@ @@ -116,7 +116,7 @@ index 13b458774a9b36388e2079231c786e38354974bc..3896a834cbb17bfe6ecfc602886ea7d7 void NetworkContext::CreateURLLoaderFactory( mojo::PendingReceiver receiver, mojom::URLLoaderFactoryParamsPtr params) { -@@ -2078,6 +2163,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( +@@ -2085,6 +2170,9 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext( std::move(cert_verifier)); cert_verifier = base::WrapUnique(cert_verifier_with_trust_anchors_); #endif // BUILDFLAG(IS_CHROMEOS_ASH) @@ -127,7 +127,7 @@ index 13b458774a9b36388e2079231c786e38354974bc..3896a834cbb17bfe6ecfc602886ea7d7 builder.SetCertVerifier(IgnoreErrorsCertVerifier::MaybeWrapCertVerifier( diff --git a/services/network/network_context.h b/services/network/network_context.h -index dedd877897901bec01e1cc55519a3c2ca656cd9b..00bcb6e3b31b7e61a36c6df96d39cd0d5cc5e28a 100644 +index 9339c55c5e818a2a7bd8800d9b1cb64553369c24..049c8e5e0e34454f03a823b31a5f7755d67cfb07 100644 --- a/services/network/network_context.h +++ b/services/network/network_context.h @@ -99,6 +99,7 @@ class DomainReliabilityMonitor; @@ -147,7 +147,7 @@ index dedd877897901bec01e1cc55519a3c2ca656cd9b..00bcb6e3b31b7e61a36c6df96d39cd0d void ResetURLLoaderFactories() override; void GetCookieManager( mojo::PendingReceiver receiver) override; -@@ -741,6 +744,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext +@@ -743,6 +746,8 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) NetworkContext CertVerifierWithTrustAnchors* cert_verifier_with_trust_anchors_ = nullptr; #endif @@ -157,11 +157,11 @@ index dedd877897901bec01e1cc55519a3c2ca656cd9b..00bcb6e3b31b7e61a36c6df96d39cd0d // CertNetFetcher is not used by the current platform, or if the actual // net::CertVerifier is instantiated outside of the network service. diff --git a/services/network/public/mojom/network_context.mojom b/services/network/public/mojom/network_context.mojom -index 0d84746e3495fd233db239d97d5a71ab8daa43ac..9a4ab0a7493688e31acd119b816de69bfb47d9d7 100644 +index 6d2ab194fd2330426f56602cd2e586f096750acd..d8e7d0d35317fe1124bf81f60faf2b35ae19a3d7 100644 --- a/services/network/public/mojom/network_context.mojom +++ b/services/network/public/mojom/network_context.mojom -@@ -232,6 +232,17 @@ struct NetworkContextFilePaths { - mojo_base.mojom.FilePath? reporting_and_nel_store_database_name; +@@ -265,6 +265,17 @@ struct NetworkContextFilePaths { + bool trigger_migration = false; }; +interface CertVerifierClient { @@ -177,8 +177,8 @@ index 0d84746e3495fd233db239d97d5a71ab8daa43ac..9a4ab0a7493688e31acd119b816de69b + // Parameters for constructing a network context. struct NetworkContextParams { - // Name used by memory tools to identify the context. -@@ -743,6 +754,9 @@ interface NetworkContext { + // The user agent string. +@@ -773,6 +784,9 @@ interface NetworkContext { // Sets a client for this network context. SetClient(pending_remote client); diff --git a/patches/chromium/notification_provenance.patch b/patches/chromium/notification_provenance.patch index 3ce3ecc25452..0a6ee6c36820 100644 --- a/patches/chromium/notification_provenance.patch +++ b/patches/chromium/notification_provenance.patch @@ -7,10 +7,10 @@ Pass RenderProcessHost through to PlatformNotificationService so Electron can identify which renderer a notification came from. diff --git a/content/browser/notifications/blink_notification_service_impl.cc b/content/browser/notifications/blink_notification_service_impl.cc -index 3dab156adf61f0bb242fe00a49629d6f8ae4ed31..8e1c173d4bece733711b0bed6b7b9d9d7280508b 100644 +index 442b856f8bcfbcea7742188897f0ce0a25cd60f4..6165eb772901faa25514c9bbefd13ff6b45d6b33 100644 --- a/content/browser/notifications/blink_notification_service_impl.cc +++ b/content/browser/notifications/blink_notification_service_impl.cc -@@ -89,10 +89,12 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl( +@@ -81,10 +81,12 @@ BlinkNotificationServiceImpl::BlinkNotificationServiceImpl( PlatformNotificationContextImpl* notification_context, BrowserContext* browser_context, scoped_refptr service_worker_context, @@ -23,14 +23,13 @@ index 3dab156adf61f0bb242fe00a49629d6f8ae4ed31..8e1c173d4bece733711b0bed6b7b9d9d browser_context_(browser_context), service_worker_context_(std::move(service_worker_context)), origin_(origin), -@@ -155,7 +157,8 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification( +@@ -147,7 +149,7 @@ void BlinkNotificationServiceImpl::DisplayNonPersistentNotification( notification_id, std::move(event_listener_remote)); - GetNotificationService(browser_context_) -- ->DisplayNotification(notification_id, origin_.GetURL(), document_url_, -+ ->DisplayNotification(render_frame_host_, notification_id, -+ origin_.GetURL(), document_url_, - platform_notification_data, notification_resources); + browser_context_->GetPlatformNotificationService()->DisplayNotification( +- notification_id, origin_.GetURL(), document_url_, ++ render_frame_host_, notification_id, origin_.GetURL(), document_url_, + platform_notification_data, notification_resources); } diff --git a/content/browser/notifications/blink_notification_service_impl.h b/content/browser/notifications/blink_notification_service_impl.h @@ -54,10 +53,10 @@ index 19c2beb1f1949f0dc4466a8728f151c035544b24..f7aa5f94d6dea0e6b2c1107b8ef01600 scoped_refptr service_worker_context_; diff --git a/content/browser/notifications/blink_notification_service_impl_unittest.cc b/content/browser/notifications/blink_notification_service_impl_unittest.cc -index 25a35dc7647d8bcb503c9b023bd912a5c0542877..cea756feb06f1b0ee1f7f5bd8b68fd4ddaaedaa6 100644 +index 740b591e68522f211177f4578d8cd3b9aa49f152..6190edab32f373a8076820eac943afb1c6bebe99 100644 --- a/content/browser/notifications/blink_notification_service_impl_unittest.cc +++ b/content/browser/notifications/blink_notification_service_impl_unittest.cc -@@ -140,7 +140,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test { +@@ -122,7 +122,7 @@ class BlinkNotificationServiceImplTest : public ::testing::Test { notification_service_ = std::make_unique( notification_context_.get(), &browser_context_, @@ -67,10 +66,10 @@ index 25a35dc7647d8bcb503c9b023bd912a5c0542877..cea756feb06f1b0ee1f7f5bd8b68fd4d /*document_url=*/GURL(), notification_service_remote_.BindNewPipeAndPassReceiver()); diff --git a/content/browser/notifications/platform_notification_context_impl.cc b/content/browser/notifications/platform_notification_context_impl.cc -index 0a967ad0f3e649e997e596dde2368a2309779874..0e52ad1497b6b787a7db3253083da45ffddb7736 100644 +index 32f66cfb52ae240f5a8311779421f01920a31bb2..128355a4791ebb68045522627a5a8db183c1c070 100644 --- a/content/browser/notifications/platform_notification_context_impl.cc +++ b/content/browser/notifications/platform_notification_context_impl.cc -@@ -284,13 +284,14 @@ void PlatformNotificationContextImpl::Shutdown() { +@@ -282,13 +282,14 @@ void PlatformNotificationContextImpl::Shutdown() { } void PlatformNotificationContextImpl::CreateService( @@ -108,10 +107,10 @@ index 78f9ab684d2eeef9a647d82ccb39c1b208e999d4..d55a4e51a0d263ec07ca115715cccc30 const GURL& document_url, mojo::PendingReceiver receiver); diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index b96ad3f8b173d0425069dbb6ec5ea4e3690fd0fb..ca49f2c9de55e95024e5ff680794e09a53061ffd 100644 +index f788e63de17e478ad749c61a2744747ef59af75a..d64ad2d8d3a9515768d82ff02e7be26383dd5b66 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -2270,7 +2270,7 @@ void RenderProcessHostImpl::CreateNotificationService( +@@ -2273,7 +2273,7 @@ void RenderProcessHostImpl::CreateNotificationService( document_url = rfh->GetLastCommittedURL(); storage_partition_impl_->GetPlatformNotificationContext()->CreateService( diff --git a/patches/chromium/pepper_plugin_support.patch b/patches/chromium/pepper_plugin_support.patch index 354f4999ba37..27dabc2d1588 100644 --- a/patches/chromium/pepper_plugin_support.patch +++ b/patches/chromium/pepper_plugin_support.patch @@ -213,7 +213,7 @@ index 60cfd89dfd18eced6f6d103267b80d547d2e9f26..95d36e99832f434d878a2a2fc3101a61 return nullptr; } diff --git a/chrome/renderer/pepper/pepper_helper.h b/chrome/renderer/pepper/pepper_helper.h -index e021c964da3d467530775164a67d5cadaf6dc741..e035f0fb9e2baa6a9148b43765b09c52bc45599b 100644 +index 0f67ff54227f1a49314592188d719feeb27ae2cf..14fce2e8f9dcbd5273784aaf561a45cb1df19d42 100644 --- a/chrome/renderer/pepper/pepper_helper.h +++ b/chrome/renderer/pepper/pepper_helper.h @@ -6,12 +6,14 @@ @@ -231,4 +231,4 @@ index e021c964da3d467530775164a67d5cadaf6dc741..e035f0fb9e2baa6a9148b43765b09c52 + : public content::RenderFrameObserver { public: explicit PepperHelper(content::RenderFrame* render_frame); - ~PepperHelper() override; + diff --git a/patches/chromium/picture-in-picture.patch b/patches/chromium/picture-in-picture.patch index 79a15130a111..5377b0878be1 100644 --- a/patches/chromium/picture-in-picture.patch +++ b/patches/chromium/picture-in-picture.patch @@ -61,12 +61,12 @@ index 7b711bdbaf4afddd6ccf300af7bab26487942243..987a60b81554b676661d8f1a53facbc9 #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/paint_vector_icon.h" diff --git a/chrome/browser/ui/views/overlay/overlay_window_views.cc b/chrome/browser/ui/views/overlay/overlay_window_views.cc -index 5464e3e8ced91bbeba197d5d31e37b6c3e993076..1e2295b1611df0091cad60ec2bf7371e9536c9b5 100644 +index 3db862e69264ddf9e850f1354fce402a3e920b75..4a667a2bbd2d36d275438b63c56fa219e79631f6 100644 --- a/chrome/browser/ui/views/overlay/overlay_window_views.cc +++ b/chrome/browser/ui/views/overlay/overlay_window_views.cc -@@ -16,9 +16,11 @@ +@@ -15,9 +15,11 @@ + #include "base/timer/timer.h" #include "build/build_config.h" - #include "build/chromeos_buildflags.h" #include "chrome/app/vector_icons/vector_icons.h" +#if 0 #include "chrome/browser/profiles/profile.h" @@ -76,7 +76,7 @@ index 5464e3e8ced91bbeba197d5d31e37b6c3e993076..1e2295b1611df0091cad60ec2bf7371e #include "chrome/browser/ui/views/overlay/back_to_tab_image_button.h" #include "chrome/browser/ui/views/overlay/back_to_tab_label_button.h" #include "chrome/browser/ui/views/overlay/close_image_button.h" -@@ -29,7 +31,8 @@ +@@ -28,7 +30,8 @@ #include "chrome/browser/ui/views/overlay/toggle_camera_button.h" #include "chrome/browser/ui/views/overlay/toggle_microphone_button.h" #include "chrome/browser/ui/views/overlay/track_image_button.h" @@ -86,7 +86,7 @@ index 5464e3e8ced91bbeba197d5d31e37b6c3e993076..1e2295b1611df0091cad60ec2bf7371e #include "components/vector_icons/vector_icons.h" #include "content/public/browser/picture_in_picture_window_controller.h" #include "content/public/browser/web_contents.h" -@@ -57,7 +60,7 @@ +@@ -56,7 +59,7 @@ #include "ui/aura/window.h" #endif @@ -95,7 +95,7 @@ index 5464e3e8ced91bbeba197d5d31e37b6c3e993076..1e2295b1611df0091cad60ec2bf7371e #include "chrome/browser/shell_integration_win.h" #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" -@@ -246,7 +249,7 @@ std::unique_ptr OverlayWindowViews::Create( +@@ -249,7 +252,7 @@ std::unique_ptr OverlayWindowViews::Create( overlay_window->Init(std::move(params)); overlay_window->OnRootViewReady(); diff --git a/patches/chromium/printing.patch b/patches/chromium/printing.patch index e3493c43bf66..58356d22f558 100644 --- a/patches/chromium/printing.patch +++ b/patches/chromium/printing.patch @@ -11,10 +11,26 @@ majority of changes originally come from these PRs: This patch also fixes callback for manual user cancellation and success. diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc -index bca04dcd90921e508fb0e5c8201265532e42e88f..345547f382c8984ea29483b84475c120aa58e19b 100644 +index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd103939429beeb 100644 --- a/chrome/browser/printing/print_job.cc +++ b/chrome/browser/printing/print_job.cc -@@ -350,18 +350,25 @@ void PrintJob::StartPdfToEmfConversion( +@@ -89,6 +89,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) { + return base::FeatureList::IsEnabled(features::kPrintWithReducedRasterization); + } + ++#if 0 + PrefService* GetPrefsForWebContents(content::WebContents* web_contents) { + // TODO(thestig): Figure out why crbug.com/1083911 occurred, which is likely + // because `web_contents` was null. As a result, this section has many more +@@ -97,6 +98,7 @@ PrefService* GetPrefsForWebContents(content::WebContents* web_contents) { + web_contents ? web_contents->GetBrowserContext() : nullptr; + return context ? Profile::FromBrowserContext(context)->GetPrefs() : nullptr; + } ++#endif + + #endif // defined(OS_WIN) + +@@ -381,11 +383,18 @@ void PrintJob::StartPdfToEmfConversion( // seems to work with the fix for this bug applied. const PrintSettings& settings = document()->settings(); bool print_text_with_gdi = @@ -27,22 +43,27 @@ index bca04dcd90921e508fb0e5c8201265532e42e88f..345547f382c8984ea29483b84475c120 + && !settings.printer_language_is_xps() && base::FeatureList::IsEnabled(::features::kGdiTextPrinting); - // TODO(thestig): Figure out why crbug.com/1083911 occurred, which is likely - // because `web_contents` was null. As a result, this section has many more - // pointer checks to avoid crashing. +#if 0 - content::WebContents* web_contents = worker_->GetWebContents(); - content::BrowserContext* context = - web_contents ? web_contents->GetBrowserContext() : nullptr; - PrefService* prefs = - context ? Profile::FromBrowserContext(context)->GetPrefs() : nullptr; + PrefService* prefs = GetPrefsForWebContents(worker_->GetWebContents()); - bool print_with_reduced_rasterization = PrintWithReducedRasterization(prefs); +#endif + bool print_with_reduced_rasterization = PrintWithReducedRasterization(nullptr); using RenderMode = PdfRenderSettings::Mode; RenderMode mode; -@@ -499,6 +506,10 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) { +@@ -480,8 +489,10 @@ void PrintJob::StartPdfToPostScriptConversion( + if (ps_level2) { + mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2; + } else { ++#if 0 + PrefService* prefs = GetPrefsForWebContents(worker_->GetWebContents()); +- mode = PrintWithPostScriptType42Fonts(prefs) ++#endif ++ mode = PrintWithPostScriptType42Fonts(nullptr) + ? PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3_WITH_TYPE42_FONTS + : PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3; + } +@@ -531,6 +542,10 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) { DCHECK_CURRENTLY_ON(content::BrowserThread::UI); switch (event_details.type()) { @@ -68,7 +89,7 @@ index b8b83529be4c7da661032d3b941984c02b978047..98ef6cfad5dc46d9dcb65a0ce506db37 NEW_DOC, diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc -index 2824b97e715a493082734d40f62860c8cafa5f34..584d4ef2b73a0f89458224eb134a8d8a2b439995 100644 +index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700bf05600c3 100644 --- a/chrome/browser/printing/print_job_worker.cc +++ b/chrome/browser/printing/print_job_worker.cc @@ -21,13 +21,13 @@ @@ -86,7 +107,7 @@ index 2824b97e715a493082734d40f62860c8cafa5f34..584d4ef2b73a0f89458224eb134a8d8a #include "printing/backend/print_backend.h" #include "printing/mojom/print.mojom.h" #include "printing/print_job_constants.h" -@@ -238,16 +238,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings, +@@ -240,16 +240,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings, #endif // defined(OS_LINUX) && defined(USE_CUPS) } @@ -111,7 +132,7 @@ index 2824b97e715a493082734d40f62860c8cafa5f34..584d4ef2b73a0f89458224eb134a8d8a } #if defined(OS_CHROMEOS) -@@ -263,6 +268,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD( +@@ -265,6 +270,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD( void PrintJobWorker::GetSettingsDone(SettingsCallback callback, PrintingContext::Result result) { @@ -366,7 +387,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f if (!cookie) { diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h -index eaa0e162a339ba68d42c920fdd30869d259b4f27..8381f5171970aa89fc5c406d57d2665e16c6678b 100644 +index 24ffeb0a87b2e324f84260eb4ec65021998ee2c3..872008c7ffd5298dc3cc8d1b52be6113104ce49c 100644 --- a/chrome/browser/printing/print_view_manager_base.h +++ b/chrome/browser/printing/print_view_manager_base.h @@ -38,6 +38,8 @@ class PrintJob; @@ -378,7 +399,7 @@ index eaa0e162a339ba68d42c920fdd30869d259b4f27..8381f5171970aa89fc5c406d57d2665e // Base class for managing the print commands for a WebContents. class PrintViewManagerBase : public content::NotificationObserver, public PrintManager { -@@ -47,7 +49,10 @@ class PrintViewManagerBase : public content::NotificationObserver, +@@ -50,7 +52,10 @@ class PrintViewManagerBase : public content::NotificationObserver, // Prints the current document immediately. Since the rendering is // asynchronous, the actual printing will not be completed on the return of // this function. Returns false if printing is impossible at the moment. @@ -390,7 +411,7 @@ index eaa0e162a339ba68d42c920fdd30869d259b4f27..8381f5171970aa89fc5c406d57d2665e #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Prints the document in |print_data| with settings specified in -@@ -234,9 +239,15 @@ class PrintViewManagerBase : public content::NotificationObserver, +@@ -237,9 +242,15 @@ class PrintViewManagerBase : public content::NotificationObserver, // The current RFH that is printing with a system printing dialog. content::RenderFrameHost* printing_rfh_ = nullptr; @@ -617,7 +638,7 @@ index 90236920457c931c86426049c6cbc30b592b597f..353178863eba37b9112e784ffa4b3519 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) // Set options for print preset from source PDF document. diff --git a/printing/printing_context.cc b/printing/printing_context.cc -index 7f617267b4eefd6d7cf9db6a56aaffad5035bab4..df79c62570f02f581ecb69ab3c03eeebfc43c50e 100644 +index 744c3acfb9637aa64785dabd041ee416d56c3e43..9dadda9dfecdcf7826a3766064530a10126df66b 100644 --- a/printing/printing_context.cc +++ b/printing/printing_context.cc @@ -115,7 +115,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() { @@ -629,10 +650,10 @@ index 7f617267b4eefd6d7cf9db6a56aaffad5035bab4..df79c62570f02f581ecb69ab3c03eeeb std::unique_ptr settings = PrintSettingsFromJobSettings(job_settings); diff --git a/printing/printing_context.h b/printing/printing_context.h -index 3f83f961ca953d1a6fe544a49e3a3d7addaf6c50..7a639e7d2975fa8d033ea32f371e3b6539ea0c7e 100644 +index 753bc1d564d607b4be671c3c618e1b60f8e7bb3f..c60136097403e9b5930917433064b57ba5771a3b 100644 --- a/printing/printing_context.h +++ b/printing/printing_context.h -@@ -145,6 +145,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { +@@ -149,6 +149,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { int job_id() const { return job_id_; } @@ -642,7 +663,7 @@ index 3f83f961ca953d1a6fe544a49e3a3d7addaf6c50..7a639e7d2975fa8d033ea32f371e3b65 protected: explicit PrintingContext(Delegate* delegate); -@@ -152,9 +155,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { +@@ -156,9 +159,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext { // implement this method to create an object of their implementation. static std::unique_ptr CreateImpl(Delegate* delegate); diff --git a/patches/chromium/process_singleton.patch b/patches/chromium/process_singleton.patch index 1051dfe5dd15..9aed592f9bee 100644 --- a/patches/chromium/process_singleton.patch +++ b/patches/chromium/process_singleton.patch @@ -25,10 +25,10 @@ This patch adds a few changes to the Chromium code: before the browser thread is ready. diff --git a/chrome/browser/process_singleton.h b/chrome/browser/process_singleton.h -index 0291db0f919aa7868d345f4f0712c42c6ad7ee17..9418bbacb11094628c4468d0a7b735a0f742e5f2 100644 +index 0d7c1db6489d95a40c66808c3f838b0740e46ff6..eec994c4252f17d9c9c41e66d5dae6509ed98a18 100644 --- a/chrome/browser/process_singleton.h +++ b/chrome/browser/process_singleton.h -@@ -103,8 +103,15 @@ class ProcessSingleton { +@@ -103,12 +103,19 @@ class ProcessSingleton { base::RepeatingCallback; @@ -40,11 +40,15 @@ index 0291db0f919aa7868d345f4f0712c42c6ad7ee17..9418bbacb11094628c4468d0a7b735a0 +#else ProcessSingleton(const base::FilePath& user_data_dir, const NotificationCallback& notification_callback); + + ProcessSingleton(const ProcessSingleton&) = delete; + ProcessSingleton& operator=(const ProcessSingleton&) = delete; + +#endif ~ProcessSingleton(); // Notify another process, if available. Otherwise sets ourselves as the -@@ -115,6 +122,8 @@ class ProcessSingleton { +@@ -119,6 +126,8 @@ class ProcessSingleton { // TODO(brettw): Make the implementation of this method non-platform-specific // by making Linux re-use the Windows implementation. NotifyResult NotifyOtherProcessOrCreate(); @@ -53,7 +57,7 @@ index 0291db0f919aa7868d345f4f0712c42c6ad7ee17..9418bbacb11094628c4468d0a7b735a0 // Sets ourself up as the singleton instance. Returns true on success. If // false is returned, we are not the singleton instance and the caller must -@@ -170,6 +179,8 @@ class ProcessSingleton { +@@ -174,6 +183,8 @@ class ProcessSingleton { #if defined(OS_WIN) bool EscapeVirtualization(const base::FilePath& user_data_dir); @@ -62,7 +66,7 @@ index 0291db0f919aa7868d345f4f0712c42c6ad7ee17..9418bbacb11094628c4468d0a7b735a0 HWND remote_window_; // The HWND_MESSAGE of another browser. base::win::MessageWindow window_; // The message-only window. bool is_virtualized_; // Stuck inside Microsoft Softricity VM environment. -@@ -219,6 +230,8 @@ class ProcessSingleton { +@@ -223,6 +234,8 @@ class ProcessSingleton { // because it posts messages between threads. class LinuxWatcher; scoped_refptr watcher_; @@ -72,7 +76,7 @@ index 0291db0f919aa7868d345f4f0712c42c6ad7ee17..9418bbacb11094628c4468d0a7b735a0 #if defined(OS_MAC) diff --git a/chrome/browser/process_singleton_posix.cc b/chrome/browser/process_singleton_posix.cc -index dc9c1b76a1c7c8b3fa83fc83788eef36d2cfa4a5..31b387ca3cae53c94d8a7baefaeb17f3dbffe5e0 100644 +index 6ae3d8b4a2aef0852fa5cec5a8800aa534da06a1..05c86df6c871ca7d0926836edc2f6137fcf229cb 100644 --- a/chrome/browser/process_singleton_posix.cc +++ b/chrome/browser/process_singleton_posix.cc @@ -80,6 +80,7 @@ @@ -135,7 +139,7 @@ index dc9c1b76a1c7c8b3fa83fc83788eef36d2cfa4a5..31b387ca3cae53c94d8a7baefaeb17f3 bool ConnectSocket(ScopedSocket* socket, const base::FilePath& socket_path, const base::FilePath& cookie_path) { -@@ -727,6 +749,10 @@ ProcessSingleton::ProcessSingleton( +@@ -728,6 +750,10 @@ ProcessSingleton::ProcessSingleton( ProcessSingleton::~ProcessSingleton() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); @@ -146,7 +150,7 @@ index dc9c1b76a1c7c8b3fa83fc83788eef36d2cfa4a5..31b387ca3cae53c94d8a7baefaeb17f3 } ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcess() { -@@ -895,6 +921,20 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { +@@ -896,6 +922,20 @@ ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessOrCreate() { base::TimeDelta::FromSeconds(kTimeoutInSeconds)); } @@ -167,7 +171,7 @@ index dc9c1b76a1c7c8b3fa83fc83788eef36d2cfa4a5..31b387ca3cae53c94d8a7baefaeb17f3 ProcessSingleton::NotifyResult ProcessSingleton::NotifyOtherProcessWithTimeoutOrCreate( const base::CommandLine& command_line, -@@ -997,12 +1037,26 @@ bool ProcessSingleton::Create() { +@@ -998,12 +1038,26 @@ bool ProcessSingleton::Create() { #endif } @@ -200,7 +204,7 @@ index dc9c1b76a1c7c8b3fa83fc83788eef36d2cfa4a5..31b387ca3cae53c94d8a7baefaeb17f3 } // Check that the directory was created with the correct permissions. -@@ -1044,10 +1098,13 @@ bool ProcessSingleton::Create() { +@@ -1045,10 +1099,13 @@ bool ProcessSingleton::Create() { if (listen(sock, 5) < 0) NOTREACHED() << "listen failed: " << base::safe_strerror(errno); @@ -219,10 +223,10 @@ index dc9c1b76a1c7c8b3fa83fc83788eef36d2cfa4a5..31b387ca3cae53c94d8a7baefaeb17f3 return true; } diff --git a/chrome/browser/process_singleton_win.cc b/chrome/browser/process_singleton_win.cc -index f1732f042c3bfd9d5d95a4208664f9252b2aab73..875269776e45c96ac43a3430768f1406c9608dd3 100644 +index e7cc3c5bc7912b27f1f8ce0fb8f691e28284e238..19d5659d665321da54e05cee01be7da02e0c283b 100644 --- a/chrome/browser/process_singleton_win.cc +++ b/chrome/browser/process_singleton_win.cc -@@ -27,7 +27,9 @@ +@@ -28,7 +28,9 @@ #include "base/win/windows_version.h" #include "base/win/wmi.h" #include "chrome/browser/shell_integration.h" @@ -232,7 +236,7 @@ index f1732f042c3bfd9d5d95a4208664f9252b2aab73..875269776e45c96ac43a3430768f1406 #include "chrome/browser/win/chrome_process_finder.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" -@@ -175,10 +177,15 @@ bool ProcessLaunchNotification( +@@ -180,10 +182,15 @@ bool ProcessLaunchNotification( } bool DisplayShouldKillMessageBox() { @@ -248,7 +252,7 @@ index f1732f042c3bfd9d5d95a4208664f9252b2aab73..875269776e45c96ac43a3430768f1406 } void SendRemoteProcessInteractionResultHistogram( -@@ -260,9 +267,13 @@ bool ProcessSingleton::EscapeVirtualization( +@@ -265,9 +272,13 @@ bool ProcessSingleton::EscapeVirtualization( } ProcessSingleton::ProcessSingleton( @@ -262,7 +266,7 @@ index f1732f042c3bfd9d5d95a4208664f9252b2aab73..875269776e45c96ac43a3430768f1406 is_virtualized_(false), lock_file_(INVALID_HANDLE_VALUE), user_data_dir_(user_data_dir), -@@ -366,11 +377,14 @@ ProcessSingleton::NotifyOtherProcessOrCreate() { +@@ -372,11 +383,14 @@ ProcessSingleton::NotifyOtherProcessOrCreate() { return PROFILE_IN_USE; } @@ -278,7 +282,7 @@ index f1732f042c3bfd9d5d95a4208664f9252b2aab73..875269776e45c96ac43a3430768f1406 remote_window_ = chrome::FindRunningChromeWindow(user_data_dir_); if (!remote_window_ && !EscapeVirtualization(user_data_dir_)) { -@@ -379,7 +393,7 @@ bool ProcessSingleton::Create() { +@@ -385,7 +399,7 @@ bool ProcessSingleton::Create() { // access. As documented, it's clearer to NOT request ownership on creation // since it isn't guaranteed we will get it. It is better to create it // without ownership and explicitly get the ownership afterward. @@ -287,7 +291,7 @@ index f1732f042c3bfd9d5d95a4208664f9252b2aab73..875269776e45c96ac43a3430768f1406 if (!only_me.IsValid()) { DPLOG(FATAL) << "CreateMutex failed"; return false; -@@ -418,6 +432,17 @@ bool ProcessSingleton::Create() { +@@ -424,6 +438,17 @@ bool ProcessSingleton::Create() { window_.CreateNamed(base::BindRepeating(&ProcessLaunchNotification, notification_callback_), user_data_dir_.value()); diff --git a/patches/chromium/proxy_config_monitor.patch b/patches/chromium/proxy_config_monitor.patch index c3481a475682..41f8386e260c 100644 --- a/patches/chromium/proxy_config_monitor.patch +++ b/patches/chromium/proxy_config_monitor.patch @@ -67,7 +67,7 @@ index 55cc762b92193ed3f65b4d0b562202869530e1ac..d4c2a4e49eb469d3e2278fdc972c0aed } #endif diff --git a/chrome/browser/net/proxy_config_monitor.h b/chrome/browser/net/proxy_config_monitor.h -index abffb6dbdbf730e2cc4423eaca6a9a8a9f8af582..7fe1badcdebebce9028825ac98d7ab6cfa65dcdd 100644 +index 920a956bce5a24c511df293f4156e33c2455e911..413f8f17ff98038ee4b5dc5dd085257009e7b6bb 100644 --- a/chrome/browser/net/proxy_config_monitor.h +++ b/chrome/browser/net/proxy_config_monitor.h @@ -40,11 +40,12 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer, @@ -84,12 +84,12 @@ index abffb6dbdbf730e2cc4423eaca6a9a8a9f8af582..7fe1badcdebebce9028825ac98d7ab6c // Creates a ProxyConfigMonitor that gets proxy settings from the // |local_state|, for use with NetworkContexts not // associated with a profile. Must be destroyed before |local_state|. -@@ -91,7 +92,7 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer, +@@ -94,7 +95,7 @@ class ProxyConfigMonitor : public net::ProxyConfigService::Observer, #if BUILDFLAG(ENABLE_EXTENSIONS) mojo::ReceiverSet error_receiver_set_; - Profile* profile_ = nullptr; + // Profile* profile_ = nullptr; #endif + }; - DISALLOW_COPY_AND_ASSIGN(ProxyConfigMonitor); diff --git a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch index 5795db0123af..3161da5d563f 100644 --- a/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch +++ b/patches/chromium/refactor_expose_cursor_changes_to_the_webcontentsobserver.patch @@ -8,7 +8,7 @@ Chrome moved the SetCursor IPC message to mojo, which we use to tell OSR about ` Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2172779 diff --git a/content/browser/renderer_host/render_widget_host_delegate.h b/content/browser/renderer_host/render_widget_host_delegate.h -index 0abf9abd6a02dd13742148596d4729af8b8d967b..23560bbf3acf688045cc25f1e4289ef4c1f6552b 100644 +index f540ea381e9b80fd4a8e1e6a4fe4ed577396feb2..b7328fa53fa1c241dc90e9613b33a38cd2810706 100644 --- a/content/browser/renderer_host/render_widget_host_delegate.h +++ b/content/browser/renderer_host/render_widget_host_delegate.h @@ -14,6 +14,7 @@ @@ -19,7 +19,7 @@ index 0abf9abd6a02dd13742148596d4729af8b8d967b..23560bbf3acf688045cc25f1e4289ef4 #include "content/public/common/drop_data.h" #include "services/metrics/public/cpp/ukm_recorder.h" #include "third_party/abseil-cpp/absl/types/optional.h" -@@ -242,6 +243,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate { +@@ -247,6 +248,9 @@ class CONTENT_EXPORT RenderWidgetHostDelegate { // Returns the associated RenderViewHostDelegateView*, if possible. virtual RenderViewHostDelegateView* GetDelegateView(); @@ -30,10 +30,10 @@ index 0abf9abd6a02dd13742148596d4729af8b8d967b..23560bbf3acf688045cc25f1e4289ef4 // RenderWidgetHost on the main frame, and false otherwise. virtual bool IsWidgetForMainFrame(RenderWidgetHostImpl*); diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index b72e3f6ab2a43e8a7f707e9634fb3a4abb87e993..68536fc453f85089b6bc8d3c58b24212ed42cc93 100644 +index a1632e19959d163eecafef484204aa0dba919897..d7189a47e37a5ce2a48ffdb0685016aa0eeb200b 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -2009,6 +2009,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) { +@@ -2012,6 +2012,8 @@ void RenderWidgetHostImpl::FilterDropData(DropData* drop_data) { void RenderWidgetHostImpl::SetCursor(const ui::Cursor& cursor) { if (view_) view_->UpdateCursor(WebCursor(cursor)); @@ -43,10 +43,10 @@ index b72e3f6ab2a43e8a7f707e9634fb3a4abb87e993..68536fc453f85089b6bc8d3c58b24212 void RenderWidgetHostImpl::ShowContextMenuAtPoint( diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc -index 0ba0990cf02624cc7cf1b304a0d9b63692cd464d..bc84aa5826d4ca8aef8f496acd3569152007b7a8 100644 +index 5a86229bf1fc52e6cccbf609ed029fe88d35cd8f..ad1b4abe0390215e007ad2db8d972661470e94ed 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -4307,6 +4307,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { +@@ -4302,6 +4302,11 @@ TextInputManager* WebContentsImpl::GetTextInputManager() { return text_input_manager_.get(); } @@ -59,10 +59,10 @@ index 0ba0990cf02624cc7cf1b304a0d9b63692cd464d..bc84aa5826d4ca8aef8f496acd356915 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 1d749125dba6a4051ff8a147ef7a990d7523707b..4fa272275ba3883d105ddfd8deeb4987071d1b06 100644 +index 2eaec6f5ddbc04f75207348e0f09e34c57a0c3b7..97e6ccbfbd58482299a831c63573890d1f7d46f3 100644 --- a/content/browser/web_contents/web_contents_impl.h +++ b/content/browser/web_contents/web_contents_impl.h -@@ -949,6 +949,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, +@@ -947,6 +947,7 @@ class CONTENT_EXPORT WebContentsImpl : public WebContents, blink::mojom::FrameVisibility visibility) override; void SendScreenRects() override; TextInputManager* GetTextInputManager() override; @@ -71,7 +71,7 @@ index 1d749125dba6a4051ff8a147ef7a990d7523707b..4fa272275ba3883d105ddfd8deeb4987 bool IsShowingContextMenuOnPage() const override; void DidChangeScreenOrientation() override; diff --git a/content/public/browser/web_contents_observer.h b/content/public/browser/web_contents_observer.h -index d6f20a6c8d28359b09ee12cb72eb67f89000d141..5d5aec942b04c721361bf6e3649ba88e7fb28cee 100644 +index 7132de463591a1bb3879be5147b6ecfead77f1b8..f205d4394c5ee5fac79fe7b99e7c54f01895cc73 100644 --- a/content/public/browser/web_contents_observer.h +++ b/content/public/browser/web_contents_observer.h @@ -13,6 +13,7 @@ @@ -82,7 +82,7 @@ index d6f20a6c8d28359b09ee12cb72eb67f89000d141..5d5aec942b04c721361bf6e3649ba88e #include "content/public/browser/allow_service_worker_result.h" #include "content/public/browser/reload_type.h" #include "content/public/browser/render_frame_host.h" -@@ -462,6 +463,9 @@ class CONTENT_EXPORT WebContentsObserver { +@@ -472,6 +473,9 @@ class CONTENT_EXPORT WebContentsObserver { // Invoked every time the WebContents changes visibility. virtual void OnVisibilityChanged(Visibility visibility) {} diff --git a/patches/chromium/render_widget_host_view_base.patch b/patches/chromium/render_widget_host_view_base.patch index 2a4d8b90b7e9..691f722b34b4 100644 --- a/patches/chromium/render_widget_host_view_base.patch +++ b/patches/chromium/render_widget_host_view_base.patch @@ -6,10 +6,10 @@ Subject: render_widget_host_view_base.patch ... something to do with OSR? and maybe as well? terrifying. diff --git a/content/browser/renderer_host/render_widget_host_view_base.cc b/content/browser/renderer_host/render_widget_host_view_base.cc -index beaa6476fe5d8ad8718a6e15425cf46561b28ae1..2f0b3eb5056710b09b01ae36f22278118a82e041 100644 +index 251157d2014be8aecb1a2554794257c43ae78dff..93adaa18da9a7c9d6a40c955c934810bde2394fc 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.cc +++ b/content/browser/renderer_host/render_widget_host_view_base.cc -@@ -681,6 +681,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( +@@ -661,6 +661,13 @@ bool RenderWidgetHostViewBase::ScreenRectIsUnstableFor( return false; } @@ -24,7 +24,7 @@ index beaa6476fe5d8ad8718a6e15425cf46561b28ae1..2f0b3eb5056710b09b01ae36f2227811 const blink::WebMouseEvent& event, const ui::LatencyInfo& latency) { diff --git a/content/browser/renderer_host/render_widget_host_view_base.h b/content/browser/renderer_host/render_widget_host_view_base.h -index 5e1fbd03146192f417cb95bb88b44047fd40096a..da57f3a6c863abc9cbf14d2ce5ae99666fd3f37e 100644 +index b3f79d5b38e10bf660f2a109ee1014ed24c54bbc..4cad83c43010f4d66fe9bc71d186b98b4fc0ffe9 100644 --- a/content/browser/renderer_host/render_widget_host_view_base.h +++ b/content/browser/renderer_host/render_widget_host_view_base.h @@ -25,8 +25,10 @@ @@ -50,9 +50,9 @@ index 5e1fbd03146192f417cb95bb88b44047fd40096a..da57f3a6c863abc9cbf14d2ce5ae9966 class WebCursor; class WebContentsAccessibility; class DelegatedFrameHost; -@@ -142,6 +146,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { - void NotifyVirtualKeyboardOverlayRect( +@@ -143,6 +147,9 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { const gfx::Rect& keyboard_rect) override {} + bool IsHTMLFormPopup() const override; + virtual void InitAsGuest(RenderWidgetHostView* parent_host_view, + RenderWidgetHostViewGuest* guest_view) {} @@ -60,7 +60,7 @@ index 5e1fbd03146192f417cb95bb88b44047fd40096a..da57f3a6c863abc9cbf14d2ce5ae9966 // This only needs to be overridden by RenderWidgetHostViewBase subclasses // that handle content embedded within other RenderWidgetHostViews. gfx::PointF TransformPointToRootCoordSpaceF( -@@ -304,6 +311,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { +@@ -305,6 +312,11 @@ class CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView { virtual void ProcessGestureEvent(const blink::WebGestureEvent& event, const ui::LatencyInfo& latency); diff --git a/patches/chromium/render_widget_host_view_mac.patch b/patches/chromium/render_widget_host_view_mac.patch index 39daaa302913..62080affca2c 100644 --- a/patches/chromium/render_widget_host_view_mac.patch +++ b/patches/chromium/render_widget_host_view_mac.patch @@ -10,7 +10,7 @@ kinds of utility windows. Similarly for `disableAutoHideCursor`. Additionally, disables usage of some private APIs in MAS builds. diff --git a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm -index 43019ebb8ee8c165ffc533655fc4d38655606a6c..03230bb4de265cefc46832abbb85fa0bf659dacb 100644 +index 7a8e4653a0a962730ad5b5895cfbab8d2db92f24..0e139a88b7c6f341e1f7bc60c81378f53de830d8 100644 --- a/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm +++ b/content/app_shim_remote_cocoa/render_widget_host_view_cocoa.mm @@ -150,6 +150,15 @@ void ExtractUnderlines(NSAttributedString* string, @@ -39,7 +39,7 @@ index 43019ebb8ee8c165ffc533655fc4d38655606a6c..03230bb4de265cefc46832abbb85fa0b return [self acceptsMouseEventsWhenInactive]; } -@@ -645,6 +657,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { +@@ -646,6 +658,10 @@ - (BOOL)shouldIgnoreMouseEvent:(NSEvent*)theEvent { // its parent view. BOOL hitSelf = NO; while (view) { @@ -50,7 +50,7 @@ index 43019ebb8ee8c165ffc533655fc4d38655606a6c..03230bb4de265cefc46832abbb85fa0b if (view == self) hitSelf = YES; if ([view isKindOfClass:[self class]] && ![view isEqual:self] && -@@ -965,6 +981,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { +@@ -966,6 +982,10 @@ - (void)keyEvent:(NSEvent*)theEvent wasKeyEquivalent:(BOOL)equiv { eventType == NSKeyDown && !(modifierFlags & NSCommandKeyMask); @@ -61,7 +61,7 @@ index 43019ebb8ee8c165ffc533655fc4d38655606a6c..03230bb4de265cefc46832abbb85fa0b // We only handle key down events and just simply forward other events. if (eventType != NSKeyDown) { _hostHelper->ForwardKeyboardEvent(event, latency_info); -@@ -1691,9 +1711,11 @@ - (NSAccessibilityRole)accessibilityRole { +@@ -1692,9 +1712,11 @@ - (NSAccessibilityRole)accessibilityRole { // Since this implementation doesn't have to wait any IPC calls, this doesn't // make any key-typing jank. --hbono 7/23/09 // @@ -73,7 +73,7 @@ index 43019ebb8ee8c165ffc533655fc4d38655606a6c..03230bb4de265cefc46832abbb85fa0b - (NSArray*)validAttributesForMarkedText { // This code is just copied from WebKit except renaming variables. -@@ -1702,7 +1724,10 @@ - (NSArray*)validAttributesForMarkedText { +@@ -1703,7 +1725,10 @@ - (NSArray*)validAttributesForMarkedText { initWithObjects:NSUnderlineStyleAttributeName, NSUnderlineColorAttributeName, NSMarkedClauseSegmentAttributeName, diff --git a/patches/chromium/resource_file_conflict.patch b/patches/chromium/resource_file_conflict.patch index 816dc2fb666e..6d870cacbac4 100644 --- a/patches/chromium/resource_file_conflict.patch +++ b/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 d7a430eb9911a3a13da807e25204abd58025fdc9..897e473cbb4c3e8b244210706e4e1549b1e71a0c 100644 +index 8078897ba61cf9da717254727a8f97b6772d1cc6..abab9c8e8c60a6d1690acca5133b3c54d0ccc793 100644 --- a/chrome/BUILD.gn +++ b/chrome/BUILD.gn -@@ -1536,7 +1536,7 @@ if (is_chrome_branded && !is_android) { +@@ -1543,7 +1543,7 @@ if (is_chrome_branded && !is_android) { } } @@ -64,7 +64,7 @@ index d7a430eb9911a3a13da807e25204abd58025fdc9..897e473cbb4c3e8b244210706e4e1549 chrome_paks("packed_resources") { if (is_mac) { output_dir = "$root_gen_dir/repack" -@@ -1564,6 +1564,12 @@ if (!is_android) { +@@ -1571,6 +1571,12 @@ if (!is_android) { } } diff --git a/patches/chromium/scroll_bounce_flag.patch b/patches/chromium/scroll_bounce_flag.patch index eda31423ad5d..be7188dea5fa 100644 --- a/patches/chromium/scroll_bounce_flag.patch +++ b/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 52c02371bf3735dd8a4670c566da13ac6c37a522..7d462cc901050085dbb211f63ffc0bd817b1ba08 100644 +index c0a004136c09c26fcc2011ee80993ab630c033fb..755ac21653bc1b802d56de76c46bcece75230a18 100644 --- a/content/renderer/render_thread_impl.cc +++ b/content/renderer/render_thread_impl.cc -@@ -1283,7 +1283,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { +@@ -1294,7 +1294,7 @@ bool RenderThreadImpl::IsLcdTextEnabled() { } bool RenderThreadImpl::IsElasticOverscrollEnabled() { diff --git a/patches/chromium/support_mixed_sandbox_with_zygote.patch b/patches/chromium/support_mixed_sandbox_with_zygote.patch index 07b9e1d3e6f8..ea43ccc0a9d5 100644 --- a/patches/chromium/support_mixed_sandbox_with_zygote.patch +++ b/patches/chromium/support_mixed_sandbox_with_zygote.patch @@ -22,10 +22,10 @@ However, the patch would need to be reviewed by the security team, as it does touch a security-sensitive class. diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc -index ca49f2c9de55e95024e5ff680794e09a53061ffd..0a53d80feb2cdaa599da3ea87a8a6a8f8327ae92 100644 +index d64ad2d8d3a9515768d82ff02e7be26383dd5b66..3555928a29b3c6022621c4e9b65531edbefa7797 100644 --- a/content/browser/renderer_host/render_process_host_impl.cc +++ b/content/browser/renderer_host/render_process_host_impl.cc -@@ -398,10 +398,18 @@ class RendererSandboxedProcessLauncherDelegate +@@ -397,10 +397,18 @@ class RendererSandboxedProcessLauncherDelegate public: RendererSandboxedProcessLauncherDelegate() = default; @@ -44,7 +44,7 @@ index ca49f2c9de55e95024e5ff680794e09a53061ffd..0a53d80feb2cdaa599da3ea87a8a6a8f const base::CommandLine& browser_command_line = *base::CommandLine::ForCurrentProcess(); base::CommandLine::StringType renderer_prefix = -@@ -419,6 +427,11 @@ class RendererSandboxedProcessLauncherDelegate +@@ -418,6 +426,11 @@ class RendererSandboxedProcessLauncherDelegate sandbox::policy::SandboxType GetSandboxType() override { return sandbox::policy::SandboxType::kRenderer; } @@ -56,7 +56,7 @@ index ca49f2c9de55e95024e5ff680794e09a53061ffd..0a53d80feb2cdaa599da3ea87a8a6a8f }; #if defined(OS_WIN) -@@ -430,6 +443,9 @@ class RendererSandboxedProcessLauncherDelegateWin +@@ -429,6 +442,9 @@ class RendererSandboxedProcessLauncherDelegateWin bool is_jit_disabled) : renderer_code_integrity_enabled_( GetContentClient()->browser()->IsRendererCodeIntegrityEnabled()) { @@ -66,7 +66,7 @@ index ca49f2c9de55e95024e5ff680794e09a53061ffd..0a53d80feb2cdaa599da3ea87a8a6a8f if (is_jit_disabled) { dynamic_code_can_be_disabled_ = true; return; -@@ -1982,9 +1998,15 @@ bool RenderProcessHostImpl::Init() { +@@ -1988,9 +2004,15 @@ bool RenderProcessHostImpl::Init() { std::unique_ptr sandbox_delegate = std::make_unique( cmd_line.get(), IsJitDisabled()); diff --git a/patches/chromium/ui_gtk_public_header.patch b/patches/chromium/ui_gtk_public_header.patch index bb7f6af44314..237ecc6b2b60 100644 --- a/patches/chromium/ui_gtk_public_header.patch +++ b/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 9adb7d3e20611953974c545bf2d817e8c2c9aef0..51dae290a2b51f86c7735df33f9d34b9f5ea8079 100644 +index 2d4b2f617d4ffb4e2329dbce8f1de05739c3617f..0f350916b012e04a76d3db8abe199ee693f8abd5 100644 --- a/ui/gtk/BUILD.gn +++ b/ui/gtk/BUILD.gn @@ -39,7 +39,7 @@ generate_stubs("gtk_stubs") { diff --git a/patches/chromium/web_contents.patch b/patches/chromium/web_contents.patch index a43a061b8e4e..e0d9b36c4801 100644 --- a/patches/chromium/web_contents.patch +++ b/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 b6524566b96a141ba710441ab70d17f46e5b1b9a..6a48e38254024ea721d2f10a9e88aa8ce00f8975 100644 +index d3593a6f3e9f6cba5823169d36fd93a6f97608ae..4ee081242ecf0725b43c95dfd1032bd3e6ce8771 100644 --- a/content/browser/web_contents/web_contents_impl.cc +++ b/content/browser/web_contents/web_contents_impl.cc -@@ -2897,6 +2897,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2884,6 +2884,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { frame_tree_.Init(site_instance.get(), params.renderer_initiated_creation, params.main_frame_name); @@ -25,7 +25,7 @@ index b6524566b96a141ba710441ab70d17f46e5b1b9a..6a48e38254024ea721d2f10a9e88aa8c WebContentsViewDelegate* delegate = GetContentClient()->browser()->GetWebContentsViewDelegate(this); -@@ -2907,6 +2913,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { +@@ -2894,6 +2900,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { view_.reset(CreateWebContentsView(this, delegate, &render_view_host_delegate_view_)); } @@ -34,7 +34,7 @@ index b6524566b96a141ba710441ab70d17f46e5b1b9a..6a48e38254024ea721d2f10a9e88aa8c CHECK(view_.get()); diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h -index ddf33e29d8f06a29a9107fee4c614d288cdbfc3b..383d0fd95d7e807b83f4cd972c107fa27fefaac6 100644 +index b55e80c0f32ee4cc0e5d168c79d7e480fbb1c6bc..95bcea15ea704f11e8daab49de6d958fb2d15127 100644 --- a/content/public/browser/web_contents.h +++ b/content/public/browser/web_contents.h @@ -86,10 +86,13 @@ class BrowserContext; diff --git a/patches/chromium/webview_cross_drag.patch b/patches/chromium/webview_cross_drag.patch index 1bbfacd87b19..1fcd196de99f 100644 --- a/patches/chromium/webview_cross_drag.patch +++ b/patches/chromium/webview_cross_drag.patch @@ -8,10 +8,10 @@ This allows dragging and dropping between 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 7739e118bacd0de1e51d2a46ff126557d9de960c..7192bbbdafaf1f3825909bfdb3f022c76ea3f31f 100644 +index c1b09024a3f7d46d91f60a30aecf1ca1f0318030..ff1c59766569053b6d32c49c525d00c829e5abe6 100644 --- a/content/browser/web_contents/web_contents_view_aura.cc +++ b/content/browser/web_contents/web_contents_view_aura.cc -@@ -790,9 +790,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { +@@ -802,9 +802,7 @@ gfx::NativeView WebContentsViewAura::GetRenderWidgetHostViewParent() const { bool WebContentsViewAura::IsValidDragTarget( RenderWidgetHostImpl* target_rwh) const { diff --git a/patches/chromium/webview_fullscreen.patch b/patches/chromium/webview_fullscreen.patch index f7f786d27dc1..e42f63130256 100644 --- a/patches/chromium/webview_fullscreen.patch +++ b/patches/chromium/webview_fullscreen.patch @@ -14,10 +14,10 @@ Note that we also need to manually update embedder's `api::WebContents::IsFullscreenForTabOrPending` value. diff --git a/content/browser/renderer_host/render_frame_host_impl.cc b/content/browser/renderer_host/render_frame_host_impl.cc -index ea22c655ae4e5c1e023d68fbedb2a684edabe1fe..0a4be87c33dcd6f6952288ce5f19f2263299e68f 100644 +index 1a62a9669484980a69d658ca6729e7caf3db96fb..09e0a4549f5d959f15d7a89f4e685246c3e00f56 100644 --- a/content/browser/renderer_host/render_frame_host_impl.cc +++ b/content/browser/renderer_host/render_frame_host_impl.cc -@@ -5830,6 +5830,15 @@ void RenderFrameHostImpl::EnterFullscreen( +@@ -5944,6 +5944,15 @@ void RenderFrameHostImpl::EnterFullscreen( notified_instances.insert(parent_site_instance); } diff --git a/patches/chromium/worker_context_will_destroy.patch b/patches/chromium/worker_context_will_destroy.patch index 2e5ec3d2adc3..6912e52c0f06 100644 --- a/patches/chromium/worker_context_will_destroy.patch +++ b/patches/chromium/worker_context_will_destroy.patch @@ -10,7 +10,7 @@ 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 b62158069f9a1ae7141c8f9ef191bd11660797d2..74846c92e2fdfc4dffe9014a010a0acdf9e3017c 100644 +index f3852c0eef152176d03922492ca9672498f8f9d0..ef7b6f9ff3e8f899377933a7184d3278d4a9d366 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -358,6 +358,11 @@ class CONTENT_EXPORT ContentRendererClient { @@ -26,10 +26,10 @@ index b62158069f9a1ae7141c8f9ef191bd11660797d2..74846c92e2fdfc4dffe9014a010a0acd // 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 337c630fc85f33346dccffd51c1fb06db032f1fb..1db3e3674b2b8457f61012565c6103fe1a693929 100644 +index 0280650b9c9b47c7fc67ace052c04ce4b23c9679..1e864d8c95fc5fb258c6b91c8968b8a986a862ab 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -936,6 +936,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { +@@ -940,6 +940,12 @@ void RendererBlinkPlatformImpl::WillStopWorkerThread() { WorkerThreadRegistry::Instance()->WillStopCurrentWorkerThread(); } @@ -43,10 +43,10 @@ index 337c630fc85f33346dccffd51c1fb06db032f1fb..1db3e3674b2b8457f61012565c6103fe const v8::Local& worker) { GetContentClient()->renderer()->DidInitializeWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index b199c34615f0230b46b6128cccfce75d5c2ccc9c..0b8515b4e8cc86f332d4c5c6950bd4656d88fac4 100644 +index 577ba7b6773668ccfce9dcbf4dcdc7a753f95ce8..f22c471f7e20fd23307f640fac871120d768ff32 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -205,6 +205,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -207,6 +207,7 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local& worker) override; diff --git a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch index ce3b6fc0bcab..e04e3e8c1623 100644 --- a/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch +++ b/patches/chromium/worker_feat_add_hook_to_notify_script_ready.patch @@ -19,7 +19,7 @@ that clearly establishes the worker script is ready for evaluation with the scop initialized. diff --git a/content/public/renderer/content_renderer_client.h b/content/public/renderer/content_renderer_client.h -index 74846c92e2fdfc4dffe9014a010a0acdf9e3017c..3dfb2f9dadb682265b90ac5520dd20ae819ff2b9 100644 +index ef7b6f9ff3e8f899377933a7184d3278d4a9d366..8688f1d7f258246901feec75e340c32bf581a2b5 100644 --- a/content/public/renderer/content_renderer_client.h +++ b/content/public/renderer/content_renderer_client.h @@ -358,6 +358,11 @@ class CONTENT_EXPORT ContentRendererClient { @@ -35,10 +35,10 @@ index 74846c92e2fdfc4dffe9014a010a0acdf9e3017c..3dfb2f9dadb682265b90ac5520dd20ae // from the worker thread. virtual void WillDestroyWorkerContextOnWorkerThread( diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc -index 1db3e3674b2b8457f61012565c6103fe1a693929..16319411915fb747d234a09185a5d7be1643a4dd 100644 +index 1e864d8c95fc5fb258c6b91c8968b8a986a862ab..4222234d014f204ffc5e5786a8a973f2c9ef8568 100644 --- a/content/renderer/renderer_blink_platform_impl.cc +++ b/content/renderer/renderer_blink_platform_impl.cc -@@ -948,6 +948,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( +@@ -952,6 +952,12 @@ void RendererBlinkPlatformImpl::WorkerContextCreated( worker); } @@ -52,10 +52,10 @@ index 1db3e3674b2b8457f61012565c6103fe1a693929..16319411915fb747d234a09185a5d7be const blink::WebSecurityOrigin& script_origin) { return GetContentClient()->renderer()->AllowScriptExtensionForServiceWorker( diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h -index 0b8515b4e8cc86f332d4c5c6950bd4656d88fac4..0bf0c2a5c364404863af1493d30013b8fd9fba68 100644 +index f22c471f7e20fd23307f640fac871120d768ff32..d10ad3d4e464d53f50c3bcfc2adf94271ca50682 100644 --- a/content/renderer/renderer_blink_platform_impl.h +++ b/content/renderer/renderer_blink_platform_impl.h -@@ -205,6 +205,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { +@@ -207,6 +207,8 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl { void DidStartWorkerThread() override; void WillStopWorkerThread() override; void WorkerContextCreated(const v8::Local& worker) override; diff --git a/patches/config.json b/patches/config.json index e1a1703ce9ed..e9a2297ba10f 100644 --- a/patches/config.json +++ b/patches/config.json @@ -13,7 +13,5 @@ "src/electron/patches/Mantle": "src/third_party/squirrel.mac/vendor/Mantle", - "src/electron/patches/ReactiveObjC": "src/third_party/squirrel.mac/vendor/ReactiveObjC", - - "src/electron/patches/breakpad": "src/third_party/breakpad/breakpad" + "src/electron/patches/ReactiveObjC": "src/third_party/squirrel.mac/vendor/ReactiveObjC" } diff --git a/patches/v8/.patches b/patches/v8/.patches index 58604303265f..975e3dc5562a 100644 --- a/patches/v8/.patches +++ b/patches/v8/.patches @@ -6,7 +6,6 @@ workaround_an_undefined_symbol_error.patch do_not_export_private_v8_symbols_on_windows.patch fix_build_deprecated_attirbute_for_older_msvc_versions.patch fix_disable_implies_dcheck_for_node_stream_array_buffers.patch -cppgc-js_support_eager_traced_value_in_ephemeron_pairs.patch -regexp_add_a_currently_failing_cctest_for_irregexp_reentrancy.patch regexp_allow_reentrant_irregexp_execution.patch regexp_remove_the_stack_parameter_from_regexp_matchers.patch +baseline_skip_deoptimization_data_size.patch diff --git a/patches/v8/baseline_skip_deoptimization_data_size.patch b/patches/v8/baseline_skip_deoptimization_data_size.patch new file mode 100644 index 000000000000..7728f9357b46 --- /dev/null +++ b/patches/v8/baseline_skip_deoptimization_data_size.patch @@ -0,0 +1,31 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Victor Gomes +Date: Wed, 22 Sep 2021 17:57:25 +0200 +Subject: Skip deoptimization data size + +Sparkplug code does not contain deoptimization data. + +Bug: v8:12258 +Change-Id: Ieb9f7f1469e00677d9533c6f05b17c80ef06b9d6 +Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3175820 +Commit-Queue: Victor Gomes +Commit-Queue: Camillo Bruni +Auto-Submit: Victor Gomes +Reviewed-by: Camillo Bruni +Cr-Commit-Position: refs/heads/main@{#76997} + +diff --git a/src/objects/code-inl.h b/src/objects/code-inl.h +index 48e5810f14f9f69b0cb245fb24353e4bb2120e0e..4cbb1595c964ae352a15350a640aa3be0778ac15 100644 +--- a/src/objects/code-inl.h ++++ b/src/objects/code-inl.h +@@ -394,7 +394,9 @@ int Code::MetadataSize() const { + int Code::SizeIncludingMetadata() const { + int size = CodeSize(); + size += relocation_info().Size(); +- size += deoptimization_data().Size(); ++ if (kind() != CodeKind::BASELINE) { ++ size += deoptimization_data().Size(); ++ } + return size; + } + diff --git a/patches/v8/build_gn.patch b/patches/v8/build_gn.patch index a8b02cc5d626..1dd377c723a1 100644 --- a/patches/v8/build_gn.patch +++ b/patches/v8/build_gn.patch @@ -9,10 +9,10 @@ necessary for native modules to load. Also, some fixes relating to mksnapshot on ARM. diff --git a/BUILD.gn b/BUILD.gn -index 9be25bd786e5c48e420324a39633567e8a76f364..046caab35c77c5eb68d87f5eb7d30cacb670d4a4 100644 +index 20d9b8e9afc033367b55409847bfad1356aabd42..f23ed7817bafcd84b941905a2a8852f79069aa2e 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -565,7 +565,7 @@ config("internal_config") { +@@ -571,7 +571,7 @@ config("internal_config") { ":cppgc_header_features", ] @@ -21,7 +21,7 @@ index 9be25bd786e5c48e420324a39633567e8a76f364..046caab35c77c5eb68d87f5eb7d30cac defines += [ "BUILDING_V8_SHARED" ] } -@@ -5453,7 +5453,7 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -5497,7 +5497,7 @@ if (current_toolchain == v8_generator_toolchain) { "src/interpreter/bytecodes.h", ] @@ -30,7 +30,7 @@ index 9be25bd786e5c48e420324a39633567e8a76f364..046caab35c77c5eb68d87f5eb7d30cac deps = [ ":v8_libbase", -@@ -5491,6 +5491,8 @@ if (current_toolchain == v8_snapshot_toolchain) { +@@ -5535,6 +5535,8 @@ if (current_toolchain == v8_snapshot_toolchain) { configs = [ ":internal_config" ] diff --git a/patches/v8/cppgc-js_support_eager_traced_value_in_ephemeron_pairs.patch b/patches/v8/cppgc-js_support_eager_traced_value_in_ephemeron_pairs.patch deleted file mode 100644 index bb61c8f5691f..000000000000 --- a/patches/v8/cppgc-js_support_eager_traced_value_in_ephemeron_pairs.patch +++ /dev/null @@ -1,208 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Michael Lippautz -Date: Fri, 3 Sep 2021 14:17:59 +0200 -Subject: cppgc-js: Support eager traced value in ephemeron pairs - -Before this patch, both key and value of an ephemeron pair was always -considered to be GarbageCollected objects. - -This patch adjusts the snapshotting mechanism to accomodate that -values may not be GarbageCollected objects and must thus be eagerly -traced for visibility and edge creation. - -In practice this only shows up in Blink when associating an existing -wrappable with a wrapper in a non-main world, e.g., through an -extension. In this case, DOMWrapperMap keeps the wrapper value through -a TracedReference in the ephemeron map with the existing wrappable as -key. The semantics are intended to be general ephemeron semantics, -i.e., value needs to be kept alive when the key is alive. This is -visualized in DevTools as the main wrapper/wrappable pair (which is -merged into a single node for the snapshot) retaining the non-main -world wrapper. - -Bug: chromium:1245894 -Change-Id: Ibfa6722f20c76f94c310f9a040f0d3d4b9083bbb -Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3140601 -Reviewed-by: Omer Katz -Commit-Queue: Michael Lippautz -Cr-Commit-Position: refs/heads/main@{#76658} - -diff --git a/src/heap/cppgc-js/cpp-snapshot.cc b/src/heap/cppgc-js/cpp-snapshot.cc -index dc55753ff625a135b6e494344ee49105eb59121e..9b20b5c0a7831ea026819f90ea80c10eb2324282 100644 ---- a/src/heap/cppgc-js/cpp-snapshot.cc -+++ b/src/heap/cppgc-js/cpp-snapshot.cc -@@ -264,6 +264,10 @@ class State final : public StateBase { - ephemeron_edges_.insert(&value); - } - -+ void AddEagerEphemeronEdge(const void* value, cppgc::TraceCallback callback) { -+ eager_ephemeron_edges_.insert({value, callback}); -+ } -+ - template - void ForAllEphemeronEdges(Callback callback) { - for (const HeapObjectHeader* value : ephemeron_edges_) { -@@ -271,10 +275,20 @@ class State final : public StateBase { - } - } - -+ template -+ void ForAllEagerEphemeronEdges(Callback callback) { -+ for (const auto& pair : eager_ephemeron_edges_) { -+ callback(pair.first, pair.second); -+ } -+ } -+ - private: - bool is_weak_container_ = false; - // Values that are held alive through ephemerons by this particular key. - std::unordered_set ephemeron_edges_; -+ // Values that are eagerly traced and held alive through ephemerons by this -+ // particular key. -+ std::unordered_map eager_ephemeron_edges_; - }; - - // Root states are similar to regular states with the difference that they are -@@ -404,6 +418,9 @@ class CppGraphBuilderImpl final { - void VisitForVisibility(State& parent, const TracedReferenceBase&); - void VisitEphemeronForVisibility(const HeapObjectHeader& key, - const HeapObjectHeader& value); -+ void VisitEphemeronWithNonGarbageCollectedValueForVisibility( -+ const HeapObjectHeader& key, const void* value, -+ cppgc::TraceDescriptor value_desc); - void VisitWeakContainerForVisibility(const HeapObjectHeader&); - void VisitRootForGraphBuilding(RootState&, const HeapObjectHeader&, - const cppgc::SourceLocation&); -@@ -421,7 +438,7 @@ class CppGraphBuilderImpl final { - } - - void AddEdge(State& parent, const HeapObjectHeader& header, -- const std::string& edge_name = {}) { -+ const std::string& edge_name) { - DCHECK(parent.IsVisibleNotDependent()); - auto& current = states_.GetExistingState(header); - if (!current.IsVisibleNotDependent()) return; -@@ -443,7 +460,8 @@ class CppGraphBuilderImpl final { - } - } - -- void AddEdge(State& parent, const TracedReferenceBase& ref) { -+ void AddEdge(State& parent, const TracedReferenceBase& ref, -+ const std::string& edge_name) { - DCHECK(parent.IsVisibleNotDependent()); - v8::Local v8_value = ref.Get(cpp_heap_.isolate()); - if (!v8_value.IsEmpty()) { -@@ -451,12 +469,19 @@ class CppGraphBuilderImpl final { - parent.set_node(AddNode(*parent.header())); - } - auto* v8_node = graph_.V8Node(v8_value); -- graph_.AddEdge(parent.get_node(), v8_node); -+ if (!edge_name.empty()) { -+ graph_.AddEdge(parent.get_node(), v8_node, -+ parent.get_node()->InternalizeEdgeName(edge_name)); -+ } else { -+ graph_.AddEdge(parent.get_node(), v8_node); -+ } - - // References that have a class id set may have their internal fields - // pointing back to the object. Set up a wrapper node for the graph so - // that the snapshot generator can merge the nodes appropriately. -- if (!ref.WrapperClassId()) return; -+ // Even with a set class id, do not set up a wrapper node when the edge -+ // has a specific name. -+ if (!ref.WrapperClassId() || !edge_name.empty()) return; - - void* back_reference_object = ExtractEmbedderDataBackref( - reinterpret_cast(cpp_heap_.isolate()), -@@ -598,8 +623,18 @@ class WeakVisitor : public JSVisitor { - void VisitEphemeron(const void* key, const void* value, - cppgc::TraceDescriptor value_desc) final { - // For ephemerons, the key retains the value. -+ // Key always must be a GarbageCollected object. -+ auto& key_header = HeapObjectHeader::FromObject(key); -+ if (!value_desc.base_object_payload) { -+ // Value does not represent an actual GarbageCollected object but rather -+ // should be traced eagerly. -+ graph_builder_.VisitEphemeronWithNonGarbageCollectedValueForVisibility( -+ key_header, value, value_desc); -+ return; -+ } -+ // Regular path where both key and value are GarbageCollected objects. - graph_builder_.VisitEphemeronForVisibility( -- HeapObjectHeader::FromObject(key), HeapObjectHeader::FromObject(value)); -+ key_header, HeapObjectHeader::FromObject(value)); - } - - protected: -@@ -645,7 +680,7 @@ class GraphBuildingVisitor final : public JSVisitor { - void Visit(const void*, cppgc::TraceDescriptor desc) final { - graph_builder_.AddEdge( - parent_scope_.ParentAsRegularState(), -- HeapObjectHeader::FromObject(desc.base_object_payload)); -+ HeapObjectHeader::FromObject(desc.base_object_payload), edge_name_); - } - void VisitWeakContainer(const void* object, - cppgc::TraceDescriptor strong_desc, -@@ -655,7 +690,8 @@ class GraphBuildingVisitor final : public JSVisitor { - // container itself. - graph_builder_.AddEdge( - parent_scope_.ParentAsRegularState(), -- HeapObjectHeader::FromObject(strong_desc.base_object_payload)); -+ HeapObjectHeader::FromObject(strong_desc.base_object_payload), -+ edge_name_); - } - void VisitRoot(const void*, cppgc::TraceDescriptor desc, - const cppgc::SourceLocation& loc) final { -@@ -667,12 +703,18 @@ class GraphBuildingVisitor final : public JSVisitor { - const void*, const cppgc::SourceLocation&) final {} - // JS handling. - void Visit(const TracedReferenceBase& ref) final { -- graph_builder_.AddEdge(parent_scope_.ParentAsRegularState(), ref); -+ graph_builder_.AddEdge(parent_scope_.ParentAsRegularState(), ref, -+ edge_name_); -+ } -+ -+ void set_edge_name(std::string edge_name) { -+ edge_name_ = std::move(edge_name); - } - - private: - CppGraphBuilderImpl& graph_builder_; - const ParentScope& parent_scope_; -+ std::string edge_name_; - }; - - // Base class for transforming recursion into iteration. Items are processed -@@ -765,6 +807,19 @@ void CppGraphBuilderImpl::VisitForVisibility(State* parent, - } - } - -+void CppGraphBuilderImpl:: -+ VisitEphemeronWithNonGarbageCollectedValueForVisibility( -+ const HeapObjectHeader& key, const void* value, -+ cppgc::TraceDescriptor value_desc) { -+ auto& key_state = states_.GetOrCreateState(key); -+ // Eagerly trace the value here, effectively marking key as visible and -+ // queuing processing for all reachable values. -+ ParentScope parent_scope(key_state); -+ VisiblityVisitor visitor(*this, parent_scope); -+ value_desc.callback(&visitor, value); -+ key_state.AddEagerEphemeronEdge(value, value_desc.callback); -+} -+ - void CppGraphBuilderImpl::VisitEphemeronForVisibility( - const HeapObjectHeader& key, const HeapObjectHeader& value) { - auto& key_state = states_.GetOrCreateState(key); -@@ -820,6 +875,12 @@ void CppGraphBuilderImpl::Run() { - state.ForAllEphemeronEdges([this, &state](const HeapObjectHeader& value) { - AddEdge(state, value, "part of key -> value pair in ephemeron table"); - }); -+ object_visitor.set_edge_name( -+ "part of key -> value pair in ephemeron table"); -+ state.ForAllEagerEphemeronEdges( -+ [&object_visitor](const void* value, cppgc::TraceCallback callback) { -+ callback(&object_visitor, value); -+ }); - }); - // Add roots. - { diff --git a/patches/v8/dcheck.patch b/patches/v8/dcheck.patch index 67501e7b2b2c..9360221ca33b 100644 --- a/patches/v8/dcheck.patch +++ b/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 dedbd5db66823761c40f24169881ffc5ac06e391..97b0804562c7cd60791901fa9a8d48ff07c1abbf 100644 +index 59bd76c1540d569d3c1d93c2d3a526361c893b19..d09a84023ba633d3506ba0d49860da015b9104a6 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -8919,7 +8919,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { +@@ -8928,7 +8928,7 @@ void Isolate::SetPromiseRejectCallback(PromiseRejectCallback callback) { } void Isolate::PerformMicrotaskCheckpoint() { @@ -19,10 +19,10 @@ index dedbd5db66823761c40f24169881ffc5ac06e391..97b0804562c7cd60791901fa9a8d48ff isolate->default_microtask_queue()->PerformCheckpoint(this); } diff --git a/src/heap/heap.cc b/src/heap/heap.cc -index 338ba407a33e695b91f7daed114ecda336bddb02..3edefb22eb86954ea68465d817af37d81c06eb3a 100644 +index 8920f054925aa1b212298b71ec2aa97a8a9de35a..76739cd66577d64cda8450d52231a3fa75e47ef7 100644 --- a/src/heap/heap.cc +++ b/src/heap/heap.cc -@@ -6012,9 +6012,9 @@ void Heap::DeinitSharedSpaces() { +@@ -6011,9 +6011,9 @@ void Heap::DeinitSharedSpaces() { void Heap::AddGCPrologueCallback(v8::Isolate::GCCallbackWithData callback, GCType gc_type, void* data) { DCHECK_NOT_NULL(callback); diff --git a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch index 872c36bf04f7..ae099e803c1a 100644 --- a/patches/v8/do_not_export_private_v8_symbols_on_windows.patch +++ b/patches/v8/do_not_export_private_v8_symbols_on_windows.patch @@ -12,10 +12,10 @@ This patch can be safely removed if, when it is removed, `node.lib` does not contain any standard C++ library exports (e.g. `std::ostringstream`). diff --git a/BUILD.gn b/BUILD.gn -index 18ee54f52ad13855b364fa5449dddd9c81d521d9..361b90f4718d00eb5c787e4578d354906c030f47 100644 +index b7974da90497500764199a9c3416211f163a6e78..4ac65d5c727913ca34d6403b8527c1498a254d12 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -565,6 +565,10 @@ config("internal_config") { +@@ -571,6 +571,10 @@ config("internal_config") { ":cppgc_header_features", ] @@ -27,10 +27,10 @@ index 18ee54f52ad13855b364fa5449dddd9c81d521d9..361b90f4718d00eb5c787e4578d35490 defines += [ "BUILDING_V8_SHARED" ] } diff --git a/src/base/macros.h b/src/base/macros.h -index fca0b2ebb2ccda35ed308155f436820f5a76b9a2..0f8fab3ab75943d7fb3a93cd6e59092ea19804f6 100644 +index 2c0ed9f790636b3376bdbba55cbcafcd2b882b50..fa287c9093e3a267b59a5eefc84d76205e19c7cc 100644 --- a/src/base/macros.h +++ b/src/base/macros.h -@@ -381,13 +381,17 @@ bool is_inbounds(float_t v) { +@@ -388,13 +388,17 @@ bool is_inbounds(float_t v) { #ifdef V8_OS_WIN // Setup for Windows shared library export. diff --git a/patches/v8/expose_mksnapshot.patch b/patches/v8/expose_mksnapshot.patch index 7afa2952dc1e..f9f06256fdf0 100644 --- a/patches/v8/expose_mksnapshot.patch +++ b/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 046caab35c77c5eb68d87f5eb7d30cacb670d4a4..18ee54f52ad13855b364fa5449dddd9c81d521d9 100644 +index f23ed7817bafcd84b941905a2a8852f79069aa2e..b7974da90497500764199a9c3416211f163a6e78 100644 --- a/BUILD.gn +++ b/BUILD.gn -@@ -5465,7 +5465,6 @@ if (current_toolchain == v8_generator_toolchain) { +@@ -5509,7 +5509,6 @@ if (current_toolchain == v8_generator_toolchain) { if (current_toolchain == v8_snapshot_toolchain) { v8_executable("mksnapshot") { diff --git a/patches/v8/regexp_add_a_currently_failing_cctest_for_irregexp_reentrancy.patch b/patches/v8/regexp_add_a_currently_failing_cctest_for_irregexp_reentrancy.patch deleted file mode 100644 index 6870577a6e7d..000000000000 --- a/patches/v8/regexp_add_a_currently_failing_cctest_for_irregexp_reentrancy.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Jakob Gruber -Date: Mon, 6 Sep 2021 08:29:33 +0200 -Subject: Add a (currently failing) cctest for irregexp reentrancy - -The test should be enabled once reentrancy is supported. - -Bug: v8:11382 -Change-Id: Ifb90d8a6fd8bf9f05e9ca2405d4e04e013ce7ee3 -Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3138201 -Commit-Queue: Jakob Gruber -Auto-Submit: Jakob Gruber -Reviewed-by: Patrick Thier -Cr-Commit-Position: refs/heads/main@{#76667} - -diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status -index 0a6626ce332ae3ad3e49cb99404646c22c866b71..9c28520ed56998173c105b9d8a2ca3c4489b916e 100644 ---- a/test/cctest/cctest.status -+++ b/test/cctest/cctest.status -@@ -136,6 +136,9 @@ - 'test-strings/Traverse': [PASS, HEAVY], - 'test-swiss-name-dictionary-csa/DeleteAtBoundaries': [PASS, HEAVY], - 'test-swiss-name-dictionary-csa/SameH2': [PASS, HEAVY], -+ -+ # TODO(v8:11382): Reenable once irregexp is reentrant. -+ 'test-regexp/RegExpInterruptReentrantExecution': [FAIL], - }], # ALWAYS - - ############################################################################## -@@ -670,6 +673,9 @@ - - # Instruction cache flushing is disabled in jitless mode. - 'test-icache/*': [SKIP], -+ -+ # Tests generated irregexp code. -+ 'test-regexp/RegExpInterruptReentrantExecution': [SKIP], - }], # lite_mode or variant == jitless - - ############################################################################## -diff --git a/test/cctest/test-api.cc b/test/cctest/test-api.cc -index dc5e2ea50898fbf684f5f4655d8b50982d4ebbbd..f7cbc54499464acf1a7de45251a6118340ec51fd 100644 ---- a/test/cctest/test-api.cc -+++ b/test/cctest/test-api.cc -@@ -21734,10 +21734,6 @@ TEST(RegExpInterruptAndMakeSubjectTwoByteExternal) { - // experimental engine. - i::FLAG_enable_experimental_regexp_engine_on_excessive_backtracks = false; - RegExpInterruptTest test; -- // We want to be stuck regexp execution, so no fallback to linear-time -- // engine. -- // TODO(mbid,v8:10765): Find a way to test interrupt support of the -- // experimental engine. - test.RunTest(RegExpInterruptTest::MakeSubjectTwoByteExternal); - } - -diff --git a/test/cctest/test-regexp.cc b/test/cctest/test-regexp.cc -index 27204f7f519229cc4c21a10dd0a44222d4b6edd6..2692748e623d3d52780ff89a97f4300bcd981cbd 100644 ---- a/test/cctest/test-regexp.cc -+++ b/test/cctest/test-regexp.cc -@@ -2346,6 +2346,50 @@ TEST(UnicodePropertyEscapeCodeSize) { - } - } - -+namespace { -+ -+struct RegExpExecData { -+ i::Isolate* isolate; -+ i::Handle regexp; -+ i::Handle subject; -+}; -+ -+i::Handle RegExpExec(const RegExpExecData* d) { -+ return i::RegExp::Exec(d->isolate, d->regexp, d->subject, 0, -+ d->isolate->regexp_last_match_info()) -+ .ToHandleChecked(); -+} -+ -+void ReenterRegExp(v8::Isolate* isolate, void* data) { -+ RegExpExecData* d = static_cast(data); -+ i::Handle result = RegExpExec(d); -+ CHECK(result->IsNull()); -+} -+ -+} // namespace -+ -+// Tests reentrant irregexp calls. -+TEST(RegExpInterruptReentrantExecution) { -+ CHECK(!i::FLAG_jitless); -+ i::FLAG_regexp_tier_up = false; // Enter irregexp, not the interpreter. -+ -+ LocalContext context; -+ v8::Isolate* isolate = context->GetIsolate(); -+ v8::HandleScope scope(isolate); -+ -+ RegExpExecData d; -+ d.isolate = reinterpret_cast(isolate); -+ d.regexp = v8::Utils::OpenHandle( -+ *v8::RegExp::New(context.local(), v8_str("(a*)*x"), v8::RegExp::kNone) -+ .ToLocalChecked()); -+ d.subject = v8::Utils::OpenHandle(*v8_str("aaaa")); -+ -+ isolate->RequestInterrupt(&ReenterRegExp, &d); -+ -+ i::Handle result = RegExpExec(&d); -+ CHECK(result->IsNull()); -+} -+ - #undef CHECK_PARSE_ERROR - #undef CHECK_SIMPLE - #undef CHECK_MIN_MAX diff --git a/patches/v8/regexp_allow_reentrant_irregexp_execution.patch b/patches/v8/regexp_allow_reentrant_irregexp_execution.patch index 546c5362a1d1..d522388f9fa7 100644 --- a/patches/v8/regexp_allow_reentrant_irregexp_execution.patch +++ b/patches/v8/regexp_allow_reentrant_irregexp_execution.patch @@ -21,10 +21,10 @@ Auto-Submit: Jakob Gruber Cr-Commit-Position: refs/heads/main@{#77013} diff --git a/src/api/api.cc b/src/api/api.cc -index 97b0804562c7cd60791901fa9a8d48ff07c1abbf..f43dfaf5ef10f83416a915952439c0e97656904d 100644 +index d09a84023ba633d3506ba0d49860da015b9104a6..882581b69ea0c46690e9971f73f76f014b3279f0 100644 --- a/src/api/api.cc +++ b/src/api/api.cc -@@ -107,7 +107,6 @@ +@@ -108,7 +108,6 @@ #include "src/profiler/heap-snapshot-generator-inl.h" #include "src/profiler/profile-generator-inl.h" #include "src/profiler/tick-sample.h" @@ -33,10 +33,10 @@ index 97b0804562c7cd60791901fa9a8d48ff07c1abbf..f43dfaf5ef10f83416a915952439c0e9 #include "src/runtime/runtime.h" #include "src/snapshot/code-serializer.h" diff --git a/src/codegen/external-reference.cc b/src/codegen/external-reference.cc -index 2c7748f223c9359079b2c35b55aeaa04810eff85..770653d50ce129452829c43ef5cee3648f2f52aa 100644 +index b58157b16357040dd11fa4a4b8dbcd9d12244e81..b9a6cb6def990c8cc6c61b64f548964fa2483a37 100644 --- a/src/codegen/external-reference.cc +++ b/src/codegen/external-reference.cc -@@ -740,6 +740,11 @@ ExternalReference ExternalReference::address_of_regexp_stack_memory_top_address( +@@ -761,6 +761,11 @@ ExternalReference ExternalReference::address_of_regexp_stack_memory_top_address( isolate->regexp_stack()->memory_top_address_address()); } @@ -49,7 +49,7 @@ index 2c7748f223c9359079b2c35b55aeaa04810eff85..770653d50ce129452829c43ef5cee364 Isolate* isolate) { return ExternalReference(isolate->javascript_execution_assert_address()); diff --git a/src/codegen/external-reference.h b/src/codegen/external-reference.h -index cbc3463841332fbd3a9d40f5a1b3d3d1c3d382f7..86deb275f8b179eef7784cb30139b3c9735b7db7 100644 +index ca62ff9d7a32b6782e86b1b2bf24dddf69a0be6d..9f112240d215e3288a3dfb4051ae69d36dd340c1 100644 --- a/src/codegen/external-reference.h +++ b/src/codegen/external-reference.h @@ -72,6 +72,8 @@ class StatsCounter; @@ -62,7 +62,7 @@ index cbc3463841332fbd3a9d40f5a1b3d3d1c3d382f7..86deb275f8b179eef7784cb30139b3c9 V(thread_in_wasm_flag_address_address, \ "Isolate::thread_in_wasm_flag_address_address") \ diff --git a/src/debug/debug-interface.cc b/src/debug/debug-interface.cc -index 9c25064572112b649c108a89df3c83b29ac603a0..229e4ca8d8770a698dfb21606b29ac7ac0018dc2 100644 +index add2b3dbb4dc2e71a6dec717c29d957809797abf..e6ae32f9d2c11152c5184775f26e48a6870091ab 100644 --- a/src/debug/debug-interface.cc +++ b/src/debug/debug-interface.cc @@ -17,7 +17,6 @@ @@ -86,10 +86,10 @@ index 9c25064572112b649c108a89df3c83b29ac603a0..229e4ca8d8770a698dfb21606b29ac7a Isolate* Script::GetIsolate() const { diff --git a/src/execution/isolate.cc b/src/execution/isolate.cc -index eaf3096ac6bb05d61d93012d5b7abec503a3259e..051e58263cb66b1ad2dc1b59143d5826e0dfe376 100644 +index 474ea612bda4bf44776b919fd20e86e85ba3e3ce..ffcf10e4d282b85f1a22fa656113709f09ef34f2 100644 --- a/src/execution/isolate.cc +++ b/src/execution/isolate.cc -@@ -3591,7 +3591,6 @@ bool Isolate::Init(SnapshotData* startup_snapshot_data, +@@ -3596,7 +3596,6 @@ bool Isolate::Init(SnapshotData* startup_snapshot_data, store_stub_cache_ = new StubCache(this); materialized_object_store_ = new MaterializedObjectStore(this); regexp_stack_ = new RegExpStack(); @@ -1721,7 +1721,7 @@ index c3a3cb90f2a9d865057af80801e2a95bbb873140..74a3c95b06c771078ab03e6787e59123 // Labels used internally. Label entry_label_; diff --git a/test/cctest/cctest.status b/test/cctest/cctest.status -index 9c28520ed56998173c105b9d8a2ca3c4489b916e..e092d3b74c79d5dfc2bbf056881164c16ebb7cda 100644 +index e87644e89b7d87fb95917a58fef5f019d3ce7fc9..597ee4248bdd9e2dbb1ce05b322cd253dd403603 100644 --- a/test/cctest/cctest.status +++ b/test/cctest/cctest.status @@ -136,9 +136,6 @@ diff --git a/shell/browser/api/electron_api_event.cc b/shell/browser/api/electron_api_event.cc index bd7dc33e8906..81215e33825e 100644 --- a/shell/browser/api/electron_api_event.cc +++ b/shell/browser/api/electron_api_event.cc @@ -11,7 +11,7 @@ namespace { v8::Local CreateWithSender(v8::Isolate* isolate, v8::Local sender) { - return gin_helper::internal::CreateEvent(isolate, sender); + return gin_helper::internal::CreateCustomEvent(isolate, sender); } void Initialize(v8::Local exports, diff --git a/shell/browser/api/electron_api_session.cc b/shell/browser/api/electron_api_session.cc index 7d5397bcb204..21da79fbd27a 100644 --- a/shell/browser/api/electron_api_session.cc +++ b/shell/browser/api/electron_api_session.cc @@ -994,7 +994,7 @@ void Session::SetSpellCheckerLanguages( "\" is not a valid language code"); return; } - language_codes.AppendString(code); + language_codes.Append(code); } browser_context_->prefs()->Set(spellcheck::prefs::kSpellCheckDictionaries, language_codes); diff --git a/shell/browser/api/electron_api_web_contents.cc b/shell/browser/api/electron_api_web_contents.cc index 2518b382a3fa..0901c15f316d 100644 --- a/shell/browser/api/electron_api_web_contents.cc +++ b/shell/browser/api/electron_api_web_contents.cc @@ -3669,7 +3669,7 @@ void WebContents::OnDevToolsSearchCompleted( const std::vector& file_paths) { base::ListValue file_paths_value; for (const auto& file_path : file_paths) { - file_paths_value.AppendString(file_path); + file_paths_value.Append(file_path); } base::Value request_id_value(request_id); base::Value file_system_path_value(file_system_path); diff --git a/shell/browser/api/electron_api_web_frame_main.cc b/shell/browser/api/electron_api_web_frame_main.cc index a6415ef83903..8f934108a173 100644 --- a/shell/browser/api/electron_api_web_frame_main.cc +++ b/shell/browser/api/electron_api_web_frame_main.cc @@ -290,10 +290,14 @@ std::vector WebFrameMain::Frames() const { if (!CheckRenderFrame()) return frame_hosts; - for (auto* rfh : render_frame_->GetFramesInSubtree()) { - if (rfh->GetParent() == render_frame_) - frame_hosts.push_back(rfh); - } + render_frame_->ForEachRenderFrameHost(base::BindRepeating( + [](std::vector* frame_hosts, + content::RenderFrameHost* current_frame, + content::RenderFrameHost* rfh) { + if (rfh->GetParent() == current_frame) + frame_hosts->push_back(rfh); + }, + &frame_hosts, render_frame_)); return frame_hosts; } @@ -303,9 +307,10 @@ std::vector WebFrameMain::FramesInSubtree() const { if (!CheckRenderFrame()) return frame_hosts; - for (auto* rfh : render_frame_->GetFramesInSubtree()) { - frame_hosts.push_back(rfh); - } + render_frame_->ForEachRenderFrameHost(base::BindRepeating( + [](std::vector* frame_hosts, + content::RenderFrameHost* rfh) { frame_hosts->push_back(rfh); }, + &frame_hosts)); return frame_hosts; } diff --git a/shell/browser/electron_browser_client.cc b/shell/browser/electron_browser_client.cc index 4267d2f308cd..980e53f1f25b 100644 --- a/shell/browser/electron_browser_client.cc +++ b/shell/browser/electron_browser_client.cc @@ -1040,8 +1040,7 @@ NotificationPresenter* ElectronBrowserClient::GetNotificationPresenter() { } content::PlatformNotificationService* -ElectronBrowserClient::GetPlatformNotificationService( - content::BrowserContext* browser_context) { +ElectronBrowserClient::GetPlatformNotificationService() { if (!notification_service_) { notification_service_ = std::make_unique(this); } diff --git a/shell/browser/electron_browser_client.h b/shell/browser/electron_browser_client.h index 478c34ce79f7..d55cf968fff4 100644 --- a/shell/browser/electron_browser_client.h +++ b/shell/browser/electron_browser_client.h @@ -101,6 +101,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient, device::GeolocationManager* GetGeolocationManager() override; + content::PlatformNotificationService* GetPlatformNotificationService(); + protected: void RenderProcessWillLaunch(content::RenderProcessHost* host) override; content::SpeechRecognitionManagerDelegate* @@ -173,8 +175,6 @@ class ElectronBrowserClient : public content::ContentBrowserClient, content::MediaObserver* GetMediaObserver() override; std::unique_ptr CreateDevToolsManagerDelegate() override; - content::PlatformNotificationService* GetPlatformNotificationService( - content::BrowserContext* browser_context) override; std::unique_ptr CreateBrowserMainParts( const content::MainFunctionParams&) override; base::FilePath GetDefaultDownloadDirectory() override; diff --git a/shell/browser/electron_browser_context.cc b/shell/browser/electron_browser_context.cc index eab48d04d41e..502858f11717 100644 --- a/shell/browser/electron_browser_context.cc +++ b/shell/browser/electron_browser_context.cc @@ -229,7 +229,7 @@ void ElectronBrowserContext::InitPrefs() { base::i18n::GetConfiguredLocale()); if (!default_code.empty()) { base::ListValue language_codes; - language_codes.AppendString(default_code); + language_codes.Append(default_code); prefs()->Set(spellcheck::prefs::kSpellCheckDictionaries, language_codes); } } @@ -293,6 +293,11 @@ content::BrowserPluginGuestManager* ElectronBrowserContext::GetGuestManager() { return guest_manager_.get(); } +content::PlatformNotificationService* +ElectronBrowserContext::GetPlatformNotificationService() { + return ElectronBrowserClient::Get()->GetPlatformNotificationService(); +} + content::PermissionControllerDelegate* ElectronBrowserContext::GetPermissionControllerDelegate() { if (!permission_manager_.get()) diff --git a/shell/browser/electron_browser_context.h b/shell/browser/electron_browser_context.h index ca2c513ddf88..86dc1f56deee 100644 --- a/shell/browser/electron_browser_context.h +++ b/shell/browser/electron_browser_context.h @@ -106,6 +106,8 @@ class ElectronBrowserContext : public content::BrowserContext { std::string GetMediaDeviceIDSalt() override; content::DownloadManagerDelegate* GetDownloadManagerDelegate() override; content::BrowserPluginGuestManager* GetGuestManager() override; + content::PlatformNotificationService* GetPlatformNotificationService() + override; content::PermissionControllerDelegate* GetPermissionControllerDelegate() override; storage::SpecialStoragePolicy* GetSpecialStoragePolicy() override; diff --git a/shell/browser/electron_browser_main_parts.cc b/shell/browser/electron_browser_main_parts.cc index 107200e7f2b1..cf1b95c71a2f 100644 --- a/shell/browser/electron_browser_main_parts.cc +++ b/shell/browser/electron_browser_main_parts.cc @@ -431,8 +431,7 @@ int ElectronBrowserMainParts::PreMainMessageLoopRun() { #endif #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) - ui::TouchFactory::SetTouchDeviceListFromCommandLine(); + ui::TouchFactory::SetTouchDeviceListFromCommandLine(); #endif content::WebUIControllerFactory::RegisterFactory( diff --git a/shell/browser/event_emitter_mixin.h b/shell/browser/event_emitter_mixin.h index 7221899e9599..875a527c8f77 100644 --- a/shell/browser/event_emitter_mixin.h +++ b/shell/browser/event_emitter_mixin.h @@ -30,7 +30,7 @@ class EventEmitterMixin { v8::Local wrapper; if (!static_cast(this)->GetWrapper(isolate).ToLocal(&wrapper)) return false; - v8::Local event = internal::CreateEvent(isolate, wrapper); + v8::Local event = internal::CreateCustomEvent(isolate, wrapper); return EmitWithEvent(isolate, wrapper, name, event, std::forward(args)...); } diff --git a/shell/browser/extensions/electron_extension_system.cc b/shell/browser/extensions/electron_extension_system.cc index 824202459273..f459c723fc07 100644 --- a/shell/browser/extensions/electron_extension_system.cc +++ b/shell/browser/extensions/electron_extension_system.cc @@ -15,6 +15,7 @@ #include "base/path_service.h" #include "base/task/post_task.h" #include "chrome/common/chrome_paths.h" +#include "components/value_store/value_store_factory_impl.h" #include "content/public/browser/browser_context.h" #include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_thread.h" @@ -33,7 +34,6 @@ #include "extensions/browser/runtime_data.h" #include "extensions/browser/service_worker_manager.h" #include "extensions/browser/user_script_manager.h" -#include "extensions/browser/value_store/value_store_factory_impl.h" #include "extensions/common/constants.h" #include "extensions/common/file_util.h" #include "shell/browser/extensions/electron_extension_loader.h" @@ -63,7 +63,7 @@ std::string GetCryptoTokenManifest() { ElectronExtensionSystem::ElectronExtensionSystem( BrowserContext* browser_context) : browser_context_(browser_context), - store_factory_(base::MakeRefCounted( + store_factory_(base::MakeRefCounted( browser_context->GetPath())) {} ElectronExtensionSystem::~ElectronExtensionSystem() = default; @@ -185,7 +185,8 @@ StateStore* ElectronExtensionSystem::rules_store() { return nullptr; } -scoped_refptr ElectronExtensionSystem::store_factory() { +scoped_refptr +ElectronExtensionSystem::store_factory() { return store_factory_; } diff --git a/shell/browser/extensions/electron_extension_system.h b/shell/browser/extensions/electron_extension_system.h index f9f866f95a8a..84468596d9c7 100644 --- a/shell/browser/extensions/electron_extension_system.h +++ b/shell/browser/extensions/electron_extension_system.h @@ -13,6 +13,8 @@ #include "base/memory/ref_counted.h" #include "base/memory/weak_ptr.h" #include "base/one_shot_event.h" +#include "components/value_store/value_store_factory.h" +#include "components/value_store/value_store_factory_impl.h" #include "extensions/browser/extension_system.h" namespace base { @@ -63,7 +65,7 @@ class ElectronExtensionSystem : public ExtensionSystem { UserScriptManager* user_script_manager() override; StateStore* state_store() override; StateStore* rules_store() override; - scoped_refptr store_factory() override; + scoped_refptr store_factory() override; InfoMap* info_map() override; QuotaService* quota_service() override; AppSorting* app_sorting() override; @@ -108,7 +110,7 @@ class ElectronExtensionSystem : public ExtensionSystem { std::unique_ptr extension_loader_; - scoped_refptr store_factory_; + scoped_refptr store_factory_; // Signaled when the extension system has completed its startup tasks. base::OneShotEvent ready_; diff --git a/shell/browser/file_select_helper.cc b/shell/browser/file_select_helper.cc index 01cd90157c8a..3d3ea89a66d5 100644 --- a/shell/browser/file_select_helper.cc +++ b/shell/browser/file_select_helper.cc @@ -533,9 +533,12 @@ void FileSelectHelper::RenderFrameHostChanged( return; // The |old_host| and its children are now pending deletion. Do not give them // file access past this point. - if (render_frame_host_ == old_host || - render_frame_host_->IsDescendantOf(old_host)) { - render_frame_host_ = nullptr; + for (content::RenderFrameHost* host = render_frame_host_; host; + host = host->GetParentOrOuterDocument()) { + if (host == old_host) { + render_frame_host_ = nullptr; + return; + } } } diff --git a/shell/browser/javascript_environment.cc b/shell/browser/javascript_environment.cc index da6f11397b65..ab240b0b9061 100644 --- a/shell/browser/javascript_environment.cc +++ b/shell/browser/javascript_environment.cc @@ -76,7 +76,8 @@ class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { base::PartitionOptions::ThreadCache::kDisabled, base::PartitionOptions::Quarantine::kAllowed, base::PartitionOptions::Cookie::kAllowed, - base::PartitionOptions::RefCount::kDisallowed}); + base::PartitionOptions::BackupRefPtr::kDisabled, + base::PartitionOptions::UseConfigurablePool::kNo}); } // Allocate() methods return null to signal allocation failure to V8, which diff --git a/shell/browser/mac/dict_util.mm b/shell/browser/mac/dict_util.mm index 544e1aa13d58..d48ecb13daf4 100644 --- a/shell/browser/mac/dict_util.mm +++ b/shell/browser/mac/dict_util.mm @@ -32,23 +32,23 @@ base::ListValue NSArrayToListValue(NSArray* arr) { for (id value in arr) { if ([value isKindOfClass:[NSString class]]) { - result.AppendString(base::SysNSStringToUTF8(value)); + result.Append(base::SysNSStringToUTF8(value)); } else if ([value isKindOfClass:[NSNumber class]]) { const char* objc_type = [value objCType]; if (strcmp(objc_type, @encode(BOOL)) == 0 || strcmp(objc_type, @encode(char)) == 0) - result.AppendBoolean([value boolValue]); + result.Append([value boolValue]); else if (strcmp(objc_type, @encode(double)) == 0 || strcmp(objc_type, @encode(float)) == 0) result.Append([value doubleValue]); else - result.AppendInteger([value intValue]); + result.Append([value intValue]); } else if ([value isKindOfClass:[NSArray class]]) { result.Append(NSArrayToListValue(value)); } else if ([value isKindOfClass:[NSDictionary class]]) { result.Append(NSDictionaryToDictionaryValue(value)); } else { - result.AppendString(base::SysNSStringToUTF8([value description])); + result.Append(base::SysNSStringToUTF8([value description])); } } diff --git a/shell/browser/native_window_views.cc b/shell/browser/native_window_views.cc index 31e147204d12..69216c283fba 100644 --- a/shell/browser/native_window_views.cc +++ b/shell/browser/native_window_views.cc @@ -264,15 +264,13 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, options.Get(options::kType, &window_type); #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - // Start monitoring window states. - window_state_watcher_ = std::make_unique(this); + // Start monitoring window states. + window_state_watcher_ = std::make_unique(this); - // Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set. - bool use_dark_theme = false; - if (options.Get(options::kDarkTheme, &use_dark_theme) && use_dark_theme) { - SetGTKDarkThemeEnabled(use_dark_theme); - } + // Set _GTK_THEME_VARIANT to dark if we have "dark-theme" option set. + bool use_dark_theme = false; + if (options.Get(options::kDarkTheme, &use_dark_theme) && use_dark_theme) { + SetGTKDarkThemeEnabled(use_dark_theme); } #endif @@ -282,39 +280,37 @@ NativeWindowViews::NativeWindowViews(const gin_helper::Dictionary& options, #endif #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - // Before the window is mapped the SetWMSpecState can not work, so we have - // to manually set the _NET_WM_STATE. - std::vector state_atom_list; - bool skip_taskbar = false; - if (options.Get(options::kSkipTaskbar, &skip_taskbar) && skip_taskbar) { - state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_SKIP_TASKBAR")); - } - - // Before the window is mapped, there is no SHOW_FULLSCREEN_STATE. - if (fullscreen) { - state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_FULLSCREEN")); - } - - if (parent) { - // Force using dialog type for child window. - window_type = "dialog"; - - // Modal window needs the _NET_WM_STATE_MODAL hint. - if (is_modal()) - state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_MODAL")); - } - - if (!state_atom_list.empty()) - SetArrayProperty(static_cast(GetAcceleratedWidget()), - x11::GetAtom("_NET_WM_STATE"), x11::Atom::ATOM, - state_atom_list); - - // Set the _NET_WM_WINDOW_TYPE. - if (!window_type.empty()) - SetWindowType(static_cast(GetAcceleratedWidget()), - window_type); + // Before the window is mapped the SetWMSpecState can not work, so we have + // to manually set the _NET_WM_STATE. + std::vector state_atom_list; + bool skip_taskbar = false; + if (options.Get(options::kSkipTaskbar, &skip_taskbar) && skip_taskbar) { + state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_SKIP_TASKBAR")); } + + // Before the window is mapped, there is no SHOW_FULLSCREEN_STATE. + if (fullscreen) { + state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_FULLSCREEN")); + } + + if (parent) { + // Force using dialog type for child window. + window_type = "dialog"; + + // Modal window needs the _NET_WM_STATE_MODAL hint. + if (is_modal()) + state_atom_list.push_back(x11::GetAtom("_NET_WM_STATE_MODAL")); + } + + if (!state_atom_list.empty()) + SetArrayProperty(static_cast(GetAcceleratedWidget()), + x11::GetAtom("_NET_WM_STATE"), x11::Atom::ATOM, + state_atom_list); + + // Set the _NET_WM_WINDOW_TYPE. + if (!window_type.empty()) + SetWindowType(static_cast(GetAcceleratedWidget()), + window_type); #endif #if defined(OS_WIN) @@ -413,12 +409,10 @@ NativeWindowViews::~NativeWindowViews() { void NativeWindowViews::SetGTKDarkThemeEnabled(bool use_dark_theme) { #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - const std::string color = use_dark_theme ? "dark" : "light"; - x11::SetStringProperty(static_cast(GetAcceleratedWidget()), - x11::GetAtom("_GTK_THEME_VARIANT"), - x11::GetAtom("UTF8_STRING"), color); - } + const std::string color = use_dark_theme ? "dark" : "light"; + x11::SetStringProperty(static_cast(GetAcceleratedWidget()), + x11::GetAtom("_GTK_THEME_VARIANT"), + x11::GetAtom("UTF8_STRING"), color); #endif } @@ -474,7 +468,7 @@ void NativeWindowViews::Show() { NotifyWindowShow(); #if defined(USE_X11) - if (!features::IsUsingOzonePlatform() && global_menu_bar_) + if (global_menu_bar_) global_menu_bar_->OnWindowMapped(); #endif } @@ -485,7 +479,7 @@ void NativeWindowViews::ShowInactive() { NotifyWindowShow(); #if defined(USE_X11) - if (!features::IsUsingOzonePlatform() && global_menu_bar_) + if (global_menu_bar_) global_menu_bar_->OnWindowMapped(); #endif } @@ -499,7 +493,7 @@ void NativeWindowViews::Hide() { NotifyWindowHide(); #if defined(USE_X11) - if (!features::IsUsingOzonePlatform() && global_menu_bar_) + if (global_menu_bar_) global_menu_bar_->OnWindowUnmapped(); #endif @@ -521,9 +515,7 @@ bool NativeWindowViews::IsEnabled() { return ::IsWindowEnabled(GetAcceleratedWidget()); #elif defined(OS_LINUX) #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - return !event_disabler_.get(); - } + return !event_disabler_.get(); #endif NOTIMPLEMENTED(); return true; @@ -563,17 +555,15 @@ void NativeWindowViews::SetEnabledInternal(bool enable) { #if defined(OS_WIN) ::EnableWindow(GetAcceleratedWidget(), enable); #elif defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - views::DesktopWindowTreeHostPlatform* tree_host = - views::DesktopWindowTreeHostLinux::GetHostForWidget( - GetAcceleratedWidget()); - if (enable) { - tree_host->RemoveEventRewriter(event_disabler_.get()); - event_disabler_.reset(); - } else { - event_disabler_ = std::make_unique(); - tree_host->AddEventRewriter(event_disabler_.get()); - } + views::DesktopWindowTreeHostPlatform* tree_host = + views::DesktopWindowTreeHostLinux::GetHostForWidget( + GetAcceleratedWidget()); + if (enable) { + tree_host->RemoveEventRewriter(event_disabler_.get()); + event_disabler_.reset(); + } else { + event_disabler_ = std::make_unique(); + tree_host->AddEventRewriter(event_disabler_.get()); } #endif } @@ -786,13 +776,11 @@ bool NativeWindowViews::MoveAbove(const std::string& sourceId) { 0, 0, 0, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); #elif defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - if (!IsWindowValid(static_cast(id.id))) - return false; + if (!IsWindowValid(static_cast(id.id))) + return false; - electron::MoveWindowAbove(static_cast(GetAcceleratedWidget()), - static_cast(id.id)); - } + electron::MoveWindowAbove(static_cast(GetAcceleratedWidget()), + static_cast(id.id)); #endif return true; @@ -808,10 +796,8 @@ void NativeWindowViews::MoveTop() { size.width(), size.height(), SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); #elif defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - electron::MoveWindowToForeground( - static_cast(GetAcceleratedWidget())); - } + electron::MoveWindowToForeground( + static_cast(GetAcceleratedWidget())); #endif } @@ -994,10 +980,8 @@ void NativeWindowViews::SetSkipTaskbar(bool skip) { taskbar_host_.RestoreThumbarButtons(GetAcceleratedWidget()); } #elif defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - SetWMSpecState(static_cast(GetAcceleratedWidget()), skip, - x11::GetAtom("_NET_WM_STATE_SKIP_TASKBAR")); - } + SetWMSpecState(static_cast(GetAcceleratedWidget()), skip, + x11::GetAtom("_NET_WM_STATE_SKIP_TASKBAR")); #endif } @@ -1098,27 +1082,23 @@ void NativeWindowViews::SetIgnoreMouseEvents(bool ignore, bool forward) { SetForwardMouseMessages(forward); } #elif defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - auto* connection = x11::Connection::Get(); - if (ignore) { - 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(GetAcceleratedWidget()), - .rectangles = {r}, - }); - } else { - connection->shape().Mask({ - .operation = x11::Shape::So::Set, - .destination_kind = x11::Shape::Sk::Input, - .destination_window = - static_cast(GetAcceleratedWidget()), - .source_bitmap = x11::Pixmap::None, - }); - } + auto* connection = x11::Connection::Get(); + if (ignore) { + 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(GetAcceleratedWidget()), + .rectangles = {r}, + }); + } else { + connection->shape().Mask({ + .operation = x11::Shape::So::Set, + .destination_kind = x11::Shape::Sk::Input, + .destination_window = static_cast(GetAcceleratedWidget()), + .source_bitmap = x11::Pixmap::None, + }); } #endif } @@ -1157,23 +1137,21 @@ bool NativeWindowViews::IsFocusable() { void NativeWindowViews::SetMenu(ElectronMenuModel* menu_model) { #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - // Remove global menu bar. - if (global_menu_bar_ && menu_model == nullptr) { - global_menu_bar_.reset(); - root_view_->UnregisterAcceleratorsWithFocusManager(); - return; - } + // Remove global menu bar. + if (global_menu_bar_ && menu_model == nullptr) { + global_menu_bar_.reset(); + root_view_->UnregisterAcceleratorsWithFocusManager(); + return; + } - // Use global application menu bar when possible. - if (ShouldUseGlobalMenuBar()) { - if (!global_menu_bar_) - global_menu_bar_ = std::make_unique(this); - if (global_menu_bar_->IsServerStarted()) { - root_view_->RegisterAcceleratorsWithFocusManager(menu_model); - global_menu_bar_->SetMenu(menu_model); - return; - } + // Use global application menu bar when possible. + if (ShouldUseGlobalMenuBar()) { + if (!global_menu_bar_) + global_menu_bar_ = std::make_unique(this); + if (global_menu_bar_->IsServerStarted()) { + root_view_->RegisterAcceleratorsWithFocusManager(menu_model); + global_menu_bar_->SetMenu(menu_model); + return; } } #endif @@ -1255,13 +1233,11 @@ void NativeWindowViews::SetParentWindow(NativeWindow* parent) { NativeWindow::SetParentWindow(parent); #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - x11::SetProperty( - static_cast(GetAcceleratedWidget()), - x11::Atom::WM_TRANSIENT_FOR, x11::Atom::WINDOW, - parent ? static_cast(parent->GetAcceleratedWidget()) - : ui::GetX11RootWindow()); - } + x11::SetProperty( + static_cast(GetAcceleratedWidget()), + x11::Atom::WM_TRANSIENT_FOR, x11::Atom::WINDOW, + parent ? static_cast(parent->GetAcceleratedWidget()) + : ui::GetX11RootWindow()); #elif defined(OS_WIN) // To set parentship between windows into Windows is better to play with the // owner instead of the parent, as Windows natively seems to do if a parent @@ -1340,18 +1316,17 @@ void NativeWindowViews::SetVisibleOnAllWorkspaces( bool NativeWindowViews::IsVisibleOnAllWorkspaces() { #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to - // determine whether the current window is visible on all workspaces. - x11::Atom sticky_atom = x11::GetAtom("_NET_WM_STATE_STICKY"); - std::vector wm_states; - GetArrayProperty(static_cast(GetAcceleratedWidget()), - x11::GetAtom("_NET_WM_STATE"), &wm_states); - return std::find(wm_states.begin(), wm_states.end(), sticky_atom) != - wm_states.end(); - } -#endif + // Use the presence/absence of _NET_WM_STATE_STICKY in _NET_WM_STATE to + // determine whether the current window is visible on all workspaces. + x11::Atom sticky_atom = x11::GetAtom("_NET_WM_STATE_STICKY"); + std::vector wm_states; + GetArrayProperty(static_cast(GetAcceleratedWidget()), + x11::GetAtom("_NET_WM_STATE"), &wm_states); + return std::find(wm_states.begin(), wm_states.end(), sticky_atom) != + wm_states.end(); +#else return false; +#endif } content::DesktopMediaID NativeWindowViews::GetDesktopMediaID() const { diff --git a/shell/browser/net/system_network_context_manager.cc b/shell/browser/net/system_network_context_manager.cc index 9daf131a52ed..5a920823fb69 100644 --- a/shell/browser/net/system_network_context_manager.cc +++ b/shell/browser/net/system_network_context_manager.cc @@ -342,8 +342,6 @@ SystemNetworkContextManager::CreateNetworkContextParams() { network::mojom::NetworkContextParamsPtr network_context_params = CreateDefaultNetworkContextParams(); - network_context_params->context_name = std::string("system"); - network_context_params->user_agent = electron::ElectronBrowserClient::Get()->GetUserAgent(); diff --git a/shell/browser/ui/autofill_popup.cc b/shell/browser/ui/autofill_popup.cc index 1bf596316b85..066f5b21abfc 100644 --- a/shell/browser/ui/autofill_popup.cc +++ b/shell/browser/ui/autofill_popup.cc @@ -6,8 +6,10 @@ #include #include +#include "base/feature_list.h" #include "base/i18n/rtl.h" #include "chrome/browser/ui/views/autofill/autofill_popup_view_utils.h" +#include "components/autofill/core/common/autofill_features.h" #include "electron/buildflags/buildflags.h" #include "mojo/public/cpp/bindings/associated_remote.h" #include "shell/browser/native_window_views.h" @@ -114,8 +116,18 @@ void AutofillPopup::UpdatePopupBounds() { gfx::Size preferred_size = gfx::Size(GetDesiredPopupWidth(), GetDesiredPopupHeight()); - popup_bounds_ = CalculatePopupBounds(preferred_size, window_bounds, bounds, - base::i18n::IsRTL()); + + if (base::FeatureList::IsEnabled( + autofill::features::kAutofillCenterAlignedSuggestions)) { + popup_bounds_ = CalculatePopupBounds(preferred_size, window_bounds, bounds, + base::i18n::IsRTL(), true); + CalculatePopupXAndWidthHorizontallyCentered( + preferred_size.width(), window_bounds, element_bounds_, + base::i18n::IsRTL(), &popup_bounds_); + } else { + popup_bounds_ = CalculatePopupBounds(preferred_size, window_bounds, bounds, + base::i18n::IsRTL(), false); + } } gfx::Rect AutofillPopup::popup_bounds_in_view() { diff --git a/shell/browser/ui/file_dialog_gtk.cc b/shell/browser/ui/file_dialog_gtk.cc index 90b87db16c37..3f60f6e25830 100644 --- a/shell/browser/ui/file_dialog_gtk.cc +++ b/shell/browser/ui/file_dialog_gtk.cc @@ -244,13 +244,11 @@ class FileChooserDialog { gtk_widget_show_all(GTK_WIDGET(dialog_)); #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - // We need to call gtk_window_present after making the widgets visible - // to make sure window gets correctly raised and gets focus. - x11::Time time = ui::X11EventSource::GetInstance()->GetTimestamp(); - gtk_window_present_with_time(GTK_WINDOW(dialog_), - static_cast(time)); - } + // We need to call gtk_window_present after making the widgets visible + // to make sure window gets correctly raised and gets focus. + x11::Time time = ui::X11EventSource::GetInstance()->GetTimestamp(); + gtk_window_present_with_time(GTK_WINDOW(dialog_), + static_cast(time)); #endif } } diff --git a/shell/browser/ui/gtk/menu_util.cc b/shell/browser/ui/gtk/menu_util.cc index c119515e2fd2..08f2a5544b8e 100644 --- a/shell/browser/ui/gtk/menu_util.cc +++ b/shell/browser/ui/gtk/menu_util.cc @@ -226,14 +226,12 @@ void BuildSubmenuFromModel(ui::MenuModel* model, } #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - ui::Accelerator accelerator; - if (model->GetAcceleratorAt(i, &accelerator)) { - gtk_widget_add_accelerator(menu_item, "activate", nullptr, - GetGdkKeyCodeForAccelerator(accelerator), - GetGdkModifierForAccelerator(accelerator), - GTK_ACCEL_VISIBLE); - } + ui::Accelerator accelerator; + if (model->GetAcceleratorAt(i, &accelerator)) { + gtk_widget_add_accelerator(menu_item, "activate", nullptr, + GetGdkKeyCodeForAccelerator(accelerator), + GetGdkModifierForAccelerator(accelerator), + GTK_ACCEL_VISIBLE); } #endif diff --git a/shell/browser/ui/message_box_gtk.cc b/shell/browser/ui/message_box_gtk.cc index d69fd32d3818..04c5ad1b0a1d 100644 --- a/shell/browser/ui/message_box_gtk.cc +++ b/shell/browser/ui/message_box_gtk.cc @@ -159,13 +159,11 @@ class GtkMessageBox : public NativeWindowObserver { gtk_widget_show(dialog_); #if defined(USE_X11) - if (!features::IsUsingOzonePlatform()) { - // We need to call gtk_window_present after making the widgets visible to - // make sure window gets correctly raised and gets focus. - x11::Time time = ui::X11EventSource::GetInstance()->GetTimestamp(); - gtk_window_present_with_time(GTK_WINDOW(dialog_), - static_cast(time)); - } + // We need to call gtk_window_present after making the widgets visible to + // make sure window gets correctly raised and gets focus. + x11::Time time = ui::X11EventSource::GetInstance()->GetTimestamp(); + gtk_window_present_with_time(GTK_WINDOW(dialog_), + static_cast(time)); #endif } diff --git a/shell/browser/web_contents_permission_helper.cc b/shell/browser/web_contents_permission_helper.cc index 8ac0b5ca5794..fb1c81852d72 100644 --- a/shell/browser/web_contents_permission_helper.cc +++ b/shell/browser/web_contents_permission_helper.cc @@ -133,11 +133,11 @@ void WebContentsPermissionHelper::RequestMediaAccessPermission( auto media_types = std::make_unique(); if (request.audio_type == blink::mojom::MediaStreamType::DEVICE_AUDIO_CAPTURE) { - media_types->AppendString("audio"); + media_types->Append("audio"); } if (request.video_type == blink::mojom::MediaStreamType::DEVICE_VIDEO_CAPTURE) { - media_types->AppendString("video"); + media_types->Append("video"); } details.SetList("mediaTypes", std::move(media_types)); diff --git a/shell/common/asar/archive.cc b/shell/common/asar/archive.cc index 2a5d43997244..279b271adc06 100644 --- a/shell/common/asar/archive.cc +++ b/shell/common/asar/archive.cc @@ -130,7 +130,7 @@ bool FillFileInfoWithNode(Archive::FileInfo* info, integrity->GetInteger("blockSize", &block_size) && integrity->GetList("blocks", &blocks) && block_size > 0) { integrity_payload.block_size = static_cast(block_size); - for (size_t i = 0; i < blocks->GetSize(); i++) { + for (size_t i = 0; i < blocks->GetList().size(); i++) { std::string block; if (!blocks->GetString(i, &block)) { LOG(FATAL) diff --git a/shell/common/gin_converters/net_converter.cc b/shell/common/gin_converters/net_converter.cc index 96bfab8032bb..d77678e023d9 100644 --- a/shell/common/gin_converters/net_converter.cc +++ b/shell/common/gin_converters/net_converter.cc @@ -317,7 +317,7 @@ bool Converter>::FromV8( if (!ConvertFromV8(isolate, val, list.get())) return false; *out = base::MakeRefCounted(); - for (size_t i = 0; i < list->GetSize(); ++i) { + for (size_t i = 0; i < list->GetList().size(); ++i) { base::DictionaryValue* dict = nullptr; std::string type; if (!list->GetDictionary(i, &dict)) diff --git a/shell/common/gin_helper/event_emitter.cc b/shell/common/gin_helper/event_emitter.cc index 737305911fc5..8779c05507ba 100644 --- a/shell/common/gin_helper/event_emitter.cc +++ b/shell/common/gin_helper/event_emitter.cc @@ -26,9 +26,9 @@ void PreventDefault(gin_helper::Arguments* args) { } // namespace -v8::Local CreateEvent(v8::Isolate* isolate, - v8::Local sender, - v8::Local custom_event) { +v8::Local CreateCustomEvent(v8::Isolate* isolate, + v8::Local sender, + v8::Local custom_event) { if (event_template.IsEmpty()) { event_template.Reset( isolate, @@ -62,7 +62,7 @@ v8::Local CreateNativeEvent( event = native_event.ToV8().As(); } else { // No need to create native event if we do not need to send reply. - event = CreateEvent(isolate); + event = CreateCustomEvent(isolate); } Dictionary dict(isolate, event); diff --git a/shell/common/gin_helper/event_emitter.h b/shell/common/gin_helper/event_emitter.h index 92be7098e911..3d5e1fc21377 100644 --- a/shell/common/gin_helper/event_emitter.h +++ b/shell/common/gin_helper/event_emitter.h @@ -21,7 +21,7 @@ namespace gin_helper { namespace internal { -v8::Local CreateEvent( +v8::Local CreateCustomEvent( v8::Isolate* isolate, v8::Local sender = v8::Local(), v8::Local custom_event = v8::Local()); @@ -53,9 +53,9 @@ class EventEmitter : public gin_helper::Wrappable { bool EmitCustomEvent(base::StringPiece name, v8::Local event, Args&&... args) { - return EmitWithEvent(name, - internal::CreateEvent(isolate(), GetWrapper(), event), - std::forward(args)...); + return EmitWithEvent( + name, internal::CreateCustomEvent(isolate(), GetWrapper(), event), + std::forward(args)...); } // this.emit(name, new Event(), args...); @@ -66,7 +66,8 @@ class EventEmitter : public gin_helper::Wrappable { v8::Local wrapper = GetWrapper(); if (wrapper.IsEmpty()) return false; - v8::Local event = internal::CreateEvent(isolate(), wrapper); + v8::Local event = + internal::CreateCustomEvent(isolate(), wrapper); return EmitWithEvent(name, event, std::forward(args)...); } diff --git a/shell/common/v8_value_converter.cc b/shell/common/v8_value_converter.cc index a5d81a894a93..62d9ccc22527 100644 --- a/shell/common/v8_value_converter.cc +++ b/shell/common/v8_value_converter.cc @@ -202,10 +202,10 @@ v8::Local V8ValueConverter::ToV8ValueImpl( v8::Local V8ValueConverter::ToV8Array( v8::Isolate* isolate, const base::ListValue* val) const { - v8::Local result(v8::Array::New(isolate, val->GetSize())); + v8::Local result(v8::Array::New(isolate, val->GetList().size())); auto context = isolate->GetCurrentContext(); - for (size_t i = 0; i < val->GetSize(); ++i) { + for (size_t i = 0; i < val->GetList().size(); ++i) { const base::Value* child = nullptr; val->Get(i, &child); diff --git a/shell/renderer/api/electron_api_web_frame.cc b/shell/renderer/api/electron_api_web_frame.cc index fdfef420f26c..10e8e46f7dc3 100644 --- a/shell/renderer/api/electron_api_web_frame.cc +++ b/shell/renderer/api/electron_api_web_frame.cc @@ -49,6 +49,7 @@ #include "third_party/blink/public/web/web_script_execution_callback.h" #include "third_party/blink/public/web/web_script_source.h" #include "third_party/blink/public/web/web_view.h" +#include "third_party/blink/renderer/platform/bindings/dom_wrapper_world.h" // nogncheck #include "ui/base/ime/ime_text_span.h" #include "url/url_util.h" @@ -651,17 +652,20 @@ class WebFrameRenderer : public gin::Wrappable, return handle; } + const blink::WebScriptSource source{blink::WebString::FromUTF16(code)}; + bool has_user_gesture = false; args->GetNext(&has_user_gesture); ScriptExecutionCallback::CompletionCallback completion_callback; args->GetNext(&completion_callback); - render_frame->GetWebFrame()->RequestExecuteScriptAndReturnValue( - blink::WebScriptSource(blink::WebString::FromUTF16(code)), - has_user_gesture, + render_frame->GetWebFrame()->RequestExecuteScript( + blink::DOMWrapperWorld::kMainWorldId, base::make_span(&source, 1), + has_user_gesture, blink::WebLocalFrame::kSynchronous, new ScriptExecutionCallback(std::move(promise), - std::move(completion_callback))); + std::move(completion_callback)), + blink::BackForwardCacheAware::kAllow); return handle; } @@ -695,6 +699,7 @@ class WebFrameRenderer : public gin::Wrappable, args->GetNext(&completion_callback); std::vector sources; + sources.reserve(scripts.size()); for (const auto& script : scripts) { std::u16string code; @@ -716,13 +721,12 @@ class WebFrameRenderer : public gin::Wrappable, return handle; } - sources.emplace_back( - blink::WebScriptSource(blink::WebString::FromUTF16(code), - blink::WebURL(GURL(url)), start_line)); + sources.emplace_back(blink::WebString::FromUTF16(code), + blink::WebURL(GURL(url)), start_line); } - render_frame->GetWebFrame()->RequestExecuteScriptInIsolatedWorld( - world_id, &sources.front(), sources.size(), has_user_gesture, + render_frame->GetWebFrame()->RequestExecuteScript( + world_id, base::make_span(sources), has_user_gesture, scriptExecutionType, new ScriptExecutionCallback(std::move(promise), std::move(completion_callback)), diff --git a/spec/api-clipboard-spec.js b/spec/api-clipboard-spec.js index 3a4e6426c346..7ca0932f1538 100644 --- a/spec/api-clipboard-spec.js +++ b/spec/api-clipboard-spec.js @@ -30,7 +30,7 @@ ifdescribe(process.platform !== 'win32' || process.arch !== 'arm64')('clipboard describe('clipboard.readHTML()', () => { it('returns markup correctly', () => { const text = 'Hi'; - const markup = process.platform === 'darwin' ? "Hi" : process.platform === 'linux' ? 'Hi' : 'Hi'; + const markup = process.platform === 'darwin' ? "Hi" : 'Hi'; clipboard.writeHTML(text); expect(clipboard.readHTML()).to.equal(markup); }); @@ -74,7 +74,7 @@ ifdescribe(process.platform !== 'win32' || process.arch !== 'arm64')('clipboard const rtf = '{\\rtf1\\utf8 text}'; const p = path.join(fixtures, 'assets', 'logo.png'); const i = nativeImage.createFromPath(p); - const markup = process.platform === 'darwin' ? "Hi" : process.platform === 'linux' ? 'Hi' : 'Hi'; + const markup = process.platform === 'darwin' ? "Hi" : 'Hi'; const bookmark = { title: 'a title', url: 'test' }; clipboard.write({ text: 'test',