зеркало из https://github.com/mozilla/gecko-dev.git
Backout 3011b2b7f82f (bug 966384) for unused variable failures. r=backout
CLOSED TREE --HG-- extra : amend_source : dfb81e133bca73ba3c5ad959593c5d3d444f8506
This commit is contained in:
Родитель
1998801252
Коммит
6f465934ec
|
@ -57,11 +57,11 @@ private:
|
|||
nsRefPtr<Promise> mPromise;
|
||||
};
|
||||
|
||||
class WorkerPromiseTask MOZ_FINAL : public WorkerSameThreadRunnable
|
||||
class WorkerPromiseTask MOZ_FINAL : public WorkerRunnable
|
||||
{
|
||||
public:
|
||||
WorkerPromiseTask(WorkerPrivate* aWorkerPrivate, Promise* aPromise)
|
||||
: WorkerSameThreadRunnable(aWorkerPrivate)
|
||||
: WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount)
|
||||
, mPromise(aPromise)
|
||||
{
|
||||
MOZ_ASSERT(aPromise);
|
||||
|
@ -161,7 +161,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class WorkerPromiseResolverTask MOZ_FINAL : public WorkerSameThreadRunnable,
|
||||
class WorkerPromiseResolverTask MOZ_FINAL : public WorkerRunnable,
|
||||
public PromiseResolverMixin
|
||||
{
|
||||
public:
|
||||
|
@ -169,7 +169,7 @@ public:
|
|||
Promise* aPromise,
|
||||
JS::Handle<JS::Value> aValue,
|
||||
Promise::PromiseState aState)
|
||||
: WorkerSameThreadRunnable(aWorkerPrivate),
|
||||
: WorkerRunnable(aWorkerPrivate, WorkerThreadUnchangedBusyCount),
|
||||
PromiseResolverMixin(aPromise, aValue, aState)
|
||||
{}
|
||||
|
||||
|
@ -832,7 +832,7 @@ Promise::AppendCallbacks(PromiseCallback* aResolveCallback,
|
|||
WorkerPrivate* worker = GetCurrentThreadWorkerPrivate();
|
||||
MOZ_ASSERT(worker);
|
||||
nsRefPtr<WorkerPromiseTask> task = new WorkerPromiseTask(worker, this);
|
||||
task->Dispatch(worker->GetJSContext());
|
||||
worker->Dispatch(task);
|
||||
}
|
||||
mTaskPending = true;
|
||||
}
|
||||
|
@ -1045,7 +1045,7 @@ Promise::RunResolveTask(JS::Handle<JS::Value> aValue,
|
|||
MOZ_ASSERT(worker);
|
||||
nsRefPtr<WorkerPromiseResolverTask> task =
|
||||
new WorkerPromiseResolverTask(worker, this, aValue, aState);
|
||||
task->Dispatch(worker->GetJSContext());
|
||||
worker->Dispatch(task);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -478,43 +478,3 @@ MainThreadWorkerControlRunnable::PostDispatch(JSContext* aCx,
|
|||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS_INHERITED0(WorkerControlRunnable, WorkerRunnable)
|
||||
|
||||
bool
|
||||
WorkerSameThreadRunnable::PreDispatch(JSContext* aCx,
|
||||
WorkerPrivate* aWorkerPrivate)
|
||||
{
|
||||
aWorkerPrivate->AssertIsOnWorkerThread();
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
WorkerSameThreadRunnable::PostDispatch(JSContext* aCx,
|
||||
WorkerPrivate* aWorkerPrivate,
|
||||
bool aDispatchResult)
|
||||
{
|
||||
aWorkerPrivate->AssertIsOnWorkerThread();
|
||||
if (aDispatchResult) {
|
||||
bool willIncrement = aWorkerPrivate->ModifyBusyCountFromWorker(aCx, true);
|
||||
// Should never fail since if this thread is still running, so should the
|
||||
// parent and it should be able to process a control runnable.
|
||||
MOZ_ASSERT(willIncrement);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
WorkerSameThreadRunnable::PostRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
||||
bool aRunResult)
|
||||
{
|
||||
MOZ_ASSERT(aCx);
|
||||
MOZ_ASSERT(aWorkerPrivate);
|
||||
|
||||
aWorkerPrivate->AssertIsOnWorkerThread();
|
||||
|
||||
bool willDecrement = aWorkerPrivate->ModifyBusyCountFromWorker(aCx, false);
|
||||
MOZ_ASSERT(willDecrement);
|
||||
|
||||
if (!aRunResult) {
|
||||
JS_ReportPendingException(aCx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -314,34 +314,6 @@ protected:
|
|||
bool aDispatchResult) MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
// A WorkerRunnable that should be dispatched from the worker to itself for
|
||||
// async tasks. This will increment the busy count PostDispatch() (only if
|
||||
// dispatch was successful) and decrement it in PostRun().
|
||||
//
|
||||
// Async tasks will almost always want to use this since
|
||||
// a WorkerSameThreadRunnable keeps the Worker from being GCed.
|
||||
class WorkerSameThreadRunnable : public WorkerRunnable
|
||||
{
|
||||
protected:
|
||||
WorkerSameThreadRunnable(WorkerPrivate* aWorkerPrivate)
|
||||
: WorkerRunnable(aWorkerPrivate, WorkerThreadModifyBusyCount)
|
||||
{ }
|
||||
|
||||
virtual ~WorkerSameThreadRunnable()
|
||||
{ }
|
||||
|
||||
virtual bool
|
||||
PreDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
PostDispatch(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
||||
bool aDispatchResult) MOZ_OVERRIDE;
|
||||
|
||||
virtual void
|
||||
PostRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate,
|
||||
bool aRunResult) MOZ_OVERRIDE;
|
||||
};
|
||||
|
||||
END_WORKERS_NAMESPACE
|
||||
|
||||
#endif // mozilla_dom_workers_workerrunnable_h__
|
||||
|
|
Загрузка…
Ссылка в новой задаче