ES Modules: Specify "destination" for module loading
This CL passes the "destination"[1] parameter through module loaders. This enables workers/worklets to specify a unique destination defined in each spec. Before this CL, any module scripts are loaded with the "script" destination. After this CL, top-level and descendant module scripts for dedicated workers are loaded with the "worker" destination, top-level and descendant module scripts for documents and dynamic import() are still loaded with the "script" destination though. Module scripts for worklets also must be loaded with their own destination defined in each worklet spec (e.g., "paintworklet"), but such destinations haven't been added yet and the "script" destination is still used. Shared workers and service workers haven't supported module loading yet. Subsequent CLs will address them. Regarding detailed changes, this CL adds the "destination" parameters to components for module loading, stops ScriptResource overriding the "destination", and uses the given "destination" instead. Note that, in Chrome, WebURLRequest::RequestContext enum[2] represents the "destination". [1] https://fetch.spec.whatwg.org/#concept-request-destination [2] https://chromium.googlesource.com/chromium/src/+/a204023d46bc02634f1c6f164cae99d327d53b86/third_party/blink/public/platform/web_url_request.h#73 Bug: 842566 Change-Id: Ib777fcc28de62e1c348ef5c79f97079e5399abaf Reviewed-on: https://chromium-review.googlesource.com/1058734 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:Kinuko Yasuda <kinuko@chromium.org> Reviewed-by:
Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#559493}
Showing
Please register or sign in to comment