Bug 1268303 - Better WorkerFeature management in Console API, r=smaug, a=al
authorAndrea Marchesini <amarchesini@mozilla.com>
Sat, 07 May 2016 07:49:15 +0200
changeset 332809 fb681e961325a5fd7d98c903f16dc024e17e49b5
parent 332808 d1e8949f9e790141748fe1ceba2a76bc6b9fb72d
child 332810 00a32da7e4d6e85fdcf3618fb757d7cd8df4eefb
push id6048
push userkmoir@mozilla.com
push dateMon, 06 Jun 2016 19:02:08 +0000
treeherdermozilla-beta@46d72a56c57d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, al
bugs1268303
milestone48.0a2
Bug 1268303 - Better WorkerFeature management in Console API, r=smaug, a=al
dom/base/Console.cpp
--- a/dom/base/Console.cpp
+++ b/dom/base/Console.cpp
@@ -407,28 +407,28 @@ private:
         MOZ_ASSERT(aRunnable);
       }
 
       // If something goes wrong, we still need to release the ConsoleCallData
       // object. For this reason we have a custom Cancel method.
       nsresult
       Cancel() override
       {
-        mRunnable->ReleaseData();
-        mRunnable->mConsole = nullptr;
+        WorkerRun(nullptr, mWorkerPrivate);
         return NS_OK;
       }
 
       virtual bool
       WorkerRun(JSContext* aCx, workers::WorkerPrivate* aWorkerPrivate) override
       {
         MOZ_ASSERT(aWorkerPrivate);
         aWorkerPrivate->AssertIsOnWorkerThread();
 
-        Cancel();
+        mRunnable->ReleaseData();
+        mRunnable->mConsole = nullptr;
 
         aWorkerPrivate->RemoveFeature(mRunnable);
         return true;
       }
 
     private:
       ~ConsoleReleaseRunnable()
       {}