gecko-dev/dom/file
Eden Chuang 2f65cf28ae Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth
WorkerRunnable no longer keeps a raw pointer(mWorkerPrivate) for the associated WorkerPrivate in this patch.
Removing the WorkerRunnable::mWorkerPrivate needs to fix the following problems.

1. Thread assertions in WorkerRunnable::Dispatch()

To fix this problem, the associated WorkerPrivate is as a parameter and passed to WorkerRunnable::Dispatch() for the dispatching thread assertions. This associated WorkerPrivate is also propagated to PreDispatch() and PostDispatch() for the children classes of WorkerRunnable()

2. Get the associated WorkerPrivate in WorkerRunnable::Run() for environment setup(GlobabObject, JSContext setting for the runnable)

- For WorkerThreadRunnable

Since WorkerThreadRunnable is supposed to run on the worker thread, it does not need to keep a raw pointer to WorkerPrivate as its class member. GetCurrentThreadWorkerPrivate() should always get the correct WorkerPrivate for WorkerThreadRunnable.

- For WorkerParentThreadRunnable

WorkerParentRef is introduced to keep a RefPtr<WorkerPrivate> for WorkerParentThreadRunnable instead of using a raw pointer.
Checking the associated WorkerPrivate existence by WorkerParentRef at the beginning of WorkerParentThreadRunnable::Run(). If the Worker has already shut down, WorkerParentThreadRunnable cannot do anything with the associated WorkerPrivate, so WorkerParentThreadRunnable::Run() will return NS_OK directly but with a warning.

The associated WorkerPrivate is also passed into WorkerRun(), PreRun(), and PostRun(), so the majority of implementations of child classes of WorkerRunnable do not need to be changed.

If there are any cases in which the child classes of WorkerThreadRunnable/WorkerParentThreadRunnable want to keep the associated WorkerPrivate, they should use WorkerRefs instead of raw pointers.

Depends on D205679

Differential Revision: https://phabricator.services.mozilla.com/D207039
2024-04-19 09:41:58 +00:00
..
ipc Bug 1889080 - Use overloaded Unused operator to leak runnable in RemoteLazyInputStreamThread::Dispatch. r=dom-storage-reviewers,janv 2024-04-02 12:12:55 +00:00
tests Bug 1780071 - Manual fixes/disabling of no-comparison-or-assignment-inside-ok for exceptional cases, r=Standard8,devtools-reviewers,anti-tracking-reviewers,places-reviewers,dom-storage-reviewers,pbz,asuth,nchevobbe 2024-02-19 23:30:40 +00:00
uri Bug 1886661 - Remove telemetry probe for Blob URL Partitioning.r=anti-tracking-reviewers,timhuang 2024-03-26 14:44:19 +00:00
BaseBlobImpl.cpp
BaseBlobImpl.h
Blob.cpp Bug 1857949 - Move AutoSuppressGCAnalysis to StreamBlobImpl::GetAllocationSize r=smaug 2023-10-10 11:48:32 +00:00
Blob.h
BlobImpl.cpp
BlobImpl.h
BlobSet.cpp
BlobSet.h
EmptyBlobImpl.cpp
EmptyBlobImpl.h
File.cpp
File.h
FileBlobImpl.cpp
FileBlobImpl.h
FileCreatorHelper.cpp Bug 1847298: IPC constructor cleanup r=nika,padenot,dom-storage-reviewers,necko-reviewers,cookie-reviewers,asuth,Jamie 2023-12-08 15:56:39 +00:00
FileCreatorHelper.h
FileList.cpp
FileList.h
FileReader.cpp Bug 1624819 - Remove TaskCategory and other quantum dom remnants. r=smaug,media-playback-reviewers,credential-management-reviewers,cookie-reviewers,places-reviewers,win-reviewers,valentin,mhowell,sgalich,alwu 2023-10-10 08:51:12 +00:00
FileReader.h
FileReaderSync.cpp Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth 2024-04-19 09:41:58 +00:00
FileReaderSync.h Bug 1866220 - Prevent refcounted non-WrapperCached DOM objects. r=farre,extension-reviewers,rpl 2023-11-24 10:38:18 +00:00
MemoryBlobImpl.cpp
MemoryBlobImpl.h
moz.build Bug 1859890 - batch 14 convert xpcshell.ini -> .toml. r=aryx,dom-storage-reviewers,jesup 2023-11-28 01:02:01 +00:00
MultipartBlobImpl.cpp
MultipartBlobImpl.h
MutableBlobStorage.cpp
MutableBlobStorage.h
MutableBlobStreamListener.cpp Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl 2023-10-27 13:30:11 +00:00
MutableBlobStreamListener.h Bug 1851992 - implement nsIThreadRetargetableStreamListener::OnDataFinished to multiple listeners. r=necko-reviewers,extension-reviewers,jesup,rpl 2023-10-27 13:30:11 +00:00
StreamBlobImpl.cpp Bug 1857949 - Move AutoSuppressGCAnalysis to StreamBlobImpl::GetAllocationSize r=smaug 2023-10-10 11:48:32 +00:00
StreamBlobImpl.h
StringBlobImpl.cpp
StringBlobImpl.h
TemporaryFileBlobImpl.cpp
TemporaryFileBlobImpl.h