New issue
Advanced search Search tips

Issue 706472 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 1
Type: Bug
Proj-XR

Blocking:
issue 686232



Sign in to add a comment

Race between WindowFocusedChanged and vrdisplayactivate causes vrdisplayactivate not to fire

Project Member Reported by mthiesse@chromium.org, Mar 29 2017

Issue description

We send vrdisplayactivate before WindowFocusChanged fires, so at the time we send vrdisplayactivate, there are no focused windows. This only works because a clank bug doesn't unfocus windows at the moment.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 29 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b6d4321b17cea01782056a317aeb781367921531

commit b6d4321b17cea01782056a317aeb781367921531
Author: mthiesse <mthiesse@chromium.org>
Date: Wed Mar 29 22:36:52 2017

Send 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}

[modify] https://crrev.com/b6d4321b17cea01782056a317aeb781367921531/device/vr/android/gvr/gvr_device_provider.cc
[modify] https://crrev.com/b6d4321b17cea01782056a317aeb781367921531/device/vr/vr_device_manager.cc
[modify] https://crrev.com/b6d4321b17cea01782056a317aeb781367921531/device/vr/vr_device_manager.h
[modify] https://crrev.com/b6d4321b17cea01782056a317aeb781367921531/device/vr/vr_display_impl.cc
[modify] https://crrev.com/b6d4321b17cea01782056a317aeb781367921531/device/vr/vr_service_impl.cc
[modify] https://crrev.com/b6d4321b17cea01782056a317aeb781367921531/third_party/WebKit/Source/modules/vr/VRDisplay.cpp
[modify] https://crrev.com/b6d4321b17cea01782056a317aeb781367921531/third_party/WebKit/Source/modules/vr/VRDisplay.h

Labels: -Pri-3 Pri-1
Status: Fixed (was: Started)
Components: Blink>WebXR

Sign in to add a comment