Bug 1347644 - Make NS_ProxyRelease runnables cancelable (r=bkelly)
authorLuke Wagner <luke@mozilla.com>
Fri, 06 Oct 2017 10:55:24 -0500
changeset 676132 fd99f3454c510f766a19f7c6ea86f6278227b5a0
parent 676131 6c386d38608af90a93907b01eb6b0082e67463b0
child 676133 6c5488ade824e460bfe19d4b347b78cfa8960a79
push id83398
push userbmo:rail@mozilla.com
push dateFri, 06 Oct 2017 17:12:44 +0000
reviewersbkelly
bugs1347644
milestone58.0a1
Bug 1347644 - Make NS_ProxyRelease runnables cancelable (r=bkelly) MozReview-Commit-ID: 238uix57pl6
xpcom/threads/nsProxyRelease.h
--- a/xpcom/threads/nsProxyRelease.h
+++ b/xpcom/threads/nsProxyRelease.h
@@ -22,28 +22,33 @@
 
 #ifdef XPCOM_GLUE_AVOID_NSPR
 #error NS_ProxyRelease implementation depends on NSPR.
 #endif
 
 namespace detail {
 
 template<typename T>
-class ProxyReleaseEvent : public mozilla::Runnable
+class ProxyReleaseEvent : public mozilla::CancelableRunnable
 {
 public:
   ProxyReleaseEvent(const char* aName, already_AddRefed<T> aDoomed)
-  : Runnable(aName), mDoomed(aDoomed.take()) {}
+  : CancelableRunnable(aName), mDoomed(aDoomed.take()) {}
 
   NS_IMETHOD Run() override
   {
     NS_IF_RELEASE(mDoomed);
     return NS_OK;
   }
 
+  nsresult Cancel() override
+  {
+    return Run();
+  }
+
   NS_IMETHOD GetName(nsACString& aName) override
   {
 #ifdef RELEASE_OR_BETA
     aName.Truncate();
 #else
     if (mName) {
       aName.Append(nsPrintfCString("ProxyReleaseEvent for %s", mName));
     } else {