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
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
Bryan Thrall
c04c306a9f
Bug 1724236 - Pass debugger parameters as arguments instead of members r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218454
2024-10-30 13:41:45 +00:00
Bryan Thrall
dd1514b033
Bug 1724236 - Move Decode to ScriptLoader r=arai
...
ScriptLoader is the only place that calls it, and inlining it made the call
site too hard to follow.
Differential Revision: https://phabricator.services.mozilla.com/D218453
2024-10-30 13:41:45 +00:00
Bryan Thrall
6f37de74e2
Bug 1724236 - Inline Compile(JS::SourceText) r=arai
...
The remaining Compile(nsAString) could be inlined as well, but it is only used
in nsJSThunk::EvaluateScript and WindowScriptTimeoutHandler::Call. Right now,
I'm just focusing on use by ScriptLoader.
Differential Revision: https://phabricator.services.mozilla.com/D218452
2024-10-30 13:41:44 +00:00
Bryan Thrall
8e00518582
Bug 1724236 - Inline ExecScript and move ExecScriptAndCoerceString to where it is used r=arai
...
ExecScript returning a value was only used in one place, and that call always
coerced the return value to a string.
Differential Revision: https://phabricator.services.mozilla.com/D218451
2024-10-30 13:41:44 +00:00
Bryan Thrall
e859d8b8d0
Bug 1724236 - Move Compile and Decode out of JSExecutionContext r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218450
2024-10-30 13:41:44 +00:00
Bryan Thrall
b9d1574361
Bug 1724236 - Move stencil duplication out of JoinOffThread, Decode, Compile r=arai
...
In InstantiateClassicScriptFromMaybeEncodedSource(), I need to use a local
ErrorResult because calling `aRv.NoteJSContextException(aCx)` must be followed
by an immediate return, but that would avoid adding the compile time to
mMainThreadParseTime.
Differential Revision: https://phabricator.services.mozilla.com/D222301
2024-10-30 13:41:43 +00:00
Bryan Thrall
38fb4a0034
Bug 1724236 - Move InstantiateStencil call out of JoinOffThread r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D225361
2024-10-30 13:41:43 +00:00
Bryan Thrall
e6436b95c3
Bug 1724236 - Move InstantiateStencil out of Compile and Decode r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218449
2024-10-30 13:41:42 +00:00
Bryan Thrall
ffd49dfc27
Bug 1724236 - Move ExecScript out of JSExecutionContext r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218448
2024-10-30 13:41:42 +00:00
Bryan Thrall
930e0cf266
Bug 1724236 - Pass cx as function argument instead of member r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218447
2024-10-30 13:41:42 +00:00
Bryan Thrall
c9529870d4
Bug 1724236 - Pass script as function argument instead of member r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218446
2024-10-30 13:41:41 +00:00
Bryan Thrall
54137eb0a0
Bug 1724236 - Check options directly if script wants return value r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218445
2024-10-30 13:41:41 +00:00
Bryan Thrall
2f6237583a
Bug 1724236 - Move profiler label and JSAutoRealm out of JSExecutionContext r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218444
2024-10-30 13:41:40 +00:00
Bryan Thrall
2a63e2261f
Bug 1724236 - Get encodeBytecode and coerceToString from function arguments instead of members r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218443
2024-10-30 13:41:40 +00:00
Bryan Thrall
b6fd76662b
Bug 1724236 - Get CompileOptions from function arguments instead of member r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D218442
2024-10-30 13:41:40 +00:00
Bryan Thrall
190d6b921b
Bug 1724236 - Simplify error handling via ErrorResult r=arai
...
Differential Revision: https://phabricator.services.mozilla.com/D224548
2024-10-30 13:41:39 +00:00
Bryan Thrall
79ae9289a9
Bug 1724236 - Move error tracking to JSExecutionContext callers r=arai
...
Using ErrorResult should go away by the end of the patch stack for this bug.
I needed to use some failure error code to indicate when
xpc::Scriptability::Allowed() failed so that callers can skip further use of
JSExecutionContext, and also return NS_OK. NS_ERROR_DOM_NOT_ALLOWED_ERR seemed
a reasonable choice, but it is temporary.
ExecScript(aRetValue) is only called by nsJSThunk::EvaluateScript(), which
initializes the JS::Value parameter to JS::Undefined. You can see in the caller
that it will still be JS::Undefined if any errors happen through use of
JSExecutionContext. Therefore, setting the value to JS::Undefined if `mSkip` at
the beginning of ExecScript() isn't needed any more.
We need to leave any exception on the JSContext for AutoJSAPI to handle, or
those exceptions won't propagate properly. For example, tests like
testing/mochitest/tests/Harness_sanity/test_sanityException.html will fail.
Differential Revision: https://phabricator.services.mozilla.com/D218441
2024-10-30 13:41:39 +00:00
Tooru Fujisawa
4cdfcf314d
Bug 1915626 - Part 3: Cache HTTP response headers for the JS. r=bthrall
...
Differential Revision: https://phabricator.services.mozilla.com/D223967
2024-10-08 11:38:07 +00:00
Tooru Fujisawa
84727f2cc6
Bug 1916635 - Part 1: Create PerformanceResourceTiming entry for SharedScriptCache. r=bthrall
...
Differential Revision: https://phabricator.services.mozilla.com/D223357
2024-10-01 12:17:26 +00:00
Tooru Fujisawa
2081de56bb
Bug 1916635 - Part 0: Fix the assertion around the cached request with a stencil. r=bthrall
...
Differential Revision: https://phabricator.services.mozilla.com/D223980
2024-10-01 12:17:26 +00:00
Valentin Gosu
533ec6637b
Bug 1900561 - Set nsIClassOfService::fetchPriority where callers use nsISupportsPriority.adjustPriority r=acreskey
...
Differential Revision: https://phabricator.services.mozilla.com/D221958
2024-09-25 18:42:52 +00:00
Butkovits Atila
e6ce34045f
Backed out 3 changesets (bug 1900561, bug 1919158) for causing bustages at ipc_message_utils.h. CLOSED TREE
...
Backed out changeset a2a4a88ef8d1 (bug 1919158)
Backed out changeset ecb590690d2e (bug 1900561)
Backed out changeset ef92a69ff2d1 (bug 1900561)
2024-09-24 18:58:08 +03:00
Valentin Gosu
ebbb22fc8b
Bug 1900561 - Set nsIClassOfService::fetchPriority where callers use nsISupportsPriority.adjustPriority r=acreskey
...
Depends on D221957
Differential Revision: https://phabricator.services.mozilla.com/D221958
2024-09-24 12:29:08 +00:00
Tooru Fujisawa
e0f0fc0ca5
Bug 1916960 - Part 10: Trigger notification for the cached script load. r=bthrall
...
Differential Revision: https://phabricator.services.mozilla.com/D222452
2024-09-24 08:05:54 +00:00
Iulian Moraru
1e7ea75f9b
Backed out 2 changesets (bug 1900561) for causing windows build bustages. CLOSED TREE
...
Backed out changeset 474e1a3ab5f0 (bug 1900561)
Backed out changeset 7a0bb5fa195e (bug 1900561)
2024-09-19 14:52:47 +03:00
Valentin Gosu
86dd18c852
Bug 1900561 - Set nsIClassOfService::fetchPriority where callers use nsISupportsPriority.adjustPriority r=acreskey
...
Differential Revision: https://phabricator.services.mozilla.com/D221958
2024-09-19 10:24:22 +00:00
Olli Pettay
a420032817
Bug 1917389, make it less likely to run non-parser-blocking scripts while there is parser blocking script pending, r=hsivonen
...
Differential Revision: https://phabricator.services.mozilla.com/D222220
2024-09-17 15:50:34 +00:00
Jonatan Klemets
4d18cba1b0
Bug 1877792 - Part 16: Disable off-thread compilaton for JSON modules r=spidermonkey-reviewers,jonco
...
This is something we may want to investigate and implement, but it felt out of
scope for the initial implementation.
Differential Revision: https://phabricator.services.mozilla.com/D218563
2024-09-03 08:10:54 +00:00
Jonatan Klemets
5bb3af7ad5
Bug 1877792 - Part 11: Only allow expected mime types r=dom-worker-reviewers,asuth
...
Differential Revision: https://phabricator.services.mozilla.com/D218558
2024-09-03 08:10:52 +00:00
Cristina Horotan
a842adb0d9
Backed out 20 changesets (bug 1877792) for causing wpt failures at importscripts_mime_local.any.sharedworker.html CLOSED TREE
...
Backed out changeset 19d78d0b6ee4 (bug 1877792)
Backed out changeset 14f104e5ce51 (bug 1877792)
Backed out changeset 662eb52b2a6f (bug 1877792)
Backed out changeset 48dc4035a14f (bug 1877792)
Backed out changeset d98ecddf2f59 (bug 1877792)
Backed out changeset 1234a31ff88f (bug 1877792)
Backed out changeset a3b5b0cde6ce (bug 1877792)
Backed out changeset a1f494b9592a (bug 1877792)
Backed out changeset a4d7565218f3 (bug 1877792)
Backed out changeset fe179004423b (bug 1877792)
Backed out changeset 39a20aee3942 (bug 1877792)
Backed out changeset 95b20763e650 (bug 1877792)
Backed out changeset d763241fccaf (bug 1877792)
Backed out changeset 0674cf646120 (bug 1877792)
Backed out changeset bd23c96418b6 (bug 1877792)
Backed out changeset 5b1e29e4c597 (bug 1877792)
Backed out changeset 3cead4149e6b (bug 1877792)
Backed out changeset d73a9f57f03c (bug 1877792)
Backed out changeset 82a58a80f58a (bug 1877792)
Backed out changeset 4c7182604e4f (bug 1877792)
2024-08-22 19:23:15 +03:00
Jonatan Klemets
72a54fd53e
Bug 1877792 - Part 16: Disable off-thread compilaton for JSON modules r=spidermonkey-reviewers,jonco
...
This is something we may want to investigate and implement, but it felt out of
scope for the initial implementation.
Differential Revision: https://phabricator.services.mozilla.com/D218563
2024-08-22 14:21:54 +00:00