ModuleLoading: Clarify and restrict the usage of ModuleScriptFetcher
This CL adds util::PassKey<ModuleScriptLoader> to the arguments of ModuleScriptFetcher constructor. ModuleScriptFetcher is allowed to be called only from ModuleScriptLoader but currently it can be called from elsewhere as an implementation. To prohibit accessing from other classes, we use PassKey. PassKey value must be private, but we allow accessing this value from outside only for testing via ModuleScriptLoader::CreatePassKeyForTest(). Also, ModuleScriptFetcher::Fetch() must be called only once and this change clarifies this restriction as the comments. Change-Id: If284f4d5ff4ab21fe7f672ac98017d3835497889 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2071336Reviewed-by:Kouhei Ueno <kouhei@chromium.org> Reviewed-by:
Hiroki Nakagawa <nhiroki@chromium.org> Commit-Queue: Eriko Kurimoto <elkurin@google.com> Cr-Commit-Position: refs/heads/master@{#744968}
Showing
Please register or sign in to comment