From 6b83dd0bdda3b07215d84be6bdfc5ca99b0c1038 Mon Sep 17 00:00:00 2001 From: Perry Jiang Date: Tue, 18 Feb 2020 16:35:27 +0000 Subject: [PATCH] Bug 1610585 - MessagePortIdentifierRunnable ensure balanced busy count modifications r=dom-workers-and-storage-reviewers,asuth If the MessagePortIdentifierRunnable's WorkerRunnable::Run is called when the WorkerPrivate is doing ClearMainEventQueue, WorkerRunnable::Run will decrement the busy count. It should have already been incremented by a (successful) WorkerRunnable::PreDispatch though, but MessagePortIdentifierRunnable's PreDispatch doesn't do anything, so in this case the busy count modifications are not balanced. It seemed like MessagePortIdentifierRunnable tried to avoid modifying the busy count at all, but it doesn't work in the case described above. So, the patch just makes MessagePortIdentifierRunnable do the normal busy count modifications. (I also don't see any "bad assertions" referenced by the empty {Pre,Post}{Dispatch,Run} methods.) Differential Revision: https://phabricator.services.mozilla.com/D62951 --HG-- extra : moz-landing-system : lando --- .../remoteworkers/RemoteWorkerChild.cpp | 24 +------------------ dom/workers/test/mochitest.ini | 1 - 2 files changed, 1 insertion(+), 24 deletions(-) diff --git a/dom/workers/remoteworkers/RemoteWorkerChild.cpp b/dom/workers/remoteworkers/RemoteWorkerChild.cpp index d96361a59fc2..dad513c2c923 100644 --- a/dom/workers/remoteworkers/RemoteWorkerChild.cpp +++ b/dom/workers/remoteworkers/RemoteWorkerChild.cpp @@ -144,33 +144,11 @@ class MessagePortIdentifierRunnable final : public WorkerRunnable { mPortIdentifier(aPortIdentifier) {} private: - virtual bool WorkerRun(JSContext* aCx, - WorkerPrivate* aWorkerPrivate) override { + bool WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override { mActor->AddPortIdentifier(aCx, aWorkerPrivate, mPortIdentifier); return true; } - virtual bool PreDispatch(WorkerPrivate* aWorkerPrivate) override { - // Silence bad assertions. - return true; - } - - virtual void PostDispatch(WorkerPrivate* aWorkerPrivate, - bool aDispatchResult) override { - // Silence bad assertions. - } - - bool PreRun(WorkerPrivate* aWorkerPrivate) override { - // Silence bad assertions. - return true; - } - - void PostRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate, - bool aRunResult) override { - // Silence bad assertions. - return; - } - SelfHolder mActor; UniqueMessagePortId mPortIdentifier; }; diff --git a/dom/workers/test/mochitest.ini b/dom/workers/test/mochitest.ini index 3cfdebb0bd6c..17e6601e9cce 100644 --- a/dom/workers/test/mochitest.ini +++ b/dom/workers/test/mochitest.ini @@ -108,7 +108,6 @@ support-files = [test_blobConstructor.html] [test_blobWorkers.html] [test_bug949946.html] -skip-if = debug && ((android_version == '24') || (os == "linux" && bits == 64) || (os == "win" && bits == 32) || (os == "mac")) #crashes Bug 1564700 [test_bug978260.html] [test_bug998474.html] [test_bug1002702.html]