DescriptionSend vrdisplayactivate to the most recently focused navigator listening for displayactivate.
Since focus changes are reported late in the Android lifecycle, we can end up in a situation where we send vrdisplayactivate, but no webVR frames are considered focused yet.
This change makes it so that even if no webVR frame is currently focused, we still send displayactivate to the most recently focused frame (which has the added benefit of ensuring only one frame can call requestPresent in response). This is safe because we only fire displayactivate at all if we are sure some frame was listening for displayactivate before the Android VR DON flow paused chrome and unfocused the frame.
In the future we should track focus fully browser-side to more securely solve this issue.
This CL also prevents a possible reconnect loop if the page mistakenly thinks it has focus when it doesn't by detecting repeated connection failures.
BUG=706472
Review-Url: https://codereview.chromium.org/2783993002
Cr-Commit-Position: refs/heads/master@{#460558}
Committed: https://chromium.googlesource.com/chromium/src/+/b6d4321b17cea01782056a317aeb781367921531
Patch Set 1 #
Messages
Total messages: 14 (8 generated)
|