Mac: Split kAsyncLiveResize from kCATransactionV2

提交: 9cf46ff0 | 2026-05-18 16:47:12

← 返回列表

Mac: Split kAsyncLiveResize from kCATransactionV2

Moderate
提交哈希: 9cf46ff0e8cb7958ea4f799f71d2590dcce7f5ef
提交时间: 2026-05-18 16:47:12
影响等级: Moderate
生成工具: chromium-watcher
上游审核链接: 查看上游审核 🔗

📋 摘要

This commit separates the async live-resize functionality from the kCATransactionV2 feature flag into a new independent feature flag kAsyncLiveResize (disabled by default). The rationale is that async live-resize, while avoiding blocking the UI thread, comes with too many regressions to pursue in the first iteration. The new CATransactionV2 still blocks the UI thread but does so in a safer place than previous implementations. The change replaces kCATransactionV2 checks with kAsyncLiveResize in native_widget_ns_window_bridge.mm and views_nswindow_delegate.mm, and adds the new kAsyncLiveResize feature declaration in ui_base_features.

🎯 影响分析

This commit has moderate impact on WebView2Mac. It directly modifies two key files in the remote_cocoa component:
1. native_widget_ns_window_bridge.mm — Changes the feature check in the CATransaction synchronization logic after window resize from kCATransactionV2 to kAsyncLiveResize. The Edge downstream code at line 2229-2231 still uses kCATransactionV2 for this check.
2. views_nswindow_delegate.mm — Changes the feature check controlling async live-resize behavior in the windowWillResize: delegate method from kCATransactionV2 to kAsyncLiveResize. The Edge downstream code at line 187 still uses kCATransactionV2.

On the next upstream merge, Edge downstream will need to: (a) add the kAsyncLiveResize feature declaration in ui/base/ui_base_features.cc/.h; (b) update the feature checks in both files. Since kAsyncLiveResize is disabled by default, the behavioral change after merge is: the async live-resize code path in views_nswindow_delegate.mm (previously guarded by kCATransactionV2 which was enabled by default) will no longer trigger (since the new flag is disabled by default). The CATransaction synchronization behavior will also change — previously skipped because kCATransactionV2 was enabled, it will now resume synchronization calls since kAsyncLiveResize is disabled. This may affect performance characteristics during window resizing.

受影响的类:

remote_cocoa::NativeWidgetNSWindowBridge ViewsNSWindowDelegate features::kCATransactionV2 features::kAsyncLiveResize