gecko-dev/dom/performance
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
..
tests Bug 1855296 - convert .ini manifests to .toml: batch 9 dom/[m-s]**/mochitest.ini r=jmaher,media-playback-reviewers,alwu 2023-10-03 19:35:22 +00:00
EventCounts.cpp
EventCounts.h
LargestContentfulPaint.cpp Bug 1877787 - Avoid doing reduced precision computation when generating LCP r=emilio,tjr 2024-02-01 14:30:44 +00:00
LargestContentfulPaint.h Bug 1875426. Remove unused LCPImageEntryKey::Equals. r=emilio 2024-03-02 07:56:42 +00:00
metrics.yaml Bug 1877842 - Migrate performance GVST probes r=perry.mcmanis,denispal 2024-02-09 21:11:05 +00:00
moz.build Bug 1855296 - convert .ini manifests to .toml: batch 9 dom/[m-s]**/mochitest.ini r=jmaher,media-playback-reviewers,alwu 2023-10-03 19:35:22 +00:00
Performance.cpp Bug 1887068: Add perfetto event traces for taskcontroller tasks and dom performance measurement markers. r=smaug 2024-04-15 15:34:04 +00:00
Performance.h Bug 1869835 - Part 2: Do some code deduplication and convert UserTimingMarker to the new schema. r=mstange,profiler-reviewers 2023-12-21 18:17:41 +00:00
PerformanceEntry.cpp
PerformanceEntry.h
PerformanceEventTiming.cpp Bug 1685926 - Group disconnected radio buttons together. r=saschanaz,smaug 2023-09-28 15:47:11 +00:00
PerformanceEventTiming.h
PerformanceMainThread.cpp Bug 1877787 - Avoid doing reduced precision computation when generating LCP r=emilio,tjr 2024-02-01 14:30:44 +00:00
PerformanceMainThread.h Bug 1867623 - Clear some LCP related data early when the window is dying r=smaug 2023-12-01 14:13:54 +00:00
PerformanceMark.cpp
PerformanceMark.h
PerformanceMeasure.cpp
PerformanceMeasure.h
PerformanceNavigation.cpp
PerformanceNavigation.h
PerformanceNavigationTiming.cpp
PerformanceNavigationTiming.h
PerformanceObserver.cpp Bug 1722322 - Implement LargestContentfulPaint r=emilio 2023-11-02 20:53:36 +00:00
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 Bug 1769913 - P3 Remove WorkerRunnable::mWorkerPrivate. r=dom-worker-reviewers,asuth 2024-04-19 09:41:58 +00:00
PerformanceStorageWorker.h
PerformanceTiming.cpp Bug 1883435 - Don't include GleanMetrics.h from Document.h. r=chutten,necko-reviewers,valentin 2024-03-05 17:54:14 +00:00
PerformanceTiming.h
PerformanceTimingTypes.ipdlh
PerformanceWorker.cpp
PerformanceWorker.h