Bug 1316529. Part 1 - Remove TaskQueue::mIsFlushing.
MozReview-Commit-ID: 3x4OO7B2htB
--- a/xpcom/threads/TaskQueue.cpp
+++ b/xpcom/threads/TaskQueue.cpp
@@ -65,17 +65,16 @@ NS_IMPL_ISUPPORTS(TaskQueue::EventTarget
TaskQueue::TaskQueue(already_AddRefed<nsIEventTarget> aTarget,
bool aRequireTailDispatch)
: AbstractThread(aRequireTailDispatch)
, mTarget(aTarget)
, mQueueMonitor("TaskQueue::Queue")
, mTailDispatcher(nullptr)
, mIsRunning(false)
, mIsShutdown(false)
- , mIsFlushing(false)
{
MOZ_COUNT_CTOR(TaskQueue);
}
TaskQueue::~TaskQueue()
{
MonitorAutoLock mon(mQueueMonitor);
MOZ_ASSERT(mIsShutdown);
@@ -99,19 +98,16 @@ TaskQueue::DispatchLocked(nsCOMPtr<nsIRu
{
AbstractThread* currentThread;
if (aReason != TailDispatch && (currentThread = GetCurrent()) && RequiresTailDispatch(currentThread)) {
currentThread->TailDispatcher().AddTask(this, aRunnable.forget(), aFailureHandling);
return NS_OK;
}
mQueueMonitor.AssertCurrentThreadOwns();
- if (mIsFlushing && aMode == AbortIfFlushing) {
- return NS_ERROR_ABORT;
- }
if (mIsShutdown) {
return NS_ERROR_FAILURE;
}
mTasks.push(aRunnable.forget());
if (mIsRunning) {
return NS_OK;
}
RefPtr<nsIRunnable> runner(new Runner(this));
--- a/xpcom/threads/TaskQueue.h
+++ b/xpcom/threads/TaskQueue.h
@@ -184,19 +184,16 @@ protected:
// True if we've dispatched an event to the target to execute events from
// the queue.
bool mIsRunning;
// True if we've started our shutdown process.
bool mIsShutdown;
MozPromiseHolder<ShutdownPromise> mShutdownPromise;
- // True if we're flushing; we reject new tasks if we're flushing.
- bool mIsFlushing;
-
class Runner : public Runnable {
public:
explicit Runner(TaskQueue* aQueue)
: mQueue(aQueue)
{
}
NS_IMETHOD Run() override;
private: