Files
tubestation/dom/serviceworkers
Eden Chuang 6dbb975108 Bug 1968427 - Adding a null checking on WorkerPrivate::GlobalScope() in ServiceWorkerOpRunnable. a=diannaS
WorkerPrivate's GlobalScope is created during CompileScriptRunnable::WorkerRun.
However, the creation could fail when there is an OOM issue during the WebIDL bindings.
Although the Worker will start the shutdown as soon as possible, there is still a chance that some WorkerRunnable had already been dispatched to the Worker. And there is no guarantee that there is a GlobalScope for the WorkerRunnable.
Unfortunately, WorkerRunnable should check the GlobalScope existence by itself, because not every WorkerRunnable needs the GlobalScope to perform its functionality.

This patch only does the null checking for the ServiceWorkerOpRunnable, since ServiceWorkerOpRunnable are supposed to dispatching an event to the corresponding ServiceWorkerGlobalScope.

Original Revision: https://phabricator.services.mozilla.com/D254659

Differential Revision: https://phabricator.services.mozilla.com/D258725
2025-07-25 19:04:42 +00:00
..