Bug 1325810 - Reduce unneeded IPC when WebVR is not active draft
authorKearwood Gilbert <kgilbert@mozilla.com>
Fri, 06 Jan 2017 16:28:45 -0800
changeset 457203 e16e0ee091f9a5f64c5b9c94dbc0800b7a338e4f
parent 457090 0d823cf54df53e0cea75a74adebace956bd333d8
child 541419 0380e4de3595a4d16d6a557b4d1669f049f2513b
push id40707
push userbmo:kgilbert@mozilla.com
push dateSat, 07 Jan 2017 00:40:38 +0000
bugs1325810
milestone53.0a1
Bug 1325810 - Reduce unneeded IPC when WebVR is not active 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();
   }