Bug 1325810 - Reduce unneeded IPC when WebVR is not active. r=daoshengmu, a=jcristau
authorKearwood Gilbert <kgilbert@mozilla.com>
Fri, 06 Jan 2017 16:28:45 -0800
changeset 353525 bc41a634b3895fe95519e6951ac9b63f2cf1f6fa
parent 353524 c1748b934c3714bd81a4b7622d650b2682fcdf13
child 353526 ce6b5197e49f006bb3d2530b0932358bbe5cb138
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdaoshengmu, jcristau
bugs1325810
milestone52.0a2
Bug 1325810 - Reduce unneeded IPC when WebVR is not active. r=daoshengmu, a=jcristau MozReview-Commit-ID: DBCtiC2zzHf
gfx/vr/VRManager.cpp
--- a/gfx/vr/VRManager.cpp
+++ b/gfx/vr/VRManager.cpp
@@ -165,17 +165,19 @@ void
 VRManager::NotifyVsync(const TimeStamp& aVsyncTimestamp)
 {
   const double kVRDisplayRefreshMaxDuration = 5000; // milliseconds
 
   bool bHaveEventListener = false;
 
   for (auto iter = mVRManagerParents.Iter(); !iter.Done(); iter.Next()) {
     VRManagerParent *vmp = iter.Get()->GetKey();
-    Unused << vmp->SendNotifyVSync();
+    if (mVRDisplays.Count()) {
+      Unused << vmp->SendNotifyVSync();
+    }
     bHaveEventListener |= vmp->HaveEventListener();
   }
 
   for (auto iter = mVRDisplays.Iter(); !iter.Done(); iter.Next()) {
     gfx::VRDisplayHost* display = iter.UserData();
     display->NotifyVSync();
   }