Remove PCompositable::DestroySync. (bug 1301780 part 2, r=nical)
authorDavid Anderson <danderson@mozilla.com>
Thu, 15 Sep 2016 23:57:32 -0700
changeset 357739 6d372e532876e0a5a5f9ad4171b3ac936ea2a806
parent 357738 a8564fa3a0f3f400d024d6ecfdf59992afdc97dc
child 357740 0079d29d4ce323d812817b4a607eb91f63f680ea
push id1324
push usermtabara@mozilla.com
push dateMon, 16 Jan 2017 13:07:44 +0000
treeherdermozilla-release@a01c49833940 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1301780
milestone51.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
Remove PCompositable::DestroySync. (bug 1301780 part 2, r=nical)
gfx/layers/IPDLActor.h
gfx/layers/composite/TextureHost.cpp
gfx/layers/ipc/PCompositable.ipdl
--- a/gfx/layers/IPDLActor.h
+++ b/gfx/layers/IPDLActor.h
@@ -110,37 +110,29 @@ public:
 
   bool CanSend() const { return !mDestroyed; }
 
   // Override this rather than ActorDestroy
   virtual void Destroy() {}
 
   virtual bool RecvDestroy() override
   {
-    if (!mDestroyed) {
-      Destroy();
-      mDestroyed = true;
-    }
+    DestroyIfNeeded();
     Unused << Protocol::Send__delete__(this);
     return true;
   }
 
-  virtual bool RecvDestroySync() override
-  {
-    if (!mDestroyed) {
-      Destroy();
-      mDestroyed = true;
-    }
-    return true;
-  }
-
   typedef ipc::IProtocolManager<ipc::IProtocol>::ActorDestroyReason Why;
 
-  virtual void ActorDestroy(Why) override
-  {
+  virtual void ActorDestroy(Why) override {
+    DestroyIfNeeded();
+  }
+
+protected:
+  void DestroyIfNeeded() {
     if (!mDestroyed) {
       Destroy();
       mDestroyed = true;
     }
   }
 
 private:
   bool mDestroyed;
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -80,16 +80,21 @@ public:
   virtual bool RecvRecycleTexture(const TextureFlags& aTextureFlags) override;
 
   TextureHost* GetTextureHost() { return mTextureHost; }
 
   virtual void Destroy() override;
 
   uint64_t GetSerial() const { return mSerial; }
 
+  virtual bool RecvDestroySync() override {
+    DestroyIfNeeded();
+    return true;
+  }
+
   HostIPCAllocator* mSurfaceAllocator;
   RefPtr<TextureHost> mTextureHost;
   // mSerial is unique in TextureClient's process.
   const uint64_t mSerial;
 };
 
 ////////////////////////////////////////////////////////////////////////////////
 PTextureParent*
--- a/gfx/layers/ipc/PCompositable.ipdl
+++ b/gfx/layers/ipc/PCompositable.ipdl
@@ -17,17 +17,12 @@ async protocol PCompositable
     manager PImageBridge or PLayerTransaction;
 child:
     async __delete__();
 parent:
     /**
      * Asynchronously tell the compositor side to remove the texture.
      */
     async Destroy();
-
-    /**
-     * Never used (needed for ParentActor).
-     */
-    async DestroySync();
 };
 
 } // namespace
 } // namespace