Bug 784404 - backout inital patch. r=bent
authorDoug Turner <dougt@dougt.org>
Tue, 28 Aug 2012 08:38:31 -0700
changeset 105695 14968df0feeee276ff5a8c3c5c2d8578ceba30f2
parent 105694 c447eff920dbb3fd621718833c4774b7ab714b50
child 105696 f50483a61327c694869231a8c43e8bea2c16c1c1
push id55
push usershu@rfrn.org
push dateThu, 30 Aug 2012 01:33:09 +0000
reviewersbent
bugs784404
milestone18.0a1
Bug 784404 - backout inital patch. r=bent
dom/devicestorage/DeviceStorageRequestParent.h
--- a/dom/devicestorage/DeviceStorageRequestParent.h
+++ b/dom/devicestorage/DeviceStorageRequestParent.h
@@ -44,27 +44,21 @@ private:
 
     virtual ~CancelableRunnable() {
     }
 
     NS_IMETHOD Run() {
       nsresult rv = NS_OK;
       if (!mCanceled) {
         rv = CancelableRun();
-
-        nsCOMPtr<nsIRunnable> event = NS_NewRunnableMethod(this, &CancelableRunnable::RemoveRunnable);
-        NS_DispatchToMainThread(event);
+        mParent->RemoveRunnable(this);
       }
       return rv;
     }
 
-    void RemoveRunnable() {
-      mParent->RemoveRunnable(this);
-    }
-
     void Cancel() {
       mCanceled = true;
     }
 
     virtual nsresult CancelableRun() = 0;
 
   protected:
     nsRefPtr<DeviceStorageRequestParent> mParent;
@@ -185,21 +179,19 @@ private:
       virtual ~PostStatResultEvent();
       virtual nsresult CancelableRun();
     private:
       int64_t mFreeBytes, mTotalBytes;
    };
 
 protected:
   void AddRunnable(CancelableRunnable* aRunnable) {
-    NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
     mRunnables.AppendElement(aRunnable);
   }
   void RemoveRunnable(CancelableRunnable* aRunnable) {
-    NS_ASSERTION(NS_IsMainThread(), "Wrong thread!");
     mRunnables.RemoveElement(aRunnable);
   }
   nsTArray<nsRefPtr<CancelableRunnable> > mRunnables;
 };
 
 } // namespace devicestorage
 } // namespace dom
 } // namespace mozilla