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

Unified Diff: third_party/WebKit/Source/core/dom/ModuleScript.cpp

Issue 2842923002: Support Inline module script (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/dom/ModuleScript.cpp
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.cpp b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
index b62c0ecabc0564066fb34fb82cbe8a78e772a44f..bf50bd8194900b500ab71e50394b169f401be880 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.cpp
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.cpp
@@ -38,8 +38,9 @@ ModuleScript* ModuleScript::Create(
// 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.
+ // [not specced] |source_text| is saved for CSP checks.
return new ModuleScript(modulator, result, base_url, nonce, parser_state,
- credentials_mode);
+ credentials_mode, source_text);
}
void ModuleScript::SetInstantiationErrorAndClearRecord(ScriptValue error) {
@@ -97,10 +98,7 @@ void ModuleScript::RunScript(LocalFrame* frame, const SecurityOrigin*) const {
}
String ModuleScript::InlineSourceTextForCSP() const {
- // Currently we don't support inline module scripts.
- // TODO(hiroshige): Implement this.
- NOTREACHED();
- return String();
+ return source_text_;
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698