mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1293690 P1 Allow WorkerHolder::HoldWorker() callers to specify the status value they consider to be a failure. r=baku
This commit is contained in:
parent
32e17247b7
commit
3b1186e9b0
@ -22,13 +22,13 @@ WorkerHolder::~WorkerHolder()
|
||||
}
|
||||
|
||||
bool
|
||||
WorkerHolder::HoldWorker(WorkerPrivate* aWorkerPrivate)
|
||||
WorkerHolder::HoldWorker(WorkerPrivate* aWorkerPrivate, Status aFailStatus)
|
||||
{
|
||||
NS_ASSERT_OWNINGTHREAD(WorkerHolder);
|
||||
MOZ_ASSERT(aWorkerPrivate);
|
||||
aWorkerPrivate->AssertIsOnWorkerThread();
|
||||
|
||||
if (!aWorkerPrivate->AddHolder(this)) {
|
||||
if (!aWorkerPrivate->AddHolder(this, aFailStatus)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,8 @@ public:
|
||||
WorkerHolder();
|
||||
virtual ~WorkerHolder();
|
||||
|
||||
bool HoldWorker(WorkerPrivate* aWorkerPrivate);
|
||||
bool HoldWorker(WorkerPrivate* aWorkerPrivate,
|
||||
Status aFailStatus = Canceling);
|
||||
void ReleaseWorker();
|
||||
|
||||
virtual bool Notify(Status aStatus) = 0;
|
||||
|
@ -5260,14 +5260,14 @@ WorkerPrivate::RemoveChildWorker(ParentType* aChildWorker)
|
||||
}
|
||||
|
||||
bool
|
||||
WorkerPrivate::AddHolder(WorkerHolder* aHolder)
|
||||
WorkerPrivate::AddHolder(WorkerHolder* aHolder, Status aFailStatus)
|
||||
{
|
||||
AssertIsOnWorkerThread();
|
||||
|
||||
{
|
||||
MutexAutoLock lock(mMutex);
|
||||
|
||||
if (mStatus >= Canceling) {
|
||||
if (mStatus >= aFailStatus) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -1449,7 +1449,7 @@ private:
|
||||
ShutdownGCTimers();
|
||||
|
||||
bool
|
||||
AddHolder(WorkerHolder* aHolder);
|
||||
AddHolder(WorkerHolder* aHolder, Status aFailStatus);
|
||||
|
||||
void
|
||||
RemoveHolder(WorkerHolder* aHolder);
|
||||
|
Loading…
Reference in New Issue
Block a user