Bug 1534390 - WebVR does not properly re-initialize after the VR service has stopped r=daoshengmu
authorKearwood "Kip" Gilbert <kgilbert@mozilla.com>
Mon, 11 Mar 2019 21:13:39 +0000
changeset 521576 0133ea3cd32177ea1da42beff44793eeb2b04010
parent 521575 109dd3329637173fca52d796d389e4c4f41f99fe
child 521577 0d875c3ec155799e7bf41be3a9b0ee0ca856e333
push id10867
push userdvarga@mozilla.com
push dateThu, 14 Mar 2019 15:20:45 +0000
treeherdermozilla-beta@abad13547875 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu
bugs1534390
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1534390 - WebVR does not properly re-initialize after the VR service has stopped r=daoshengmu WebVR will not initialize correctly (VR process will not be started and the headset data is frozen) for subsequent sessions in a new tab once the VR process has been shut down due to being idle. Differential Revision: https://phabricator.services.mozilla.com/D23027
gfx/vr/VRManager.h
gfx/vr/ipc/VRGPUChild.cpp
--- a/gfx/vr/VRManager.h
+++ b/gfx/vr/VRManager.h
@@ -61,25 +61,26 @@ class VRManager {
                      const VRManagerPromise& aPromise);
   void StopVibrateHaptic(uint32_t aControllerIdx);
   void NotifyVibrateHapticCompleted(const VRManagerPromise& aPromise);
   void DispatchSubmitFrameResult(uint32_t aDisplayID,
                                  const VRSubmitFrameResultInfo& aResult);
   void StartVRNavigation(const uint32_t& aDisplayID);
   void StopVRNavigation(const uint32_t& aDisplayID,
                         const TimeDuration& aTimeout);
-  void Destroy();
+
+  void Shutdown();
 
  protected:
   VRManager();
   ~VRManager();
 
  private:
+  void Destroy();
   void Init();
-  void Shutdown();
   void StartTasks();
   void StopTasks();
   static void TaskTimerCallback(nsITimer* aTimer, void* aClosure);
   void RunTasks();
   void Run1msTasks(double aDeltaTime);
   void Run10msTasks();
   void Run100msTasks();
   uint32_t GetOptimalTaskInterval();
--- a/gfx/vr/ipc/VRGPUChild.cpp
+++ b/gfx/vr/ipc/VRGPUChild.cpp
@@ -48,16 +48,16 @@ void VRGPUChild::Shutdown() {
   if (sVRGPUChildSingleton && !sVRGPUChildSingleton->IsClosed()) {
     sVRGPUChildSingleton->Close();
   }
   sVRGPUChildSingleton = nullptr;
 }
 
 void VRGPUChild::ActorDestroy(ActorDestroyReason aWhy) {
   VRManager* vm = VRManager::Get();
-  vm->Destroy();
+  vm->Shutdown();
   mClosed = true;
 }
 
 bool VRGPUChild::IsClosed() { return mClosed; }
 
 }  // namespace gfx
 }  // namespace mozilla