Tooru Fujisawa
5c8d191154
Bug 1973206 - Part 4: Filter out JSON modules earlier in ScriptLoader::CalculateBytecodeCacheFlag. r=nbp
...
Differential Revision: https://phabricator.services.mozilla.com/D254650
2025-06-25 01:58:38 +00:00
Tooru Fujisawa
2e9c7ce88a
Bug 1973206 - Part 3: Move CalculateBytecodeCacheFlag to instance method as a preparation for the subsequent patches. r=nbp
...
Differential Revision: https://phabricator.services.mozilla.com/D254649
2025-06-25 01:58:35 +00:00
Tooru Fujisawa
64d3a74e4d
Bug 1973206 - Part 2: Verify the list in IsAlreadyHandledForBytecodeEncodingPreparation. r=nbp
...
Differential Revision: https://phabricator.services.mozilla.com/D254648
2025-06-25 01:58:31 +00:00
Yoshi Cheng-Hao Huang
49588bd532
Bug 1973346 : Remove iteration over mImports in ReportPreloadErrorsToConsole. r=jonco
...
The mUnreportedPreloadError flag is set within ReportErrorToConsole [1].
The list of callers for ReportErrorToConsole is as follows:
1. Indirectly via ScriptLoaderInterface::ReportErrorToConsole:
- This includes StartFetchingModuleAndDependencies [2] (for static imports)
and StartDynamicImport [3] (for dynamic imports).
- Both are invoked when StartModuleLoad fails, which implies the request
has no child modules.
2. Failures during script processing:
1. StartLoad() fails in ProcessExternalScript [4], which only happens if
CanStartLoad fails [5]. This condition also ensures that the request
will not have any child modules.
2. OnFetchComplete fails in ProcessInlineScript [6], indicating that
CreateModuleScript has failed. Again, this means there are no children.
3. PrepareLoadedRequest fails in OnStreamComplete [7], which implies a
failure in OnFetchComplete [8]. As mentioned in 2.2, this is due to
a failure in CreateModuleScript, so no child requests are present.
Based on the above analysis, whenever mUnreportedPreloadError is set, the
request does not have any child modules.
[1]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/dom/script/ScriptLoader.cpp#4026
[2]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/dom/script/ScriptLoader.cpp#1046
[3]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/js/loader/ModuleLoaderBase.cpp#1094
[4]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/dom/script/ScriptLoader.cpp#1391
[5]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/js/loader/ModuleLoaderBase.cpp#491
[6]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/dom/script/ScriptLoader.cpp#1638
[7]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/dom/script/ScriptLoader.cpp#3913
[8]: https://searchfox.org/mozilla-central/rev/96296f9d65cf8074e1e789aff92456a8442f7e9d/dom/script/ScriptLoader.cpp#4456
Differential Revision: https://phabricator.services.mozilla.com/D254605
2025-06-23 20:51:27 +00:00
Yoshi Cheng-Hao Huang
32a16f9d21
Bug 1973078 - Use referrer info to get parent module info. r=arai
...
To get the parent module information, the correct way should be using
the "mReferrer" member.
Differential Revision: https://phabricator.services.mozilla.com/D254494
2025-06-23 19:03:57 +00:00
Tim Huang
7625948b4a
Bug 1968644 - Part 3: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for fetch requests. r=valentin,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D252444
2025-06-17 20:28:15 +00:00
Denis
48c9e4bb99
Bug 1966952: Remove unused JS telemetry probes: JS_PAGELOAD_EXECUTION_MS, JS_PAGELOAD_DELAZIFICATION_MS, JS_PAGELOAD_XDR_ENCODING_MS, JS_PAGELOAD_BASELINE_COMPILE_MS, JS_PAGELOAD_GC_MS, JS_PAGELOAD_PARSE_MS, JS_PAGELOAD_PROTECT_MS. r=mgaudet
...
Differential Revision: https://phabricator.services.mozilla.com/D253241
2025-06-17 14:37:43 +00:00
agoloman
a48b34690b
Revert "Bug 1968644 - Part 10: Store JSCallingLocation and set the JSCallingLocation fallback for Media loads. r=emilio" for causing valgrid failures.
...
This reverts commit efd9a5ba48 .
Revert "Bug 1968644 - Part 9: Add more tests for loads triggered by tracking scripts. r=valentin,anti-tracking-reviewers,emz"
This reverts commit 7d5c3e1c1c .
Revert "Bug 1968644 - Part 8: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for WebSocket requests. r=valentin,necko-reviewers"
This reverts commit 53a783a51e .
Revert "Bug 1968644 - Part 7: Add tests. r=necko-reviewers,anti-tracking-reviewers,emz,valentin"
This reverts commit e52f034955 .
Revert "Bug 1968644 - Part 6: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags during channel creation. r=necko-reviewers,kershaw"
This reverts commit f564c21b37 .
Revert "Bug 1968644 - Part 5: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for CSS loads. r=emilio"
This reverts commit 8a8fd7bacc .
Revert "Bug 1968644 - Part 4: Populate triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for loads. r=smaug,necko-reviewers"
This reverts commit 7b3ba3b668 .
Revert "Bug 1968644 - Part 3: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for fetch requests. r=valentin,smaug"
This reverts commit 08f090244f .
Revert "Bug 1968644 - Part 2: Intorduce the ClassificationFlags to nsIClassifiedChannel.idl. r=dimi,necko-reviewers,valentin"
This reverts commit b8c01cd77c .
Revert "Bug 1968644 - Part 1: Introduce triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags to LoadInfo. r=necko-reviewers,kershaw"
This reverts commit a7619a72b4 .
2025-06-17 14:27:29 +00:00
Frédéric Wang
f4b455c69b
Bug 1972280: Make nsCSPContext::GetAllowsInline use the source of the event handler attribute for inline script element too. r=tschuster
...
Currently nsCSPContext::GetAllowsInline first gets the text of
aTriggeringElement if it's an inline script, and falls back to
the specified aContentOfPseudoScript otherwise. This is wrong
for event handler attribute on inline script elements.
Differential Revision: https://phabricator.services.mozilla.com/D253794
2025-06-17 09:36:15 +00:00
Tim Huang
08f090244f
Bug 1968644 - Part 3: Populate the triggeringFirstPartyClassificationFlags and triggeringThirdPartyClassificationFlags for fetch requests. r=valentin,smaug
...
Differential Revision: https://phabricator.services.mozilla.com/D252444
2025-06-17 09:24:39 +00:00
Cristina Horotan
e8a1a7a986
Revert "Bug 1966952: Only enable JS execution timers during top level document loading. r=mgaudet,smaug" for causing wpt leaks
...
This reverts commit b010eb3a13 .
Revert "Bug 1966952: Add delazification time to the pageload event. r=mgaudet"
This reverts commit 56379eb36f .
Revert "Bug 1966952: Remove unused JS telemetry probes: JS_PAGELOAD_EXECUTION_MS, JS_PAGELOAD_DELAZIFICATION_MS, JS_PAGELOAD_XDR_ENCODING_MS, JS_PAGELOAD_BASELINE_COMPILE_MS, JS_PAGELOAD_GC_MS, JS_PAGELOAD_PARSE_MS, JS_PAGELOAD_PROTECT_MS. r=mgaudet"
This reverts commit 30fa4dd7ad .
2025-06-13 07:35:28 +00:00
Denis
30fa4dd7ad
Bug 1966952: Remove unused JS telemetry probes: JS_PAGELOAD_EXECUTION_MS, JS_PAGELOAD_DELAZIFICATION_MS, JS_PAGELOAD_XDR_ENCODING_MS, JS_PAGELOAD_BASELINE_COMPILE_MS, JS_PAGELOAD_GC_MS, JS_PAGELOAD_PARSE_MS, JS_PAGELOAD_PROTECT_MS. r=mgaudet
...
Differential Revision: https://phabricator.services.mozilla.com/D253241
2025-06-12 22:25:55 +00:00
agoloman
f8808930d5
Revert "Bug 1966952: Only enable JS execution timers during top level document loading. r=mgaudet,smaug" for causing hazard failures @Document.cpp.
...
This reverts commit 88bb6e2042 .
Revert "Bug 1966952: Add delazification time to the pageload event. r=mgaudet"
This reverts commit ebcdd1cdd9 .
Revert "Bug 1966952: Remove unused JS telemetry probes: JS_PAGELOAD_EXECUTION_MS, JS_PAGELOAD_DELAZIFICATION_MS, JS_PAGELOAD_XDR_ENCODING_MS, JS_PAGELOAD_BASELINE_COMPILE_MS, JS_PAGELOAD_GC_MS, JS_PAGELOAD_PARSE_MS, JS_PAGELOAD_PROTECT_MS. r=mgaudet"
This reverts commit b26ef8f92d .
2025-06-12 09:25:09 +00:00
Denis
b26ef8f92d
Bug 1966952: Remove unused JS telemetry probes: JS_PAGELOAD_EXECUTION_MS, JS_PAGELOAD_DELAZIFICATION_MS, JS_PAGELOAD_XDR_ENCODING_MS, JS_PAGELOAD_BASELINE_COMPILE_MS, JS_PAGELOAD_GC_MS, JS_PAGELOAD_PARSE_MS, JS_PAGELOAD_PROTECT_MS. r=mgaudet
...
Differential Revision: https://phabricator.services.mozilla.com/D253241
2025-06-12 01:08:39 +00:00
Fatih Kilic
8a0b62f360
Bug 1966691 - Set request mode for script loads r=necko-reviewers,tschuster,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D249808
2025-06-10 13:01:26 +00:00
Emilio Cobos Álvarez
48a6257583
Bug 1954293 - Remove privacy.partition.network_state. r=necko-reviewers,anti-tracking-reviewers,valentin,timhuang
...
It's been on for years, there's no point in keeping the old code-paths.
Differential Revision: https://phabricator.services.mozilla.com/D241760
2025-06-03 15:20:34 +00:00
Tooru Fujisawa
38456a9d25
Bug 1969895 - Do not try encoding JSON modules. r=nbp
...
Differential Revision: https://phabricator.services.mozilla.com/D252181
2025-06-02 16:40:51 +00:00
Tom Schuster
3f48655456
Bug 1967417 - Create a fallible LoadInfo factory. r=smaug,necko-reviewers,places-reviewers,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D250182
2025-05-21 15:21:52 +00:00
Serban Stanca
071240c3d9
Revert "Bug 1967417 - Create a fallible LoadInfo factory. r=smaug,necko-reviewers,places-reviewers,kershaw" for causing multiple failures.
...
This reverts commit b9a9491a35 .
2025-05-21 13:34:54 +00:00
Tom Schuster
b9a9491a35
Bug 1967417 - Create a fallible LoadInfo factory. r=smaug,necko-reviewers,places-reviewers,kershaw
...
Differential Revision: https://phabricator.services.mozilla.com/D250182
2025-05-21 12:24:10 +00:00
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
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
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
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
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
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
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
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