gecko-dev/dom
Eden Chuang b68bc791d0 Bug 1892644 - Handling WorkerThreadRunnable::Run() after Worker is "Dead". r=asuth
In bug 1769913, we remove the WorkerThreadRunnable's raw pointer to the corresponding WorkerPrivate and expect the corresponding WorkerPrivate to be obtained by GetCurrentThreadWorkerPrivate() when WorkerThreadRunnable::Run executing.

In general, the assumption is correct. However, it could be violated in the following two situations.

1. WorkerJSContext initialization fails.
2. WorkerThreadRunnable dispatching after CycleCollector shutdown.
In both cases, there is no corresponding WorkerJSContext to get its mWorkerPrivate by GetCurrentThreadWorkerPrivate(), which causes WorkerThreadRunnable to have no WorkerPrivate for executing.

For case 1, the WorkerThreadRunnables are all from WorkerPrivate::mPreStartRunnables. These runnables need a WorkerPrivate to execute WorkerRun(). To cleanup the resources through WorkerRun() if Worker initialization fails or shutdown before DoRunLoop() starts, WorkerThreadRunnable saves a CheckedUnsafePtr<WorkerPrivate> when the runnable is dispacthed to WorkerPrivate::mPreStartRunnables.

For case 2, the solution could be much easier since the WorkerThreadRunnable is not really a WorkerThreadRunnable. Because the Worker is in the "Dead" state, the WorkerThreadRunnable could not be dispatched normally, which means by WorkerThreadRunnable::Dispatch(WorkerPrivate). So it must be from NS_DispatchToCurrentThread(), WorkerThread::Dispatch(), or other ways which treat WorkerThread as nsIThread/nsISerialEventTarget, where the runnable is wrapped as a WorkerThreadRunnable and call nsThread::Dispatch() directly. In this case, the runnable does not need to be WorkerThreadRunnable, so we should be able to call the runnable's Run() directly.

Differential Revision: https://phabricator.services.mozilla.com/D208259
2024-05-02 06:37:51 +00:00
..
abort
animation Bug 1888748 - Ensure animations started on the same tick share ready time. r=birtles 2024-04-17 06:07:17 +00:00
audiochannel Bug 1881863 - Part 1: Standardize on boolean over bool in xpidl, r=xpcom-reviewers,necko-reviewers,valentin,extension-reviewers,application-update-reviewers,media-playback-reviewers,credential-management-reviewers,search-reviewers,anti-tracking-reviewers,places-reviewers,nalexander,emilio,zombie,sgalich,karlt,lina,Standard8 2024-04-04 18:45:21 +00:00
base Backed out changeset 2218b1b338de (bug 1554751) for causing mochitest failures in test_bug418986-1.html CLOSED TREE 2024-04-29 14:06:32 -04:00
battery
bindings Bug 1893219 - have ContinueConsumeBody throw a TypeError on partial content rather than an AbortError; r=extension-reviewers,robwu 2024-04-29 15:27:51 +00:00
broadcastchannel Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth 2024-04-19 09:41:58 +00:00
cache Bug 1799717: Adding some diagnostics to debug intermittent marionette test.r=jstutte 2024-04-30 14:04:25 +00:00
canvas Bug 1864255. Remove skip wayland annotations for various crashtests that no longer need it. r=gfx-reviewers,dholbert,nical 2024-04-28 10:02:10 +00:00
chrome-webidl Bug 1893194 - Rename UniFFIScaffoldingType, r=markh 2024-04-25 16:11:28 +00:00
clients
commandhandler
console Bug 1891789 - Allow console.createInstance to work properly in workers. r=peterv 2024-04-24 10:24:29 +00:00
credentialmanagement Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen 2024-04-04 11:49:57 +00:00
crypto Bug 1894306 - WebCrypto web platform tests failure due to wrong return value r=jschanck 2024-05-01 16:31:33 +00:00
debugger
docs Backed out changeset e11258e505c1 (bug 1874689) for causing bc failures in browser_test_powerMetrics.js CLOSED TREE 2024-04-29 14:51:51 -04:00
encoding
events Backed out changeset ebcc80d71094 (bug 1891259) for breaking a handful of things on slack. CLOSED TREE 2024-04-26 00:27:57 +03:00
fetch Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio 2024-04-24 17:02:49 +00:00
file Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth 2024-04-19 09:41:58 +00:00
filesystem
flex
fs Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio 2024-04-24 17:02:49 +00:00
gamepad
geolocation
grid
html Bug 1893532 - Improve error message of HTMLInputElement.stepUp/stepDown. r=dom-core,sefeng 2024-05-01 00:11:33 +00:00
imptests
indexedDB Bug 1878148 - fix the WPT IndexedDB/serialize-sharedarraybuffer-throws.https.html to trigger a data clone error per spec, and send the correct DataCloneError it expects; r=jari,dom-storage-reviewers,janv 2024-04-30 16:15:12 +00:00
interfaces Bug 1892348 - Remove nsIDOMWindowUtils.numberOfAssignedPaintedLayers() r=tnikkel 2024-04-29 12:18:41 +00:00
ipc Bug 1892976 - Propagate the error returned by nsIClipboard::GetData() over IPC; r=nika 2024-05-01 20:49:09 +00:00
jsurl
l10n Bug 1889417 - On errors, reject the document.l10n.ready promise in tests. r=Gijs 2024-04-16 21:04:38 +00:00
locales Bug 1890277: part 4) Add CSPParser support for the trusted-types directive, guarded behind the Trusted Types pref. r=tschuster,webidl,smaug 2024-04-26 07:38:21 +00:00
localstorage Bug 1883629 - Update Snappy to version 1.2.0. r=dom-storage-reviewers,janv 2024-04-08 13:48:06 +00:00
locks
manifest Bug 1871109 - generateHash in Manifest.sys.mjs should use sha256 r=peterv 2024-04-18 21:49:18 +00:00
mathml
media Bug 1207753 - Fix mutex annotation in audio code r=padenot 2024-05-01 21:32:56 +00:00
messagechannel
midi Bug 1889227 - Remove redundant import from midir_impl. r=gsvelto 2024-04-03 06:48:11 +00:00
network Bug 1892481 - More consistently enforce noscript and builtinclass in xpidl, r=xpcom-reviewers,necko-reviewers,valentin,media-playback-reviewers,mccr8,padenot 2024-04-22 18:19:58 +00:00
notification Bug 1879112 - Check permission earlier and mark as closed if failed r=asuth 2024-04-22 16:59:56 +00:00
origin-trials
payments Bug 1889669 - add mozinfo to reftest sandbox. r=ahal 2024-04-11 16:29:15 +00:00
performance Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth 2024-04-19 09:41:58 +00:00
permission
plugins/test
power Bug 1882344 - Have Document instead of WakeLockJS release locks on loss of activity. r=edgar,dom-core 2024-03-26 17:21:17 +00:00
promise Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio 2024-04-24 17:02:49 +00:00
prototype
push Bug 1264508 - Use generic helpers for converting ArrayBuffer or BufferSource to/from nsTArray in Push API code. r=webidl,saschanaz 2024-04-27 12:57:32 +00:00
quota Bug 1891541 - [2/2] enforce that MozPromise only accepts static strings r=xpcom-reviewers,media-playback-reviewers,padenot,emilio 2024-04-24 17:02:49 +00:00
reporting Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen 2024-04-04 11:49:57 +00:00
res
script Bug 1877703 - Part 3: Also remove currently fetching preload modules from the module map when import map is registered r=smaug 2024-03-19 10:07:35 +00:00
security Bug 1891185 - Collect different downgrade time on timer for HTTPS-First telemetry r=freddyb 2024-04-29 13:52:15 +00:00
serializers Bug 1867058 - Part 10: [Quirk] Disallow SerializeRangeToString to cross the shadow boundary r=smaug 2024-03-25 13:40:59 +00:00
serviceworkers Bug 1264508 - Use generic helpers for converting ArrayBuffer or BufferSource to/from nsTArray in Push API code. r=webidl,saschanaz 2024-04-27 12:57:32 +00:00
simpledb
smil Bug 1891005 - Make PreTraverse functions void since we don't use their return value r=emilio 2024-04-13 20:34:00 +00:00
storage Bug 1877649 - Remove unused storage access flag eSessionScoped. r=pbz,dom-storage-reviewers,janv,webidl,saschanaz 2024-03-21 10:18:49 +00:00
streams Bug 1875481 - Part 1: move MOZ_CAN_RUN_SCRIPT_BOUNDARY_LAMBDA into a shared header r=handyman 2024-04-10 00:15:46 +00:00
svg Bug 1874052 Part 2 - cache whether we pass or fail conditional processing tests r=jfkthame 2024-04-16 17:15:00 +00:00
system
tests Bug 1887845 - Enabled dom.events.asyncClipboard.clipboardItem by default; r=nika 2024-04-30 11:49:29 +00:00
url Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen 2024-04-04 11:49:57 +00:00
vr
webauthn Bug 1878742 - only show hybrid transport option on macOS if it might be used. r=dveditz 2024-04-22 18:54:53 +00:00
webbrowserpersist
webgpu Bug 1893188: Make ComputePipeline::Cleanup gracefully handle a missing bridge. r=webgpu-reviewers,ErichDonGubler 2024-04-29 16:07:57 +00:00
webidl Bug 1893116 - Remove abuse report method/prop from AddonManager IDL. r=smaug 2024-04-29 13:56:27 +00:00
webscheduling Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth 2024-04-19 09:41:58 +00:00
webshare
websocket Bug 1785678 - Move IsValidProtocolString check earlier r=necko-reviewers,kershaw 2024-04-25 19:14:57 +00:00
webtransport Bug 1892325 - Introduce WebTransportSessionEventListenerInternal, r=nika 2024-04-22 08:57:42 +00:00
workers Bug 1892644 - Handling WorkerThreadRunnable::Run() after Worker is "Dead". r=asuth 2024-05-02 06:37:51 +00:00
worklet Bug 1887719 - More consistently use UTF8String/nsCString for URLs. r=necko-reviewers,webidl,anti-tracking-reviewers,places-reviewers,jari,kershaw,janv,smaug,hsivonen 2024-04-04 11:49:57 +00:00
xhr Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth 2024-04-19 09:41:58 +00:00
xml Bug 1204553 - xml:space="preserve" isn’t respected in the no-style-information "document tree" presentation of an XML document. r=hsivonen 2024-03-27 15:03:51 +00:00
xslt
xul Bug 1884792 - Remove chrome-only :-moz-lwtheme pseudo-class. r=desktop-theme-reviewers,dao 2024-03-18 10:18:25 +00:00
jar.mn
metrics.yaml Backed out changeset 1ed5eea3a1e1 (bug 1892231) for causing mochitests failures in test_focus.xhtml. 2024-04-26 09:05:08 +03:00
moz.build
pings.yaml