Bug 1411838 - Part 2: Fix non thread-safe objects in VR; r=kip
authorDaosheng Mu <daoshengmu@gmail.com>
Thu, 09 Nov 2017 10:54:36 +0800
changeset 444528 c413c58c311dc645e947b38670220e8266cc40af
parent 444527 6dbb8758e13cbd92c2e913c052cbf3e6c7c44540
child 444529 411876ddf28886b67b000d93645ce609c6e02148
push id1618
push userCallek@gmail.com
push dateThu, 11 Jan 2018 17:45:48 +0000
treeherdermozilla-release@882ca853e05a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskip
bugs1411838
milestone58.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 1411838 - Part 2: Fix non thread-safe objects in VR; r=kip MozReview-Commit-ID: EzbNWU17qAP
gfx/vr/VRDisplayHost.h
gfx/vr/gfxVROculus.h
--- a/gfx/vr/VRDisplayHost.h
+++ b/gfx/vr/VRDisplayHost.h
@@ -88,17 +88,17 @@ protected:
 #elif defined(MOZ_ANDROID_GOOGLE_VR)
   virtual bool SubmitFrame(const mozilla::layers::EGLImageDescriptor* aDescriptor,
                            const gfx::Rect& aLeftEyeRect,
                            const gfx::Rect& aRightEyeRect) = 0;
 #endif
 
   VRDisplayInfo mDisplayInfo;
 
-  nsTArray<RefPtr<VRLayerParent>> mLayers;
+  nsTArray<VRLayerParent *> mLayers;
   // Weak reference to mLayers entries are cleared in
   // VRLayerParent destructor
 
 protected:
   virtual VRHMDSensorState GetSensorState() = 0;
 
 private:
   VRDisplayInfo mLastUpdateDisplayInfo;
--- a/gfx/vr/gfxVROculus.h
+++ b/gfx/vr/gfxVROculus.h
@@ -32,17 +32,17 @@ namespace impl {
 enum class OculusControllerAxisType : uint16_t {
   ThumbstickXAxis,
   ThumbstickYAxis,
   NumVRControllerAxisType
 };
 
 class VROculusSession
 {
-  NS_INLINE_DECL_REFCOUNTING(VROculusSession);
+  NS_INLINE_DECL_THREADSAFE_REFCOUNTING(VROculusSession);
   friend class VRDisplayOculus;
 public:
   VROculusSession();
   void Refresh(bool aForceRefresh = false);
   bool IsTrackingReady() const;
   bool IsRenderReady() const;
   ovrSession Get();
   void StartPresentation(const IntSize& aSize);