Bug 1288193 - Ensure that the content process receives the presentation status of a VRDisplay immediately after adding or removing layers r=gw280

- Corrects issues with the onvrdisplaypresentationchange events being delayed by up to 5 seconds.
- Caused a delay to enter or exit WebVR presentation on many sites.

MozReview-Commit-ID: 2LACZNwKIxW

--HG--
extra : rebase_source : ec689cd68422a8487a85e70d9e2dbb13b3a1c36c
This commit is contained in:
kearwood 2016-09-02 14:45:54 -07:00
parent 186cacb131
commit 627c745c53

View File

@ -45,6 +45,10 @@ VRDisplayHost::AddLayer(VRLayerParent *aLayer)
StartPresentation();
}
mDisplayInfo.mIsPresenting = mLayers.Length() > 0;
// Ensure that the content process receives the change immediately
VRManager* vm = VRManager::Get();
vm->RefreshVRDisplays();
}
void
@ -55,6 +59,10 @@ VRDisplayHost::RemoveLayer(VRLayerParent *aLayer)
StopPresentation();
}
mDisplayInfo.mIsPresenting = mLayers.Length() > 0;
// Ensure that the content process receives the change immediately
VRManager* vm = VRManager::Get();
vm->RefreshVRDisplays();
}
#if defined(XP_WIN)