[Layered API] Implement origin trials: BuiltInModuleKvStorage
This CL adds origin_trial_feature_name to - "BuiltInModuleInfra" - "BuiltInModuleKvStorage" While "BuiltInModuleInfra" origin trial is not needed for end users, this is needed in terms of implementation, because "BuiltInModuleInfra" should be enabled if "BuiltInModuleKvStorage" is enabled, and thus "BuiltInModuleInfra" flag should also depend on origin trials. By adding origin_trial_feature_name to "BuiltInModuleInfra", origin_trials::BuiltInModuleInfraEnabled() takes care of the dependency. As origin trials requires ExecutionContext, this CL associates built-in module feature control with Modulator, by introducing - Modulator::BuiltInModuleInfraEnabled() - Modulator::BuiltInModuleEnabled() This CL plumbs Modulator via ModuleScriptFetcher::Fetch() and ImportMap, to plumb Modulator::BuiltInModule*Enabled() to layered_api.cc. It seems a little confusing that ModuleScriptFetcher takes both Modulator and ResourceFetcher that refer module map settings object and fetch client settings object, respectively. This is actually consistent, because built-in modules are associated with module map settings object and the current implementation of import maps is also associated with Modulator (crbug/928435), while fetching should refer to fetch client settings object. This apparent inconsistency should be resolved by - Fixing Issue 928435, or - Enabling Built-in modules by default (which will remove dependencies to ExecutionContext/Modulator again), or - Refactoring ModuleScriptFetcher. This CL implements individual control over built-in modules in ModulatorImplBase::BuiltInModuleEnabled(). After this CL, - "BuiltInModuleKvStorage" enables "kv-storage" and "blank" only, and - "BuiltInModuleInfra" flag enables "blank" only, while they enabled all built-in modules before this CL. Bug: 829084, 928435 Change-Id: I0ee2838c0981192e9a993cb784bc39d866682836 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1497468 Commit-Queue: Hiroshige Hayashizaki <hiroshige@chromium.org> Reviewed-by:Kouhei Ueno <kouhei@chromium.org> Cr-Commit-Position: refs/heads/master@{#638289}
Showing
Please register or sign in to comment