Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(700)

Unified Diff: third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp

Issue 2845743003: Move "create a module script" from ModuleScriptLoader to ModuleScript (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
diff --git a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
index 97e66fc5f059fdbfd1fb61301854a115c1a27b84..e6d6844b3ebafedb65aff9c52415c08e67ae9a66 100644
--- a/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoader.cpp
@@ -207,8 +207,8 @@ void ModuleScriptLoader::NotifyFinished(Resource*) {
// Step 9. Let module script be the result of creating a module script given
// source text, module map settings object, response's url, cryptographic
// nonce, parser state, and credentials mode.
- module_script_ = CreateModuleScript(
- source_text, GetResource()->GetResponse().Url(), modulator_, nonce_,
+ module_script_ = ModuleScript::Create(
+ source_text, modulator_, GetResource()->GetResponse().Url(), nonce_,
parser_state_,
GetResource()->GetResourceRequest().GetFetchCredentialsMode(),
access_control_status);
@@ -216,38 +216,6 @@ void ModuleScriptLoader::NotifyFinished(Resource*) {
AdvanceState(State::kFinished);
}
-// https://html.spec.whatwg.org/#creating-a-module-script
-ModuleScript* ModuleScriptLoader::CreateModuleScript(
- const String& source_text,
- const KURL& url,
- Modulator* modulator,
- const String& nonce,
- ParserDisposition parser_state,
- WebURLRequest::FetchCredentialsMode credentials_mode,
- AccessControlStatus access_control_status) {
- // Step 1. Let script be a new module script that this algorithm will
- // subsequently initialize.
- // Step 2. Set script's settings object to the environment settings object
- // provided.
- // Note: "script's settings object" will be "modulator".
-
- // Delegate to Modulator::compileModule to process Steps 3-6.
- ScriptModule result = modulator->CompileModule(source_text, url.GetString(),
- access_control_status);
- // Step 6: "...return null, and abort these steps."
- if (result.IsNull())
- return nullptr;
- // Step 7. Set script's module record to result.
- // Step 8. Set script's base URL to the script base URL provided.
- // Step 9. Set script's cryptographic nonce to the cryptographic nonce
- // provided.
- // Step 10. Set script's parser state to the parser state.
- // Step 11. Set script's credentials mode to the credentials mode provided.
- // Step 12. Return script.
- return ModuleScript::Create(modulator, result, url, nonce, parser_state,
- credentials_mode);
-}
-
DEFINE_TRACE(ModuleScriptLoader) {
visitor->Trace(modulator_);
visitor->Trace(module_script_);

Powered by Google App Engine
This is Rietveld 408576698