ES Modules: Separate ModuleScriptFetcher for Documents and Worklets
This is a cleanup CL and doesn't change behavior except LAPIs support (see below). Before this CL, ModuleScriptFetcher is an implementation of module script fetch for <script type='module'> on Documents, and WorkletModuleScriptFetcher is a subclass of ModuleScriptFetcher that implements the custom fetch hook for Worklets. This override reduces code duplication, but also makes it difficult to read code. After this CL, ModuleScriptFetcher becomes just an interface. DocumentModuleScriptFetcher implements it for Documents, and WorkletModuleScriptFetcher implements it for Worklets. This separation makes it easier to read code and to add a new variant of ModuleScriptFetcher for Workers, there're some duplicate code among DocumentModuleScriptFetcher and WorkletModuleScriptFetcher though. Note that this CL tentatively drops LAPIs support for worklets. This is safe because it has been flagged feature and not ready for worklets so far. We'll re-add the support after refactoring around ModuleScriptFetcher. Change-Id: I60fa46ebd86e046da811f018219cdd02411529a8 Bug: 842553 Reviewed-on: https://chromium-review.googlesource.com/1096919 Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:Kouhei Ueno <kouhei@chromium.org> Reviewed-by:
Hiroshige Hayashizaki <hiroshige@chromium.org> Cr-Commit-Position: refs/heads/master@{#566760}
Showing
Please register or sign in to comment