зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1587366 - Fix VRManagerParent::GetVRActiveStatus race condition: Notify VRActiveStatus after a the VREventObserver is created. r=rbarker,daoshengmu
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. Differential Revision: https://phabricator.services.mozilla.com/D48678 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
8e222cab72
Коммит
2d92d3cf9a
|
@ -4070,6 +4070,10 @@ void nsGlobalWindowInner::DisableGamepadUpdates() {
|
|||
void nsGlobalWindowInner::EnableVRUpdates() {
|
||||
if (mHasVREvents && !mVREventObserver) {
|
||||
mVREventObserver = new VREventObserver(this);
|
||||
nsPIDOMWindowOuter* outer = GetOuterWindow();
|
||||
if (outer && !outer->IsBackground()) {
|
||||
mVREventObserver->StartActivity();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -305,8 +305,9 @@ void VRManager::TaskTimerCallback(nsITimer* aTimer, void* aClosure) {
|
|||
|
||||
if (self->mAppPaused) {
|
||||
// When the apps goes the background (e.g. Android) we should stop the
|
||||
// tasks.
|
||||
// tasks and shutdown.
|
||||
self->StopTasks();
|
||||
self->Shutdown();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче