Bug 1259338 P1 Ensure that AllowWindowInteractionHandler is released on worker thread. r=khuey

This commit is contained in:
Ben Kelly 2016-04-08 13:12:52 -07:00
parent f9af648597
commit 13d4638d6c

View File

@ -845,6 +845,15 @@ private:
bool
WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate) override;
NS_IMETHOD
Cancel() override
{
// Always ensure the handler is released on the worker thread, even if we
// are cancelled.
mHandler = nullptr;
return WorkerRunnable::Cancel();
}
RefPtr<AllowWindowInteractionHandler> mHandler;
};
@ -955,6 +964,7 @@ bool
ClearWindowAllowedRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
{
mHandler->ClearWindowAllowed(aWorkerPrivate);
mHandler = nullptr;
return true;
}