gecko-dev/dom/workers
Nicolas B. Pierron 8a851d2266 Bug 1800641 - Move some ScriptLoadRequest fields into LoadedScript. r=yulia
We are looking into caching loaded script in memory. To do so we need something
to cache.

At the moment, the `ScriptLoadRequest` structure hold all the fields which are
loaded, and used before executing JavaScript code. Then, the `ScriptLoadRequest`
is not guaranteed to out-live the first execution.

Therefore, we have to move fields out of the `ScriptLoadRequest` such that they
can later be used by any caching mechanism. The `LoadedScript` is the closest
existing structure which exists which fit the description.

This patch moves fields out of the ScriptLoadRequest into the `LoadedScript`,
which already has a `LoadedScript` field.

The `LoadedScript` field is initialized sooner, when the `ScriptLoadRequest` is
created, to be subsituted later by a real cache implementation. At the moment
the function `ScriptLoadRequest::NoCacheEntryFound` is used as a placeholder to
change the state of the `ScriptLoadRequest` from `CheckingCache` to `Fetching`.
Existing initializations are replaced by assertions to fail in debug build if
the current patch does not reproduce the expected state properly.

The `LoadedScript` get fields such as the source text, the text length, the
bytecode buffer (which also contains SRI), and the offset at which the bytecode
starts within the bytecode buffer. As these fields are no longer reachable by
name, multiple accessors are added to work-around the issue. Using this as an
opportunity to add extra assertions as part of these accessors.

A new class named `LoadedScriptDelegate` is added to re-add, by inheritance, all
the accessors which used to be part of `ScriptLoadRequest` as methods which are
delegating to the field which is holding the `LoadedScript`. This class is using
templates to avoid virtual inheritance which might hinder inlining, especially
since `ScriptLoadRequest` cannot be made final, as `ModuleLoadRequest` extends
it.

The `ScriptFetchOptions` structure is moved to its own file to solve C++ include
issues.

Differential Revision: https://phabricator.services.mozilla.com/D163615
2023-12-25 09:46:54 +00:00
..
loader Bug 1800641 - Move some ScriptLoadRequest fields into LoadedScript. r=yulia 2023-12-25 09:46:54 +00:00
remoteworkers Bug 1577829 - Set the service worker launch timings r=edenchuang,necko-reviewers,jesup 2023-12-13 13:15:12 +00:00
sharedworkers Bug 1776962 - Close SharedWorker on DETH disconnect. r=dom-worker-reviewers,smaug 2023-10-28 00:29:52 +00:00
test Bug 1749047 - Implement the boilerplate for VideoEncoder. r=chunmin,webidl,smaug,saschanaz 2023-12-22 21:39:07 +00:00
ChromeWorker.cpp
ChromeWorker.h
ChromeWorkerScope.cpp
ChromeWorkerScope.h
EventWithOptionsRunnable.cpp Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
EventWithOptionsRunnable.h Bug 1631263: Implement RTCRtpScriptTransform. r=pehrsons,jib,asuth,emilio,saschanaz 2023-07-20 14:24:27 +00:00
JSExecutionManager.cpp Bug 1851263 - Rename nsIGlobalObject::AsInnerWindow to GetAsInnerWindow because it can return null. r=smaug 2023-09-04 04:06:30 +00:00
JSExecutionManager.h
JSSettings.h
MessageEventRunnable.cpp Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
MessageEventRunnable.h Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
Queue.h
RegisterBindings.cpp Bug 1786885 - Remove OS.Constants r=nika 2023-07-12 03:57:12 +00:00
RuntimeService.cpp Bug 1864168 - Part 1: Use 1-origin column number in nsIContentSecurityPolicy. r=smaug,devtools-reviewers,ochameau,ckerschb 2023-11-22 12:31:30 +00:00
RuntimeService.h Bug 1843841 - Make navigator.appName constant. r=dom-worker-reviewers,webidl,smaug,timhuang 2023-07-19 17:00:53 +00:00
ScriptLoader.cpp Bug 1800641 - Move some ScriptLoadRequest fields into LoadedScript. r=yulia 2023-12-25 09:46:54 +00:00
ScriptLoader.h Bug 1823391 - Have a static WorkerScriptLoader::Create and try to shutdown when the workerRef is notified. r=yulia,edenchuang,asuth 2023-11-15 07:00:02 +00:00
Worker.cpp Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
Worker.h Bug 1631263: Implement RTCRtpScriptTransform. r=pehrsons,jib,asuth,emilio,saschanaz 2023-07-20 14:24:27 +00:00
WorkerCSPEventListener.cpp
WorkerCSPEventListener.h
WorkerChannelInfo.cpp
WorkerChannelInfo.h
WorkerCommon.h
WorkerDebugger.cpp Bug 1836191 - remove ChromeUtils.requestPerformanceMetrics that was only used by about:performance, r=smaug. 2023-06-08 21:53:18 +00:00
WorkerDebugger.h Bug 1836191 - remove ChromeUtils.requestPerformanceMetrics that was only used by about:performance, r=smaug. 2023-06-08 21:53:18 +00:00
WorkerDebuggerManager.cpp
WorkerDebuggerManager.h
WorkerDocumentListener.cpp
WorkerDocumentListener.h
WorkerError.cpp Bug 1843484 - Use EventTarget* instead of nsISupports* for the event target parameter of the EventDispatcher::Dispatch methods. r=smaug 2023-08-28 23:38:43 +00:00
WorkerError.h Bug 1746374 - Use the number of UTF-16 code units as column number. r=iain 2023-08-11 08:11:48 +00:00
WorkerEventTarget.cpp Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
WorkerEventTarget.h
WorkerIPCUtils.h
WorkerLoadInfo.cpp Bug 1835907, part 5 - Refactor the window's mStorageAccessPermissionGranted variable and its Getters to a more accurate name: mUsingStorageAccess - r=anti-tracking-reviewers,pbz 2023-08-15 13:04:05 +00:00
WorkerLoadInfo.h Bug 1824222 - Add OverriddenFingerprintingSettings to worker loadInfo. r=tjr,dom-worker-reviewers,smaug 2023-10-17 22:02:28 +00:00
WorkerLocation.cpp
WorkerLocation.h
WorkerNavigator.cpp Bug 1857593 - Enable GPC in Private Browsing Mode by default - r=jewilde,anti-tracking-reviewers,necko-reviewers,valentin,timhuang 2023-10-18 13:30:51 +00:00
WorkerNavigator.h Bug 1857593 - Enable GPC in Private Browsing Mode by default - r=jewilde,anti-tracking-reviewers,necko-reviewers,valentin,timhuang 2023-10-18 13:30:51 +00:00
WorkerPrivate.cpp Bug 1851816: Pass PBM Status into RFPIsEnabledFor r=timhuang 2023-12-18 18:39:33 +00:00
WorkerPrivate.h Bug 1865774 - Add WorkerPrivate::mWorkerLoopIsIdle to indicate the Worker is idle and could be GCed. r=asuth 2023-11-22 16:18:34 +00:00
WorkerRef.cpp Bug 1864661 - P1 Call IPCWorkerRef::SetActorCount() when IPCWorkerRef hold worker successfully. r=dom-worker-reviewers,asuth 2023-11-27 09:22:39 +00:00
WorkerRef.h Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
WorkerRunnable.cpp Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
WorkerRunnable.h Bug 1836700 - Remove BusyCount of WorkerPrivate. r=asuth,ipc-reviewers,mccr8 2023-11-13 04:00:40 +00:00
WorkerScope.cpp Bug 1862244 - Add GlobalTeardownHelper r=smaug 2023-11-23 17:17:39 +00:00
WorkerScope.h 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
WorkerStatus.h
WorkerTestUtils.cpp
WorkerTestUtils.h
WorkerThread.cpp Bug 1865774 - Allow WorkerThread::HasPendingEvents() can be accessed on the parent thread. r=asuth 2023-11-21 16:30:09 +00:00
WorkerThread.h Bug 1865774 - Allow WorkerThread::HasPendingEvents() can be accessed on the parent thread. r=asuth 2023-11-21 16:30:09 +00:00
moz.build Bug 1855298 - convert .ini manifests to .toml: batch 10 dom/[t-z]**/mochitest.ini r=jmaher 2023-10-25 15:54:48 +00:00
nsIWorkerChannelInfo.idl
nsIWorkerDebugger.idl Bug 1802289 - enforce license linter for .idl and .webidl files r=linter-reviewers,sylvestre,saschanaz DONTBUILD 2023-11-06 10:18:23 +00:00
nsIWorkerDebuggerManager.idl Bug 1802289 - enforce license linter for .idl and .webidl files r=linter-reviewers,sylvestre,saschanaz DONTBUILD 2023-11-06 10:18:23 +00:00