Bug 1877921 - Own WorkerRef during DebugWorkerRefs r=dom-worker-reviewers,asuth

The Proxy is released on the Worker thread when an iframe with a Worker is destroyed.  This removes the ThreadSafeWorkerRef from the XMLHttpRequestMainThread.  Then the main thread destroys the docshell, calling XMLHttpRequestMainThread::Abort, which relies on the Worker still being alive.

Differential Revision: https://phabricator.services.mozilla.com/D202454
This commit is contained in:
Joshua Marshall 2024-02-27 15:53:15 +00:00
parent 30fa2f4d8d
commit 5757c0bc75

View file

@ -185,7 +185,7 @@ static void AddLoadFlags(nsIRequest* request, nsLoadFlags newFlags) {
// invoked for increased scrutability. Save the previous value on the stack.
namespace {
struct DebugWorkerRefs {
RefPtr<ThreadSafeWorkerRef>& mTSWorkerRef;
RefPtr<ThreadSafeWorkerRef> mTSWorkerRef;
nsCString mPrev;
DebugWorkerRefs(RefPtr<ThreadSafeWorkerRef>& aTSWorkerRef,