Closed Bug 1587366 Opened 5 years ago Closed 5 years ago

WebVR enumeration promises are not resolved when a session is restored

Categories

(Core :: WebVR, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla71
Tracking Status
firefox71 --- fixed

People

(Reporter: mortimergoro, Assigned: mortimergoro)

Details

Attachments

(2 files)

STR using Firefox Reality and Oculus Quest/Go:

  • Open WebVR sample
  • The EnterVR button is visible
  • Click on the home button
  • Quit FxR and reopen it again
  • The session is restored and the EnterVR button is not visible
Assignee: nobody → imanol

After some research I found this happens because vmp->GetVRActiveStatus() always returns false in VRManager.cpp after a session is restored. This causes the navigatio.getVRDisplays() promises to never be resolved.

VRActiveStatus is set true/false in nsGlobalWindowOuter::SetIsBackground but there is a race condition where the SetIsBackground method can be called before VREventObserver is created, so background active status changes are not sent correctly in that case.

I also found that VRManager::Shutdown() method is called after the FxR app goes to foreground due to the inactivity timer.

Notify VRActiveStatus after a the VREventObserver is created to prevent the VRManagerParent::GetVRActiveStatus race condition.
Call VRManager::Shutdown() when the app goes to background instead of calling it in the foreground event due to the inactivity timer.

Pushed by igorostizaga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/c7f931c95c78 Fix VRManagerParent::GetVRActiveStatus race condition: Notify VRActiveStatus after a the VREventObserver is created. r=rbarker,daoshengmu
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla71
Status: RESOLVED → REOPENED
Resolution: FIXED → ---

I found a regression due to calling VRManager::Shutdown() when the app goes to background. I'll remove that call for now, the restore problem is fixed with the VREventObserver fix.

Do not call VRManager::Shutdown immediately when the app is paused.

Pushed by igorostizaga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/210a032a7f17 Do not call VRManager::Shutdown immediately when the app is paused. r=daoshengmu,kip
Status: REOPENED → RESOLVED
Closed: 5 years ago5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: