Bug 1342831 - devirtualize AssertIsDead(). draft
authorJW Wang <jwwang@mozilla.com>
Sat, 25 Feb 2017 22:56:49 +0800
changeset 490653 71121dca647bdf5807b26754707ef3b3cf3b1884
parent 490433 1bc2ad020aee2830e0a7941f10958dbec108c254
child 490717 84b702b39991051cf278638fb925f1d0d3f1db07
push id47182
push userjwwang@mozilla.com
push dateWed, 01 Mar 2017 02:59:33 +0000
bugs1342831
milestone54.0a1
Bug 1342831 - devirtualize AssertIsDead(). MozReview-Commit-ID: 9dNDiTfwlLR
xpcom/threads/MozPromise.h
--- a/xpcom/threads/MozPromise.h
+++ b/xpcom/threads/MozPromise.h
@@ -288,17 +288,16 @@ public:
     }
     return holder->Promise();
   }
 
   class Request : public MozPromiseRefcountable
   {
   public:
     virtual void Disconnect() = 0;
-    virtual void AssertIsDead() = 0;
 
   protected:
     Request() : mComplete(false), mDisconnected(false) {}
     virtual ~Request() {}
 
     bool mComplete;
     bool mDisconnected;
   };
@@ -357,17 +356,17 @@ protected:
 #ifdef PROMISE_DEBUG
     ~ThenValueBase()
     {
       mMagic1 = 0;
       mMagic2 = 0;
     }
 #endif
 
-    void AssertIsDead() override
+    void AssertIsDead()
     {
       PROMISE_ASSERT(mMagic1 == sMagic && mMagic2 == sMagic);
       // We want to assert that this ThenValues is dead - that is to say, that
       // there are no consumers waiting for the result. In the case of a normal
       // ThenValue, we check that it has been disconnected, which is the way
       // that the consumer signals that it no longer wishes to hear about the
       // result. If this ThenValue has a completion promise (which is mutually
       // exclusive with being disconnectable), we recursively assert that every