Fix live resize hang in NativeWidgetNSWindowBridge
Minor
提交哈希:
e5fb1d74ec9a3ef05c4bf47d795412c85d4ae37b
提交时间: 2026-05-08 19:30:50
影响等级: Minor
生成工具: chromium-watcher
上游审核链接:
查看上游审核 🔗
📋 摘要
This commit fixes a hang in NativeWidgetNSWindowBridge during live window resize. The root cause was that SetCALayerParams only notifies when a frame arrives at a new size. If OnLiveResizeToFrame set live_resize_.pending_window_frame to a size matching the current content_dip_size_, no notification would ever arrive for that size, causing the pending frame to never be cleared and all subsequent resizes to hang. The fix adds an early return in OnLiveResizeToFrame when the new frame size matches content_dip_size_, and a DCHECK on the dequeued pending frame to ensure it always differs from the current content size.
🎯 影响分析
This commit has minor impact on WebView2Mac. The fix targets the live resize mechanism in NativeWidgetNSWindowBridge, specifically the live_resize_ struct, OnLiveResizeToFrame method, and queued_pending_window_frame member. Inspection of the Edge downstream codebase (Q:\Edge\src\components\remote_cocoa\app_shim\native_widget_ns_window_bridge.mm) confirms that the entire live_resize_ infrastructure, the OnLiveResizeToFrame method, and the queued frame logic do not exist in the downstream code. Therefore, neither the bug nor the fix applies to the current Edge downstream version. When the upstream live resize mechanism is eventually merged downstream, this fix will come along with it and requires no special attention. The SetCALayerParams method exists downstream with consistent logic, and this commit does not modify that method itself.
受影响的类:
remote_cocoa::NativeWidgetNSWindowBridge