Граф коммитов

105 Коммитов

Автор SHA1 Сообщение Дата
Jon Coppeard ce9567cdac Bug 1767829 - Part 3: Add the option for derived module loaders to specifiy their own event target r=yulia
Module loaders require an event target to use with mozPromise. The default uses
the event loop so doesn't permit implementing a synchronous module loader.

Differential Revision: https://phabricator.services.mozilla.com/D145490
2022-05-09 11:06:25 +00:00
Yoshi Cheng-Hao Huang 8a939e5954 Bug 1688879 - Part 5: ResolveModuleSpecifier for import maps. r=jonco,yulia,flod
Implement https://wicg.github.io/import-maps/#resolve-a-module-specifier

Differential Revision: https://phabricator.services.mozilla.com/D142072
2022-05-05 21:19:02 +00:00
Yoshi Cheng-Hao Huang 7ba3206f1c Bug 1688879 - Part 4: Refactor ResolveModuleSpecifier. r=jonco,yulia
Add ResolveResult to return nsIURI on success or return ResolveError on
failure.

Differential Revision: https://phabricator.services.mozilla.com/D142073
2022-05-05 21:19:02 +00:00
Yoshi Cheng-Hao Huang 464384bf31 Bug 1688879 - Part 3: Parse and register an import map. r=jonco,yulia
Implement
https://wicg.github.io/import-maps/#parse-an-import-map-string,
and
https://wicg.github.io/import-maps/#register-an-import-map

Differential Revision: https://phabricator.services.mozilla.com/D142071
2022-05-05 21:19:01 +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 098e1668c8 Bug 1688879 - Part 5: ResolveModuleSpecifier for import maps. r=jonco,yulia,flod
Implement https://wicg.github.io/import-maps/#resolve-a-module-specifier

Differential Revision: https://phabricator.services.mozilla.com/D142072
2022-05-05 16:03:17 +00:00
Yoshi Cheng-Hao Huang 1b35f68535 Bug 1688879 - Part 4: Refactor ResolveModuleSpecifier. r=jonco,yulia
Add ResolveResult to return nsIURI on success or return ResolveError on
failure.

Differential Revision: https://phabricator.services.mozilla.com/D142073
2022-05-05 16:03:17 +00:00
Yoshi Cheng-Hao Huang 48be9bcaa2 Bug 1688879 - Part 3: Parse and register an import map. r=jonco,yulia
Implement
https://wicg.github.io/import-maps/#parse-an-import-map-string,
and
https://wicg.github.io/import-maps/#register-an-import-map

Differential Revision: https://phabricator.services.mozilla.com/D142071
2022-05-05 16:03:16 +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 45ae7f8cf1 Bug 1688879 - Part 5: ResolveModuleSpecifier for import maps. r=jonco,yulia,flod
Implement https://wicg.github.io/import-maps/#resolve-a-module-specifier

Differential Revision: https://phabricator.services.mozilla.com/D142072
2022-05-04 21:02:51 +00:00
Yoshi Cheng-Hao Huang b5def10f13 Bug 1688879 - Part 4: Refactor ResolveModuleSpecifier. r=jonco,yulia
Add ResolveResult to return nsIURI on success or return ResolveError on
failure.

Differential Revision: https://phabricator.services.mozilla.com/D142073
2022-05-04 21:02:51 +00:00
Yoshi Cheng-Hao Huang d9207c7020 Bug 1688879 - Part 3: Parse and register an import map. r=jonco,yulia
Implement
https://wicg.github.io/import-maps/#parse-an-import-map-string,
and
https://wicg.github.io/import-maps/#register-an-import-map

Differential Revision: https://phabricator.services.mozilla.com/D142071
2022-05-04 21:02:50 +00:00
Jon Coppeard 5d525af423 Bug 1766274 - Part 4: Change references to module trees to module graphs r=yulia
Module imports can be cyclic so it's more correct to refer to them as graphs.
The spec also uses this term.

Depends on D144599

Differential Revision: https://phabricator.services.mozilla.com/D144600
2022-04-26 12:40:48 +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 7e3e0ea7fd Bug 1766274 - Part 1: Rename ProcessFetchedModuleSource to OnFetchComplete and pass an error code r=yulia
This renames the method to correspond to StartFetch and adds a status argument
so clients can call this rather than
SetModuleFetchFinishedAndResumeWaitingRequests on error.

Depends on D144595

Differential Revision: https://phabricator.services.mozilla.com/D144596
2022-04-26 12:40:47 +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 604a6aa077 Bug 1763372 - address new issues in the hybrid build; r=jonco
Depends on D143036

Differential Revision: https://phabricator.services.mozilla.com/D143068
2022-04-22 13:24:10 +00:00
Yulia Startsev 7b6ada3766 Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-21 09:53:34 +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 0190773604 Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-19 12:28:49 +00: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 2b9e84ae6c Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-13 16:29:36 +00: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 ea5e3cbf1d Bug 1763586 - Remove Element from LoadScript and child classes; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D143139
2022-04-12 16:16:32 +00: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 3b308851b4 Bug 1761938 - Part 5: Use module loader's global where possible and remove GetGlobalForRequest from script loader interface r=yulia
Differential Revision: https://phabricator.services.mozilla.com/D142832
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 79f031217b Bug 1761938 - Part 3: Remove global from the module map key and use URI only r=yulia
Since content scripts have separate module loaders there's no need to key the
module map on the global any more.

Differential Revision: https://phabricator.services.mozilla.com/D142830
2022-04-11 15:35:29 +00:00
Jon Coppeard 461cd542e9 Bug 1761938 - Part 1: Call into the module loader via the module load request object r=yulia
The script loader will need to deal with requests from more than one module
loader so this adds methods to the request which dispatch to the correct
loader.

Differential Revision: https://phabricator.services.mozilla.com/D142828
2022-04-11 15:35:28 +00:00
Jon Coppeard 091044bdaf Bug 1761938 - Part 0: Make ModuleLoaderBase::ResolveModuleSpecifier an instance method r=yulia
Tidyup.  There's no reason for this to be static if it takes a pointer to the instance.

Differential Revision: https://phabricator.services.mozilla.com/D142827
2022-04-11 15:35:27 +00: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 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 880347ab90 Bug 1761432 - Part 1: Rename ScriptLoadRequest progress enum to 'State' r=smaug
This also renames 'loading' enum values to 'fetching' since this is more
specific. Loading covers the whole process of loading, which includes the other
states.

Enum values have the leading 'e' removed in line with the coding style for enum
classes.

Differential Revision: https://phabricator.services.mozilla.com/D142041
2022-03-25 10:54:16 +00:00
Jon Coppeard b5550b5f9f Bug 1759881 - Part 6: Remove use of nsJSUtils layer for module instantiation and evaluation r=smaug
This layer doesn't add much above calling into the JS engine and it's DOM
specific so let's remove it.

Differential Revision: https://phabricator.services.mozilla.com/D141253
2022-03-17 15:22:18 +00:00
Jon Coppeard 54129e0662 Bug 1759881 - Part 5: Remove microtask checkpoints from the module loader in couple of places r=smaug
This removes the microtask checkpoint when instantiating modules and moves the
one when creating a module script to the the script loader.

Differential Revision: https://phabricator.services.mozilla.com/D141252
2022-03-17 15:22:18 +00:00
Jon Coppeard da0e34487e Bug 1759881 - Part 4: Remove use of AutoEntryScript when parsing module source r=smaug
I'm not sure why this was there because this can't run script.

Depends on D141250

Differential Revision: https://phabricator.services.mozilla.com/D141251
2022-03-17 15:22:17 +00:00
Jon Coppeard 3570cedee9 Bug 1759881 - Part 3: Don't pass a global to FillCompileOptionsForRequest r=yulia
This can work it out if it needs it by calling GetGlobalForRequest.

Depends on D141249

Differential Revision: https://phabricator.services.mozilla.com/D141250
2022-03-17 15:22: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
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
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 401faea928 Bug 1742437 - Move module loader files into a central folder; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137532
2022-02-21 15:39:08 +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
Yulia Startsev 499559431e 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-17 15:57:52 +00:00
Yulia Startsev 77471489aa Bug 1742437 - Move module loader files into a central folder; r=jonco
Differential Revision: https://phabricator.services.mozilla.com/D137532
2022-02-17 15:57:52 +00:00