Closed Bug 1809044 Opened 3 years ago Closed 3 years ago

Implement WorkerEventTarget::RegisterShutdownTask and WorkerEventTarget::UnregisterShutdownTask

Categories

(Core :: DOM: Workers, task, P2)

task

Tracking

()

RESOLVED FIXED
110 Branch
Tracking Status
firefox110 --- fixed

People

(Reporter: janv, Assigned: janv)

References

Details

Attachments

(1 file)

We need to create a new top level protocol for sync access handles which will bind the child side to WorkerPrivate::ControlEventTarget. The binding currently fails because WorkerEventTarget::RegisterShutdownTask and WorkerEventTarget::UnregisterShutdownTask are not implemented.

If we're going to be using the ControlEventTarget for IPC stuff we should probably make sure to poison[1] the worker global via nsIGlobalObject::StartForbiddingScript/StopForbiddingScript via WorkerGlobalScopeBase::WorkerPrivateSaysForbidScript/WorkerPrivateSaysAllowScript while we're processing control runnables to avoid situations where code might erroneously/accidentally try and call into content from a control runnable.

1: Well, it's not entirely poisoning because we won't crash or anything, but it will make sure we don't call into content. (We will ThrowNotSupportedError though, but only the thing trying to call into content will see that, and frequently those don't do much with it.)

This is now used in D166344. See the FileSystemSyncAccessHandle::BeginClose method, mControlActor is bound to WorkerPrivate::ControlEventTarget and it's just used for sending the close message to the parent and waiting for a response.

(In reply to Andrew Sutherland [:asuth] (he/him) from comment #1)

If we're going to be using the ControlEventTarget for IPC stuff we should probably make sure to poison[1] the worker global via nsIGlobalObject::StartForbiddingScript/StopForbiddingScript

I added something like that in https://phabricator.services.mozilla.com/D166344?vs=666165&id=666226#toc

Blocks: 1809064
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9bb0f824a2d8 Implement WorkerEventTarget::RegisterShutdownTask and WorkerEventTarget::UnregisterShutdownTask; r=dom-worker-reviewers,asuth
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 110 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: