Bug 1364856 - When VRLayerChild receives __delete__, stop sending IPC messages; r?kip draft
authorDaosheng Mu <daoshengmu@gmail.com>
Mon, 15 May 2017 18:55:42 +0800
changeset 577783 e3cfd1ed88fb04c9ff19a46acd6c7378ef42a07a
parent 577554 e66dedabe582ba7b394aee4f89ed70fe389b3c46
child 628587 1235a52185ff9a9dba514603b61acbcefac316d7
push id58785
push userbmo:dmu@mozilla.com
push dateMon, 15 May 2017 10:58:32 +0000
reviewerskip
bugs1364856
milestone55.0a1
Bug 1364856 - When VRLayerChild receives __delete__, stop sending IPC messages; r?kip MozReview-Commit-ID: 2vKdzipaga0
gfx/vr/ipc/VRLayerChild.cpp
gfx/vr/ipc/VRLayerChild.h
--- a/gfx/vr/ipc/VRLayerChild.cpp
+++ b/gfx/vr/ipc/VRLayerChild.cpp
@@ -83,16 +83,17 @@ VRLayerChild::IsIPCOpen()
 
 void
 VRLayerChild::ClearSurfaces()
 {
   mFront = nullptr;
   mShSurfClient = nullptr;
 }
 
-void
-VRLayerChild::ActorDestroy(ActorDestroyReason aWhy)
+mozilla::ipc::IPCResult
+VRLayerChild::Recv__delete__()
 {
   mIPCOpen = false;
+  return IPC_OK();
 }
 
 } // namespace gfx
 } // namespace mozilla
--- a/gfx/vr/ipc/VRLayerChild.h
+++ b/gfx/vr/ipc/VRLayerChild.h
@@ -35,17 +35,17 @@ public:
   VRLayerChild(uint32_t aVRDisplayID, VRManagerChild* aVRManagerChild);
   void Initialize(dom::HTMLCanvasElement* aCanvasElement);
   void SubmitFrame();
   bool IsIPCOpen();
 
 protected:
   virtual ~VRLayerChild();
   void ClearSurfaces();
-  virtual void ActorDestroy(ActorDestroyReason aWhy) override;
+  virtual mozilla::ipc::IPCResult Recv__delete__() override;
 
   uint32_t mVRDisplayID;
 
   RefPtr<dom::HTMLCanvasElement> mCanvasElement;
   RefPtr<layers::SharedSurfaceTextureClient> mShSurfClient;
   RefPtr<layers::TextureClient> mFront;
   bool mIPCOpen;
 };