Commit graph

68 commits

Author SHA1 Message Date
Manuel Bucher
14dd2f26fc Bug 1761242 - Expose computing security flags for early hint preloader r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D144798
2022-06-15 09:59:44 +00:00
Molnar Sandor
1fc858a96d Backed out 5 changesets (bug 1761242, bug 1744822, bug 1761252) for causing browser-chrome failures in netwerk/test/browser/browser_103_assets.js CLOSED TREE
Backed out changeset 33cc08eb51b3 (bug 1744822)
Backed out changeset b70697d24e75 (bug 1761252)
Backed out changeset 4a5e10110c6a (bug 1761242)
Backed out changeset 7cda175b833d (bug 1761242)
Backed out changeset 4f5ed111093b (bug 1761242)
2022-06-08 18:56:35 +03:00
Manuel Bucher
35abf46688 Bug 1761242 - Expose computing security flags for early hint preloader r=ckerschb,smaug
Differential Revision: https://phabricator.services.mozilla.com/D144798
2022-06-08 14:33:10 +00:00
Yoshi Cheng-Hao Huang
bf4ad5ae3e Bug 1688879 - Part 6: Acquiring import maps. r=jonco,yulia
Implement https://wicg.github.io/import-maps/#document-acquiring-import-maps

Differential Revision: https://phabricator.services.mozilla.com/D142074
2022-05-05 21:19:02 +00:00
Butkovits Atila
fb9f362af3 Backed out 11 changesets (bug 1688879) for causing build bustages. CLOSED TREE
Backed out changeset 350ddd17c7f5 (bug 1688879)
Backed out changeset 27984b95ed20 (bug 1688879)
Backed out changeset 6a5bb063965f (bug 1688879)
Backed out changeset d8edcfdb504b (bug 1688879)
Backed out changeset 77ab231310ec (bug 1688879)
Backed out changeset c2bce95a1aca (bug 1688879)
Backed out changeset f5862572ced8 (bug 1688879)
Backed out changeset 05e0a1bf32fc (bug 1688879)
Backed out changeset adeab05b7419 (bug 1688879)
Backed out changeset 0e60834e17e5 (bug 1688879)
Backed out changeset 877bb4c2ce66 (bug 1688879)
2022-05-05 19:52:05 +03:00
Yoshi Cheng-Hao Huang
2cff7e6f2a Bug 1688879 - Part 6: Acquiring import maps. r=jonco,yulia
Implement https://wicg.github.io/import-maps/#document-acquiring-import-maps

Differential Revision: https://phabricator.services.mozilla.com/D142074
2022-05-05 16:03:17 +00:00
Narcis Beleuzu
a92a200e76 Backed out 9 changesets (bug 1688879) for bustages on ImportMap.cpp
Backed out changeset 44e9abe72a5e (bug 1688879)
Backed out changeset 0503d2d2ae01 (bug 1688879)
Backed out changeset 2cf08a51b184 (bug 1688879)
Backed out changeset 6f0276c3ab0e (bug 1688879)
Backed out changeset f16b14d8f677 (bug 1688879)
Backed out changeset 03b772e02d07 (bug 1688879)
Backed out changeset 39ed48a5ecc2 (bug 1688879)
Backed out changeset d7b42d8312bb (bug 1688879)
Backed out changeset 5e695bf5dd0d (bug 1688879)
2022-05-05 03:41:31 +03:00
Yoshi Cheng-Hao Huang
5abb2d6785 Bug 1688879 - Part 6: Acquiring import maps. r=jonco,yulia
Implement https://wicg.github.io/import-maps/#document-acquiring-import-maps

Differential Revision: https://phabricator.services.mozilla.com/D142074
2022-05-04 21:02:51 +00:00
Jon Coppeard
77609d6143 Bug 1766274 - Part 3: Rename CompileOrFinishModuleScript to CompileFetchedModule r=yulia
I was less sure of this one, but I think 'finish' is confusing here. Better names welcome.

Depends on D144597

Differential Revision: https://phabricator.services.mozilla.com/D144599
2022-04-26 12:40:48 +00:00
Jon Coppeard
f8a095fc91 Bug 1766274 - Part 2: Rename ProcessLoadedModuleTree to OnModuleLoadComplete r=yulia
Depends on D144596

Differential Revision: https://phabricator.services.mozilla.com/D144597
2022-04-26 12:40:47 +00:00
Jon Coppeard
1aeb55dd59 Bug 1766276 - Give MaybeOneOf a map method r=jandem
There are a few places where we call one of two overloads of a fuction based on
the contents of a MaybeOneOf. We can simplify this code by giving the class a
map method.

Differential Revision: https://phabricator.services.mozilla.com/D144595
2022-04-26 12:29:24 +00:00
Yulia Startsev
a996a1aca2 Bug 1763372 - Rename GetLoadContext to GetScriptLoadContext; r=jonco
Depends on D143068

Differential Revision: https://phabricator.services.mozilla.com/D143037
2022-04-22 13:24:10 +00:00
Yulia Startsev
9c4d96a57d Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-21 09:53:33 +00:00
criss
1a5e600ac1 Backed out 4 changesets (bug 1763586) for causing mochitest failures on test_Debugger.Source.prototype.elementAttribute.html. CLOSED TREE
Backed out changeset 8da9574159d3 (bug 1763586)
Backed out changeset 8f964a9e2f31 (bug 1763586)
Backed out changeset 420105516ec3 (bug 1763586)
Backed out changeset 68cd444d018e (bug 1763586)
2022-04-19 16:28:30 +03:00
Yulia Startsev
edce198b19 Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-19 12:28:48 +00:00
Iulian Moraru
2844dc6b1f Backed out 3 changesets (bug 1763586) for causing mochitest-chrome failures on test_Debugger.Source.prototype.element.html.
Backed out changeset f6b6ccfce3d1 (bug 1763586)
Backed out changeset ca0157c919a9 (bug 1763586)
Backed out changeset e0294a6f9f9f (bug 1763586)
2022-04-13 21:53:34 +03:00
Yulia Startsev
dce170ffad Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-13 16:29:36 +00:00
Marian-Vasile Laza
05a897ed46 Backed out 3 changesets (bug 1763586) foar causing sm bustages. CLOSED TREE
Backed out changeset 02a961432a49 (bug 1763586)
Backed out changeset 3fc84237decb (bug 1763586)
Backed out changeset 365eff56ce0f (bug 1763586)
2022-04-12 09:49:21 -07:00
Yulia Startsev
37530c6fda Bug 1763586 - Adjust ScriptFetchOptions to be more accurate; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143137
2022-04-12 16:16:31 +00:00
Jon Coppeard
8907766025 Bug 1761938 - Part 6: Remove global from script load context r=smaug,yulia
This removes the global object field from the script load context and gets the
global from the script loader / module loader where necessary.

Differential Revision: https://phabricator.services.mozilla.com/D142833
2022-04-11 15:35:30 +00:00
Jon Coppeard
d4aae71cf3 Bug 1761938 - Part 4: Give module loaders a global object field r=smaug,yulia
This gives the module loader a field for the current global, since a module map
is only associated with a single global.

This adds a method to Document to tell the script loader when its global
changes. I'm not sure of when we do this exactly.

Differential Revision: https://phabricator.services.mozilla.com/D142831
2022-04-11 15:35:29 +00:00
Jon Coppeard
88d0d67d61 Bug 1761938 - Part 2: Give each web extension content script global its own module loader r=smaug,yulia
This gives the DOM module loader a kind and records content script module
loaders in an array on the script loader.

Differential Revision: https://phabricator.services.mozilla.com/D142829
2022-04-11 15:35:28 +00:00
Butkovits Atila
c40fc96827 Merge mozilla-central to autoland. CLOSED TREE 2022-03-29 00:52:16 +03:00
Butkovits Atila
570f6e5c06 Merge autoland to mozilla-central. a=merge 2022-03-29 00:33:50 +03:00
Jon Coppeard
9d8474b374 Bug 1759881 - Part 10: Move the generic parts of the StartLoad method to the module loader base r=yulia
StartModuleLoadImpl moves to the base class and uses to new virtual methods
CanStartLoad and StartFetch which are implemented by the derived class.

Differential Revision: https://phabricator.services.mozilla.com/D141736
2022-03-28 15:56:10 +00:00
Jon Coppeard
7045acf305 Bug 1759881 - Part 9: Move module loading hooks into the generic module loader r=yulia
Now we can move the JS engine integration hooks into the generic module loader.

There is still some code there to deal with web extension globals. This will be
removed in a later patch.

Differential Revision: https://phabricator.services.mozilla.com/D141735
2022-03-28 12:38:28 +00:00
Jon Coppeard
eb0afeffa3 Bug 1759881 - Part 8: Add a virtual method to create a module load request for a dynamic import r=yulia
This adds a new virtual to the module loader base, along the same lines as the
one to create a load request for a static import. This makes the
HostImportModuleDynamically hook generic.

Differential Revision: https://phabricator.services.mozilla.com/D141734
2022-03-28 12:38:28 +00:00
Jon Coppeard
050bae2fd0 Bug 1759881 - Part 7: Add a virtual method to get the module loader to use for the current global r=yulia,smaug
This adds a virtual method to  nsIGlobalObject and implements it for
nsGlobalWindowInner and SandboxPrivate. This means we don't have to put the
logic for dealing with all the different kinds of globals in once place.

Differential Revision: https://phabricator.services.mozilla.com/D141733
2022-03-28 12:38:27 +00:00
Jon Coppeard
075e630cb9 Bug 1761432 - Part 4: Rename state accessor methods after the enum values r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D142044
2022-03-25 10:54:17 +00:00
Jon Coppeard
38f12fcc0d Bug 1759881 - Part 1: Make list of dynamic import requests private r=yulia
This restricts access to mDynamicImportRequests and adds the appropriate accessors.

Differential Revision: https://phabricator.services.mozilla.com/D141248
2022-03-17 15:22:16 +00:00
Tooru Fujisawa
141090b932 Bug 1436400 - Part 10: Support bytecode cache for module script. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D140297
2022-03-15 19:05:57 +00:00
Tooru Fujisawa
82b9ddf3a3 Bug 1436400 - Part 9: Support restarting module load request. r=jonco
After enabling bytecode cache for module script, we need to handle
the SRI mismatch on bytecode cache, that requires reloading the script source
again.

Differential Revision: https://phabricator.services.mozilla.com/D140551
2022-03-15 19:05:57 +00:00
Tooru Fujisawa
c963262d5c Bug 1436400 - Part 8: Add code path for bytecode encoding module scripts. r=nbp
The module scripts are scanned immediately before executing, and if the
module script is not yet executed, and it matches the requirement for encoding
(size, fetch count, etc), it's marked as encode,
and they're scanned again immediately after executing, and marked scripts are
queued for bytecode encoding.

This patch doesn't actually enable the encoding, given ShouldCacheBytecode
returns false because the caching is not enabled for the channel and
GetCacheTokenFetchCount fails.

Differential Revision: https://phabricator.services.mozilla.com/D140296
2022-03-15 19:05:56 +00:00
Tooru Fujisawa
c6920683db Bug 1436400 - Part 3: Remove nsJSUtils::CompileModule and directly use JSAPI with stencil. r=nbp
To add conditional JS::StartIncrementalEncoding, and also to add a bytecode
decoding branch, replace nsJSUtils::CompileModule with raw JSAPI calls with
Stencil.

Differential Revision: https://phabricator.services.mozilla.com/D140291
2022-03-15 19:05:54 +00:00
Tooru Fujisawa
6b3236dc9e Bug 1436400 - Part 2: Simplify ModuleLoader::CompileOrFinishModuleScript code flow. r=jonco
As a preparation to add bytecode case to CompileOrFinishModuleScript, removed
the shared nsresult variable and make each branch directly return, and also
do early return for error case.

Differential Revision: https://phabricator.services.mozilla.com/D140290
2022-03-15 19:05:54 +00:00
Csoregi Natalia
6ae31a2e64 Backed out 15 changesets (bug 1757597, bug 1436400) for causing mochitest failures on test_bug1656248.html. CLOSED TREE
Backed out changeset 4be29c1eb5bc (bug 1436400)
Backed out changeset ffd9ddcef6b0 (bug 1436400)
Backed out changeset 5ac844508d8b (bug 1436400)
Backed out changeset 561aeb550892 (bug 1436400)
Backed out changeset 6f473bcf809a (bug 1436400)
Backed out changeset c33620854115 (bug 1436400)
Backed out changeset 8f894ea40eb2 (bug 1436400)
Backed out changeset cce080064d82 (bug 1436400)
Backed out changeset 001d8528ff96 (bug 1436400)
Backed out changeset dd2bb1b46f75 (bug 1436400)
Backed out changeset b1c2084042fa (bug 1436400)
Backed out changeset dd0fea93bcd7 (bug 1436400)
Backed out changeset e38a959648e1 (bug 1436400)
Backed out changeset 40b474d430e9 (bug 1436400)
Backed out changeset 5bef21ef1ba2 (bug 1757597)
2022-03-15 07:23:29 +02:00
Tooru Fujisawa
d09fb8acd5 Bug 1436400 - Part 10: Support bytecode cache for module script. r=nbp
Differential Revision: https://phabricator.services.mozilla.com/D140297
2022-03-15 04:24:52 +00:00
Tooru Fujisawa
4d4aa8001e Bug 1436400 - Part 9: Support restarting module load request. r=jonco
After enabling bytecode cache for module script, we need to handle
the SRI mismatch on bytecode cache, that requires reloading the script source
again.

Differential Revision: https://phabricator.services.mozilla.com/D140551
2022-03-15 04:24:52 +00:00
Tooru Fujisawa
bd3852013b Bug 1436400 - Part 8: Add code path for bytecode encoding module scripts. r=nbp
The module scripts are scanned immediately before executing, and if the
module script is not yet executed, and it matches the requirement for encoding
(size, fetch count, etc), it's marked as encode,
and they're scanned again immediately after executing, and marked scripts are
queued for bytecode encoding.

This patch doesn't actually enable the encoding, given ShouldCacheBytecode
returns false because the caching is not enabled for the channel and
GetCacheTokenFetchCount fails.

Differential Revision: https://phabricator.services.mozilla.com/D140296
2022-03-15 04:24:51 +00:00
Tooru Fujisawa
aaeb81d7b9 Bug 1436400 - Part 3: Remove nsJSUtils::CompileModule and directly use JSAPI with stencil. r=nbp
To add conditional JS::StartIncrementalEncoding, and also to add a bytecode
decoding branch, replace nsJSUtils::CompileModule with raw JSAPI calls with
Stencil.

Differential Revision: https://phabricator.services.mozilla.com/D140291
2022-03-15 04:24:49 +00:00
Tooru Fujisawa
518074add7 Bug 1436400 - Part 2: Simplify ModuleLoader::CompileOrFinishModuleScript code flow. r=jonco
As a preparation to add bytecode case to CompileOrFinishModuleScript, removed
the shared nsresult variable and make each branch directly return, and also
do early return for error case.

Differential Revision: https://phabricator.services.mozilla.com/D140290
2022-03-15 04:24:49 +00:00
Yulia Startsev
760e6f9232 Bug 1756550 - propagate webext global to all dynamically imported modules; r=jonco
The crashes were occurring due to the missing webext global on dynamically imported modules from a referencing script. There is likely a more elegant way to reintroduce this, but for now this is a quick fix.

Differential Revision: https://phabricator.services.mozilla.com/D139511
2022-02-24 12:25:25 +00:00
Yulia Startsev
79409316d1 Bug 1742437 - re-scope all generic module/script loader files under js/loader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D138133
2022-02-21 15:39:09 +00:00
Yulia Startsev
7ee758a2f5 Bug 1742437 - move DOM script context into own file and rename it; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D138132
2022-02-21 15:39:08 +00:00
Yulia Startsev
65b14f6546 Bug 1742437 - move DOM module loader into own file; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137531
2022-02-21 15:39:08 +00:00
Yulia Startsev
720155230b Bug 1742437 - Create DOM specific Module Loader; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137298
2022-02-21 15:39:07 +00:00
Yulia Startsev
3bf222c5c4 Bug 1742437 - move mWebExtGlobal from ScriptLoadRequest to DOMScriptLoadContext; r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D136744
2022-02-21 15:39:06 +00:00
Yulia Startsev
f1640d290a Bug 1742437 - move mElement from ScriptFetchOptions to DOMScriptLoadContext; r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D136742
2022-02-21 15:39:05 +00:00
Yulia Startsev
7ded97bc1a Bug 1742437 - Split ScriptLoadRequest into ScriptLoadRequest and DOMScriptLoadContext; r=jonco,smaug
Differential Revision: https://phabricator.services.mozilla.com/D134041
2022-02-21 15:39:04 +00:00
Norisz Fay
4c85ac47c5 Backed out 12 changesets (bug 1742437) for causing Bp-hybrid bustages on ModuleLoader.obj
Backed out changeset 7d5683180ac3 (bug 1742437)
Backed out changeset a48aff5f2555 (bug 1742437)
Backed out changeset 7e54a223001d (bug 1742437)
Backed out changeset 3a34d557d474 (bug 1742437)
Backed out changeset f29451ea18dc (bug 1742437)
Backed out changeset c0bd1d29be62 (bug 1742437)
Backed out changeset 8b970fb6e4e6 (bug 1742437)
Backed out changeset 729c48e34d6b (bug 1742437)
Backed out changeset 9355004c7f6a (bug 1742437)
Backed out changeset 0a5f61274aed (bug 1742437)
Backed out changeset a50f60a612d3 (bug 1742437)
Backed out changeset 0ac6d9d26e2b (bug 1742437)
2022-02-18 00:00:41 +02:00