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

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

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.h
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.h b/third_party/WebKit/Source/core/dom/ModuleScript.h
index 5ac8f9fff98fe2ab20909e10c2c2a5d643e68d7f..a491757610293e0831e0aa27afd9f0d2cc12b42a 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.h
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.h
@@ -47,7 +47,7 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
ParserDisposition parser_state,
WebURLRequest::FetchCredentialsMode credentials_mode) {
return new ModuleScript(settings_object, record, base_url, nonce,
- parser_state, credentials_mode);
+ parser_state, credentials_mode, "");
kouhei (in TOK) 2017/04/27 03:47:25 note to self: "" is source_text
hiroshige 2017/04/27 21:57:20 Done.
}
~ModuleScript() override = default;
@@ -84,14 +84,16 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
const KURL& base_url,
const String& nonce,
ParserDisposition parser_state,
- WebURLRequest::FetchCredentialsMode credentials_mode)
+ WebURLRequest::FetchCredentialsMode credentials_mode,
+ const String& source_text)
: settings_object_(settings_object),
record_(record),
base_url_(base_url),
instantiation_error_(this),
nonce_(nonce),
parser_state_(parser_state),
- credentials_mode_(credentials_mode) {}
+ credentials_mode_(credentials_mode),
+ source_text_(source_text) {}
ScriptType GetScriptType() const override { return ScriptType::kModule; }
bool IsEmpty() const override;
@@ -131,6 +133,9 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-credentials-mode
const WebURLRequest::FetchCredentialsMode credentials_mode_;
+
+ // For CSP check.
+ const String source_text_;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698