diff --git a/BUILD.gn b/BUILD.gn index 1dee134735..d48026e2a7 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -53,6 +53,16 @@ if (is_mac) { assert( mac_deployment_target == "13.0", "Chromium has updated the mac_deployment_target, please update this assert and flag this as a breaking change (docs/breaking-changes.md)") + + # shell/browser/feature_list_mac.mm enables this unexported content feature + # by name; fail here rather than silently if a Chromium roll removes it. + assert( + filter_include( + read_file( + "//content/browser/renderer_host/render_widget_host_view_mac.mm", + "list lines"), + [ "BASE_FEATURE(kThrottleResizeIpc,*" ]) != [], + "kThrottleResizeIpc is gone from render_widget_host_view_mac.mm; update shell/browser/feature_list_mac.mm") } if (is_linux) { diff --git a/patches/chromium/.patches b/patches/chromium/.patches index 000093f8bb..f947ae3a80 100644 --- a/patches/chromium/.patches +++ b/patches/chromium/.patches @@ -93,7 +93,6 @@ fix_move_autopipsettingshelper_behind_branding_buildflag.patch revert_remove_the_allowaggressivethrottlingwithwebsocket_feature.patch feat_allow_passing_of_objecttemplate_to_objecttemplatebuilder.patch chore_remove_check_is_test_on_script_injection_tracker.patch -fix_restore_original_resize_performance_on_macos.patch feat_allow_code_cache_in_custom_schemes.patch build_run_reclient_cfg_generator_after_chrome.patch refactor_expose_file_system_access_blocklist.patch diff --git a/patches/chromium/fix_restore_original_resize_performance_on_macos.patch b/patches/chromium/fix_restore_original_resize_performance_on_macos.patch deleted file mode 100644 index 3162cb1ea8..0000000000 --- a/patches/chromium/fix_restore_original_resize_performance_on_macos.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: Samuel Attard -Date: Tue, 21 Nov 2023 15:03:21 -0800 -Subject: fix: restore original resize performance on macOS - -Reverts https://chromium-review.googlesource.com/c/chromium/src/+/3118293 which -fixed a android only regression but in the process regressed electron window -resize perf wildly on macOS. - -This patch should be upstreamed as a conditional revert of the logic in desktop -vs mobile runtimes. i.e. restore the old logic only on desktop platforms - -diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index 94a3ee40f5594ce2aebe6aed5a1e4794008ecfa2..c1220bb3bc575ffa7c0e207cef7ee0cf3ed4d2b3 100644 ---- a/content/browser/renderer_host/render_widget_host_impl.cc -+++ b/content/browser/renderer_host/render_widget_host_impl.cc -@@ -2260,14 +2260,8 @@ RenderWidgetHostImpl::GetWidgetInputHandler() { - void RenderWidgetHostImpl::NotifyScreenInfoChanged(bool ignore_ack) { - // The resize message (which may not happen immediately) will carry with it - // the screen info as well as the new size (if the screen has changed scale -- // factor). Force sending the new visual properties even if there is one in -- // flight to ensure proper IPC ordering for features like the Fullscreen API -- // if ignore_ack is true. Otherwise, respect the pending ACK throttle. -- if (ignore_ack) { -- SynchronizeVisualPropertiesIgnoringPendingAck(); -- } else { -- SynchronizeVisualProperties(); -- } -+ // factor). -+ SynchronizeVisualProperties(); - - // The device scale factor will be same for all the views contained by the - // primary main frame, so just set it once. diff --git a/patches/chromium/revert_partial_remove_unused_prehandlemouseevent.patch b/patches/chromium/revert_partial_remove_unused_prehandlemouseevent.patch index 8b5292e892..c19d4b06ed 100644 --- a/patches/chromium/revert_partial_remove_unused_prehandlemouseevent.patch +++ b/patches/chromium/revert_partial_remove_unused_prehandlemouseevent.patch @@ -39,7 +39,7 @@ index 44b99ecb47eda44247b345951602f60067de08d2..305e46bbd12767e7d2b091165f1dee3e // event before sending it to the renderer. See enum for details on return // value. diff --git a/content/browser/renderer_host/render_widget_host_impl.cc b/content/browser/renderer_host/render_widget_host_impl.cc -index c1220bb3bc575ffa7c0e207cef7ee0cf3ed4d2b3..a2e58eb7de4561c9d2623ca1c13e7479d883c538 100644 +index 94a3ee40f5594ce2aebe6aed5a1e4794008ecfa2..283aef5ca56f86b9d4772ed868f36078d13deb63 100644 --- a/content/browser/renderer_host/render_widget_host_impl.cc +++ b/content/browser/renderer_host/render_widget_host_impl.cc @@ -1633,6 +1633,10 @@ void RenderWidgetHostImpl::ForwardMouseEventWithLatencyInfo( diff --git a/shell/browser/feature_list_mac.mm b/shell/browser/feature_list_mac.mm index 6c57209399..e2eafc04bf 100644 --- a/shell/browser/feature_list_mac.mm +++ b/shell/browser/feature_list_mac.mm @@ -11,24 +11,24 @@ namespace electron { std::string EnablePlatformSpecificFeatures() { + // None of these flags are exported, so they are referenced by name. + + // Throttle visual-property IPCs during live resize (kThrottleResizeIpc in + // content/browser/renderer_host/render_widget_host_view_mac.mm). + std::string features = "ThrottleResizeIpc"; if (@available(macOS 14.4, *)) { - // These flags aren't exported so reference them by name directly, they are - // used to ensure that screen and window capture exclusive use - // ScreenCaptureKit APIs to avoid warning dialogs on macOS 14.4 and higher. - // kScreenCaptureKitPickerScreen, - // chrome/browser/media/webrtc/thumbnail_capturer_mac.mm - // kScreenCaptureKitStreamPickerSonoma, - // chrome/browser/media/webrtc/thumbnail_capturer_mac.mm + // Make screen and window capture use ScreenCaptureKit APIs exclusively to + // avoid warning dialogs on macOS 14.4 and higher. + // kScreenCaptureKitPickerScreen, kScreenCaptureKitStreamPickerSonoma, // kThumbnailCapturerMac, // chrome/browser/media/webrtc/thumbnail_capturer_mac.mm -#if DCHECK_IS_ON() - return "ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma"; -#else - return "ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma," - "ThumbnailCapturerMac:capture_mode/sc_screenshot_manager"; + features += + ",ScreenCaptureKitPickerScreen,ScreenCaptureKitStreamPickerSonoma"; +#if !DCHECK_IS_ON() + features += ",ThumbnailCapturerMac:capture_mode/sc_screenshot_manager"; #endif } - return ""; + return features; } std::string DisablePlatformSpecificFeatures() {