Commit Graph

1110 Commits

Author SHA1 Message Date
Florian Quèze
6147d3f360 Bug 1956726 - Migrate histograms to use Glean APIs in dom/, r=chutten.
Differential Revision: https://phabricator.services.mozilla.com/D244177
2025-04-03 21:02:54 +00:00
Tooru Fujisawa
c882062351 Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 13:09:04 +00:00
Stanca Serban
3d34fe1048 Backed out 8 changesets (bug 1949932) for causing reftests failures in LoadedScript.h. CLOSED TREE
Backed out changeset de39fd08733d (bug 1949932)
Backed out changeset b75281f1b27c (bug 1949932)
Backed out changeset 8920e6d4cf8c (bug 1949932)
Backed out changeset c05f9bf802ae (bug 1949932)
Backed out changeset 2c9718bfd7be (bug 1949932)
Backed out changeset 03f4514cfba8 (bug 1949932)
Backed out changeset 9fe4fd6ee6e8 (bug 1949932)
Backed out changeset 1cebf102e64e (bug 1949932)
2025-04-01 08:59:51 +03:00
Tooru Fujisawa
872eb028b0 Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 03:11:18 +00:00
Goloman Adrian
62c97b0b6c Backed out 8 changesets (bug 1949932) for causing build bustages @RootingAPI.h. CLOSED TREE
Backed out changeset 181cde5d267e (bug 1949932)
Backed out changeset 44fd656c40de (bug 1949932)
Backed out changeset b4d93df0edb1 (bug 1949932)
Backed out changeset 7c20db67f688 (bug 1949932)
Backed out changeset ac742d9dc3aa (bug 1949932)
Backed out changeset 102e0dc46dff (bug 1949932)
Backed out changeset 80d1b3331844 (bug 1949932)
Backed out changeset cc1834c3ea2a (bug 1949932)
2025-04-01 07:09:29 +03:00
Tooru Fujisawa
85a3b6e05a Bug 1949932 - Part 1: Use SharedScriptCache from ModuleLoader. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242728
2025-04-01 03:11:18 +00:00
Sean Feng
185d905fb0 Bug 1920115 - Add the setup for WebTaskSchedulingState r=jjaschke,dom-core,arai
Spec: https://wicg.github.io/scheduling-apis/#scheduling-state

This patch add the setup for WebTaskSchedulingState so that it
can be set and get in the following patch, by allowing it
to be carried over in continued Promise callbask and be set to
window globals and worker globals.

Differential Revision: https://phabricator.services.mozilla.com/D234231
2025-03-31 19:49:02 +00:00
Edgar Chen
82d780e44e Bug 1954685 - Unship onafterscriptexecute and onbeforescriptexecute events on Nightly; r=dom-core,webidl,saschanaz,devtools-reviewers,ochameau,hsivonen,jandem
Differential Revision: https://phabricator.services.mozilla.com/D241940
2025-03-31 19:10:02 +00:00
DavidJCobb
6022e96f95 Bug 1956163 - ScriptLoader now reports child module load failures as coming from the parent module. r=arai
When a child module fails to load, the parent module that requested it is now used as the source location for the error message.

Differential Revision: https://phabricator.services.mozilla.com/D242884
2025-03-26 10:20:14 +00:00
Tooru Fujisawa
b0f8b0b3c3 Bug 1954667 - Forcibly clear the shared script cache when shutting down. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242318
2025-03-22 11:54:13 +00:00
Tooru Fujisawa
ef5d576f1d Bug 1954641 - Part 2: Do not cache inline scripts. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242317
2025-03-22 11:54:13 +00:00
Tooru Fujisawa
e2f9d5b67b Bug 1954641 - Part 1: Do not use SharedScriptCache in system principal. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242316
2025-03-22 11:54:12 +00:00
Tooru Fujisawa
fef3339c5e Bug 1954644 - Part 10: Move the EmulateNetworkEvents call to StartClassicLoad. r=nbp
Given that modules become singleton per each global, and they're not always
fetched, network events should be emulated only when the module is confirmed
not to be stored in the module map.

The EmulateNetworkEvents callside should be more tightly coupled with the actual
StartLoadInternal call.

Differential Revision: https://phabricator.services.mozilla.com/D242315
2025-03-22 04:03:56 +00:00
Tooru Fujisawa
3a0e4f5b62 Bug 1954644 - Part 8: Move cache insertion logic into ScriptLoader::TryCacheRequest and ScriptLoader::GetCacheBehavior. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242313
2025-03-22 04:03:55 +00:00
Tooru Fujisawa
7aaa05d10e Bug 1954644 - Part 7: Move cache lookup and consumption logic into ScriptLoader::TryUseCache and ScriptLoader::EmulateNetworkEvents. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242312
2025-03-22 04:03:55 +00:00
Tooru Fujisawa
457e7a1f83 Bug 1954644 - Part 6: Move ScriptLoadRequestType to its own file. r=nbp
ModuleLoader will also use it.

Differential Revision: https://phabricator.services.mozilla.com/D242311
2025-03-22 04:03:55 +00:00
Tooru Fujisawa
35309dc989 Bug 1954644 - Part 4: Remove obsolete comment for static-ness. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242309
2025-03-22 04:03:55 +00:00
Tooru Fujisawa
2383b98374 Bug 1954644 - Part 3: Cleanup ModuleLoadRequest parameters to avoid confusing parameter syntax. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242308
2025-03-22 04:03:54 +00:00
Tooru Fujisawa
7d581d7571 Bug 1954644 - Part 2: Fix parameter/variable names. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D242307
2025-03-22 04:03:54 +00:00
Tooru Fujisawa
8fa3cc1097 Bug 1947158 - Add url option to ChromeUtils.clearResourceCache. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D238357
2025-03-18 09:57:57 +00:00
Emilio Cobos Álvarez
79d4a5d43e Bug 1954178 - Don't cache subresources based off the triggering principal. r=arai
Use the partition principal.

Differential Revision: https://phabricator.services.mozilla.com/D241732
2025-03-17 11:56:30 +00:00
Emilio Cobos Álvarez
2cc4039e44 Bug 1954134 - Simplify ImageCacheKey partitioning. r=necko-reviewers,valentin,arai
Use the same scheme as the JS and CSS caches:

https://searchfox.org/mozilla-central/rev/5c2888b35d56928d252acf84e8816fa89a8a6a61/layout/style/Loader.cpp#2341
https://searchfox.org/mozilla-central/rev/5c2888b35d56928d252acf84e8816fa89a8a6a61/dom/script/ScriptLoader.cpp#329

(And fonts, and plenty of others)

Differential Revision: https://phabricator.services.mozilla.com/D241664
2025-03-15 15:36:25 +00:00
Fatih Kilic
37486aeb74 Bug 1945540: Part 3 - Get integrity from import map. r=tschuster,jonco,dom-core,mccr8
Differential Revision: https://phabricator.services.mozilla.com/D236559
2025-03-06 14:16:30 +00:00
Henri Sivonen
a1732ccb1c Bug 1938290 - Add a continuation mechanism for the parsers returning early due to there being a current script. r=peterv
Differential Revision: https://phabricator.services.mozilla.com/D233329
2025-03-04 17:34:59 +00:00
Stanca Serban
fee009a450 Backed out 8 changesets (bug 1920115) for causing multiple failures.
Backed out changeset 2d0905a92f2c (bug 1920115)
Backed out changeset 67bf260fe59b (bug 1920115)
Backed out changeset 4739af17e757 (bug 1920115)
Backed out changeset 0773f669c498 (bug 1920115)
Backed out changeset 4b579a1c9b46 (bug 1920115)
Backed out changeset 79b3b0148eb4 (bug 1920115)
Backed out changeset 78181c32bdc6 (bug 1920115)
Backed out changeset 912cf1adac80 (bug 1920115)
2025-02-28 02:01:11 +02:00
Nazım Can Altınova
ff6637364b Bug 1799109 - Replace AUTO_PROFILER_MARKER_TEXT markers without a text with the new untyped one r=profiler-reviewers,florian
Differential Revision: https://phabricator.services.mozilla.com/D238121
2025-02-27 21:45:18 +00:00
Sean Feng
1de017cb47 Bug 1920115 - Add the setup for WebTaskSchedulingState r=jjaschke,dom-core,arai
Spec: https://wicg.github.io/scheduling-apis/#scheduling-state

This patch add the setup for WebTaskSchedulingState so that it
can be set and get in the following patch, by allowing it
to be carried over in continued Promise callbask and be set to
window globals and worker globals.

Differential Revision: https://phabricator.services.mozilla.com/D234231
2025-02-27 16:17:35 +00:00
Emilio Cobos Álvarez
db9bcd53f7 Bug 1948889 - Simplify SRICheck by getting location from http referrer info. r=freddyb,tschuster
The referrer info is more directly what we want (what triggered this
load).

I could add this information for non-http channels, but I think it's
probably not worth it. This is useful because it's thread-safe, which
allows me to support off-main-thread parsing of stylesheets that contain
SRI metadata.

It also simplifies the API and avoids getting URIs around in non-error
code paths.

Differential Revision: https://phabricator.services.mozilla.com/D238612
2025-02-25 09:38:28 +00:00
Goloman Adrian
c6e05542f0 Backed out 8 changesets (bug 1920115) for causing hazard bustages @CycleCollectedJSContext.cpp.
Backed out changeset f5357c6c5580 (bug 1920115)
Backed out changeset 6a8cb3cc704e (bug 1920115)
Backed out changeset 4ccb6970887e (bug 1920115)
Backed out changeset 7522970c5a1d (bug 1920115)
Backed out changeset 6c1140811a6c (bug 1920115)
Backed out changeset be6c223e63f0 (bug 1920115)
Backed out changeset 121bf804d2a6 (bug 1920115)
Backed out changeset 6b23965ce57e (bug 1920115)
2025-02-25 02:48:00 +02:00
Sean Feng
4af9cbe5ab Bug 1920115 - Add the setup for WebTaskSchedulingState r=jjaschke,dom-core,arai
Spec: https://wicg.github.io/scheduling-apis/#scheduling-state

This patch add the setup for WebTaskSchedulingState so that it
can be set and get in the following patch, by allowing it
to be carried over in continued Promise callbask and be set to
window globals and worker globals.

Differential Revision: https://phabricator.services.mozilla.com/D234231
2025-02-24 19:31:26 +00:00
Tooru Fujisawa
3e937c72fd Bug 1902953 - Use the SharedScriptCache in script preload. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D238371
2025-02-20 12:10:52 +00:00
Tooru Fujisawa
a3f1629b8f Bug 1948808 - Part 2: Add chrome optional parameter to control the target of clear in-memory cache. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D238581
2025-02-20 10:16:46 +00:00
Sandor Molnar
61d8ddba5a Backed out 5 changesets (bug 1948814, bug 1948808) for causing build bustages @ gfxWindowsPlatform.cpp & imgLoader.cpp CLOSED TREE
Backed out changeset 9dad8866deac (bug 1948808)
Backed out changeset 7d15850e1871 (bug 1948808)
Backed out changeset 94a8ed4703ac (bug 1948808)
Backed out changeset 1249b7246565 (bug 1948814)
Backed out changeset 67a316ead440 (bug 1948814)
2025-02-20 10:19:27 +02:00
Tooru Fujisawa
6cb4f15fea Bug 1948808 - Part 2: Add chrome optional parameter to control the target of clear in-memory cache. r=emilio
Differential Revision: https://phabricator.services.mozilla.com/D238581
2025-02-20 07:04:55 +00:00
Tooru Fujisawa
af1768891a Bug 1947063 - Part 2: Evict cache when non-cacheable content is received. r=nbp,emilio
Differential Revision: https://phabricator.services.mozilla.com/D237561
2025-02-14 15:10:35 +00:00
Yoshi Cheng-Hao Huang
1b50922475 Bug 1933239 - Update HTTP Accept header when fetching a JSON module. r=dom-core,necko-reviewers,frontend-codestyle-reviewers,mossop,valentin,sefeng
According to https://fetch.spec.whatwg.org/#fetching

If the request's destination is "json", the Accept value in HTTP header
should be set to `application/json,*/*;q=0.5`.

Differential Revision: https://phabricator.services.mozilla.com/D235837
2025-02-10 14:18:48 +00:00
Tooru Fujisawa
af77f5495d Bug 1945994 - Explicitly block the load event until the cached script is executed. r=nbp,emilio
Differential Revision: https://phabricator.services.mozilla.com/D236980
2025-02-06 14:05:03 +00:00
Tooru Fujisawa
ec1f5b8445 Bug 1945411 - Part 3: Do not cache stencil with asm.js. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D236496
2025-02-03 14:34:54 +00:00
Florian Quèze
9609e47f62 Bug 1879329 - script generated replacement of the GleanMetrics.h includes, r=chutten,valentin,media-playback-reviewers,cookie-reviewers,anti-tracking-reviewers,profiler-reviewers,win-reviewers,rkraesig,emz,aabh,padenot.
Differential Revision: https://phabricator.services.mozilla.com/D234744
2025-01-21 11:21:45 +00:00
Vincent Hilla
adccdd89ca Bug 1840932 - Have ScriptLoader not block load twice on document.open. r=smaug
If a document is still processing a stylesheet while document.open occurs,
the defer checkpoint might not have been reached. This causes the
ScriptLoader to block load twice, although it will only unblock once.

Related: Bug 1568171

Differential Revision: https://phabricator.services.mozilla.com/D233156
2025-01-06 13:18:10 +00:00
Jonatan Klemets
bef1efa9e2 Bug 1858078 - Part 2: Return correct nsIContentPolicy when fetching json modules r=spidermonkey-reviewers,dom-core,hsivonen,allstarschh
Differential Revision: https://phabricator.services.mozilla.com/D229525
2024-12-12 17:39:18 +00:00
Tooru Fujisawa
d0e537de50 Bug 1899090 - Part 9: Rename *IncrementalEncoding public API to *CollectDelazifications. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D230385
2024-12-04 00:54:46 +00:00
Tooru Fujisawa
22a5b6727a Bug 1899090 - Part 3: Stop using JS::DuplicateStencil in ScriptLoader. r=nbp
Incremental-encoding API no longer requires exclusive ownership of JS::Stencil,
and the consumers no longer need to duplicate.

Differential Revision: https://phabricator.services.mozilla.com/D230379
2024-12-04 00:54:44 +00:00
Tooru Fujisawa
c1b8d7b50e Bug 1899090 - Part 2: Rebuild the incremental encoding with InitialStencilAndDelazifications. r=nbp
Create InitialStencilAndDelazifications and associate it to ScriptSourceObject,
and store on-demand delazifications into the InitialStencilAndDelazifications.

InitialStencilAndDelazifications is merged into single CompilationStencil when
finishing, but the JS::Stencil-based API is going to be rewritten later not
to merge.

Differential Revision: https://phabricator.services.mozilla.com/D230378
2024-12-04 00:54:44 +00:00
Bryan Thrall
5304755464 Bug 1929227 - Restore bytecode handling r=mgaudet
It was accidentally removed in 7b334fe58713.

Differential Revision: https://phabricator.services.mozilla.com/D228190
2024-11-06 16:06:39 +00:00
Bryan Thrall
e26f923c8e Bug 1724236 - Move InstantiateStencil() to ScriptLoader r=arai
Differential Revision: https://phabricator.services.mozilla.com/D222299
2024-10-30 13:41:48 +00:00
Bryan Thrall
3bacfd5034 Bug 1724236 - Rename JSExecutionUtils from JSExecutionContext r=arai
Differential Revision: https://phabricator.services.mozilla.com/D218458
2024-10-30 13:41:47 +00:00
Bryan Thrall
0b84b732ae Bug 1724236 - Remove JSExecutionContext r=arai
I think the constructor assertions don't need to be preserved, since the
locations where JSExecutionContext was constructed are obviously using a real
global on the main thread. I'm less confident in removing the check for
CycleCollectedJSContext::Get()->MicroTaskLevel(), but it should be ok since the
assertion wasn't failing already.

I'm leaving the profiler label "JSExecutionContext" intact for now so there's
no change in recorded profiles, but we should consider a better name for it in
the future.

Differential Revision: https://phabricator.services.mozilla.com/D218457
2024-10-30 13:41:46 +00:00
Bryan Thrall
34372a7a97 Bug 1724236 - Inline JoinOffThread r=arai
Differential Revision: https://phabricator.services.mozilla.com/D218456
2024-10-30 13:41:46 +00:00
Bryan Thrall
a85ba25a1c Bug 1724236 - Move JoinOffThread and InstantiateStencil out of JSExecutionContext r=arai
Differential Revision: https://phabricator.services.mozilla.com/D218455
2024-10-30 13:41:46 +00:00