UI rendering timeout reduced from 5 seconds to 500 milliseconds
Minor
Commit Hash:
c8c948c22ea267c890ab24161a8a71bdb5a6f03c
Commit Time: 2025-03-11 18:53:26+00:00
Impact Level: Minor
Generated By: webview2-upstream-sentry
Upstream Review:
View Upstream Review 🔗
📋 Summary
This submission shortens the UI painting timeout constant kUIPaintTimeout in the native_widget_ns_window_bridge.mm file of the remote_cocoa component from the original 5 seconds (base::Seconds(5)) to 500 milliseconds (base::Milliseconds(500)). This constant is used to control the maximum time to wait for UI painting to complete under certain circumstances, with the aim of reducing the time the UI thread is blocked and lowering the risk of interface jank.
🎯 Impact Analysis
This change will affect all downstream code that depends on remote_cocoa::NativeWidgetNSWindowBridge, including WebView2Mac. Since WebView2Mac inherits and utilizes the window management and rendering logic of NativeWidgetNSWindowBridge through HostingNSWindowBridge, the reduction of the UI rendering timeout means that, in extreme cases, if the WebView2Mac window fails to complete rendering for an extended period, the timeout logic will be triggered more quickly. This helps improve overall interface responsiveness and reduces the risk of prolonged stalling, but may also cause the window to enter fallback handling earlier in certain extreme cases where the content is not rendered in time. Overall, the impact of this change on WebView2Mac is generally positive, falling under the category of performance optimization, and will not affect functional correctness.
Impacted Classes:
remote_cocoa::NativeWidgetNSWindowBridge
edge_embedded_browser::HostingNSWindowBridge