mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-23 21:01:08 +00:00
2f65cf28ae
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 |
||
---|---|---|
.. | ||
tests | ||
EventCounts.cpp | ||
EventCounts.h | ||
LargestContentfulPaint.cpp | ||
LargestContentfulPaint.h | ||
metrics.yaml | ||
moz.build | ||
Performance.cpp | ||
Performance.h | ||
PerformanceEntry.cpp | ||
PerformanceEntry.h | ||
PerformanceEventTiming.cpp | ||
PerformanceEventTiming.h | ||
PerformanceMainThread.cpp | ||
PerformanceMainThread.h | ||
PerformanceMark.cpp | ||
PerformanceMark.h | ||
PerformanceMeasure.cpp | ||
PerformanceMeasure.h | ||
PerformanceNavigation.cpp | ||
PerformanceNavigation.h | ||
PerformanceNavigationTiming.cpp | ||
PerformanceNavigationTiming.h | ||
PerformanceObserver.cpp | ||
PerformanceObserver.h | ||
PerformanceObserverEntryList.cpp | ||
PerformanceObserverEntryList.h | ||
PerformancePaintTiming.cpp | ||
PerformancePaintTiming.h | ||
PerformanceResourceTiming.cpp | ||
PerformanceResourceTiming.h | ||
PerformanceServerTiming.cpp | ||
PerformanceServerTiming.h | ||
PerformanceService.cpp | ||
PerformanceService.h | ||
PerformanceStorage.h | ||
PerformanceStorageWorker.cpp | ||
PerformanceStorageWorker.h | ||
PerformanceTiming.cpp | ||
PerformanceTiming.h | ||
PerformanceTimingTypes.ipdlh | ||
PerformanceWorker.cpp | ||
PerformanceWorker.h |