Fix the Browser.Tabs.TotalSwitchDuration UMA metric for MacOS
In MacOS, tab switch follows a different path than in Windows/Linux. It calls DelegatedFrameHost::WasShown when we are inside the call stack of NativeViewHostMac::AttachNativeView. This results in the check whether we have saved frames or not inside RWHVMac::WasUnOccluded to always return true since we have called DelegatedFrameHost::WasShown previously. This CL saves the saved frame condition before we call the first DelegatedFrameHost::WasShown in MacOS, and use this value to determine whether we have saved frames or not at a tab switch. Note that this might cause an upward spike in the MPArch.RWH_TabSwitchPaintDuration UMA metric since previously, it always record time as if we have saved frames, i.e. the presentation time for the delegated frame host. This CL will change that behavior to record time properly based on whether we have saved frames or not, which leads to a possible spike in the metric. Bug: 921120 Change-Id: If196665bb287a8b3e27ce24f4151ff88ae5f841f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1538560 Commit-Queue: Edwin Joe <ejoe@google.com> Reviewed-by:Jonathan Ross <jonross@chromium.org> Cr-Commit-Position: refs/heads/master@{#644429}
Showing
Please register or sign in to comment