mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1008338 - Add WorkerScriptExecutedSuccessfully(). r=bent
This commit is contained in:
parent
46913d3906
commit
b2949dbebd
@ -879,7 +879,11 @@ private:
|
||||
}
|
||||
|
||||
JSAutoCompartment ac(aCx, global);
|
||||
return scriptloader::LoadWorkerScript(aCx);
|
||||
bool result = scriptloader::LoadWorkerScript(aCx);
|
||||
if (result) {
|
||||
aWorkerPrivate->SetWorkerScriptExecutedSuccessfully();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
@ -3558,7 +3562,8 @@ WorkerPrivate::WorkerPrivate(JSContext* aCx,
|
||||
mRunningExpiredTimeouts(false), mCloseHandlerStarted(false),
|
||||
mCloseHandlerFinished(false), mMemoryReporterRunning(false),
|
||||
mBlockedForMemoryReporter(false), mCancelAllPendingRunnables(false),
|
||||
mPeriodicGCTimerRunning(false), mIdleGCTimerRunning(false)
|
||||
mPeriodicGCTimerRunning(false), mIdleGCTimerRunning(false),
|
||||
mWorkerScriptExecutedSuccessfully(false)
|
||||
#ifdef DEBUG
|
||||
, mPRThread(nullptr)
|
||||
#endif
|
||||
|
@ -785,6 +785,7 @@ class WorkerPrivate : public WorkerPrivateParent<WorkerPrivate>
|
||||
bool mCancelAllPendingRunnables;
|
||||
bool mPeriodicGCTimerRunning;
|
||||
bool mIdleGCTimerRunning;
|
||||
bool mWorkerScriptExecutedSuccessfully;
|
||||
|
||||
#ifdef DEBUG
|
||||
PRThread* mPRThread;
|
||||
@ -1068,6 +1069,23 @@ public:
|
||||
{ }
|
||||
#endif
|
||||
|
||||
void
|
||||
SetWorkerScriptExecutedSuccessfully()
|
||||
{
|
||||
AssertIsOnWorkerThread();
|
||||
// Should only be called once!
|
||||
MOZ_ASSERT(!mWorkerScriptExecutedSuccessfully);
|
||||
mWorkerScriptExecutedSuccessfully = true;
|
||||
}
|
||||
|
||||
// Only valid after CompileScriptRunnable has finished running!
|
||||
bool
|
||||
WorkerScriptExecutedSuccessfully() const
|
||||
{
|
||||
AssertIsOnWorkerThread();
|
||||
return mWorkerScriptExecutedSuccessfully;
|
||||
}
|
||||
|
||||
private:
|
||||
WorkerPrivate(JSContext* aCx, WorkerPrivate* aParent,
|
||||
const nsAString& aScriptURL, bool aIsChromeWorker,
|
||||
|
Loading…
Reference in New Issue
Block a user