Get import assertions from v8::ModuleRequest and add them to blink::ModuleRequest
This is the first in a series of changes that will implement import assertions integration in Blink and tie the assertions into the existing JSON and CSS module prototypes. See the import assertions spec [1], the HTML integration PR [2], and the I2P [3]. This change retrieves the import assertions from V8 in ModuleRequest::ModuleRequests and in the ResolveModuleCallback. The code to unpack them is moved inside blink::ModuleRequest to avoid code duplication across those two places. ModuleRequest is upgraded from a struct to a class now that its constructors are no longer trivial. ModuleRequest is passed to ModuleRecordResolver::Resolve in place of the specifier, where the import assertions will eventually be used alongside the specifier to resolve the module. IsolateHolder now passes "type" as a supported assertion via V8 Isolate::CreateParams so that Blink will start receiving module "type" assertions. Subsequent changes will add the assertions to the module map key and require the correct assertion to be present before a JSON or CSS module can be successfully loaded. [1] https://tc39.es/proposal-import-assertions [2] https://github.com/whatwg/html/pull/5883 [3] https://groups.google.com/u/1/a/chromium.org/g/blink-dev/c/Xft04J07Oh0/m/RLPMXVEiAAAJ Bug: 1132413 Change-Id: Id41e9e470d3c4ed1988d8dfa1ef8fa26cd9d23a9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2597778 Commit-Queue: Dan Clark <daniec@microsoft.com> Reviewed-by:Kouhei Ueno <kouhei@chromium.org> Reviewed-by:
Jochen Eisinger <jochen@chromium.org> Reviewed-by:
Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by:
Dominic Farolino <dom@chromium.org> Cr-Commit-Position: refs/heads/master@{#839060}
Showing
Please register or sign in to comment