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

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

Issue 2780463002: Introduce blink::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 e30308ac9a6fbfaa6812164d62315f0b426d1d3c..6624f60570f11c3ef51329963a50025e81dfed92 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.h
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.h
@@ -10,6 +10,7 @@
#include "bindings/core/v8/ScriptWrappable.h"
#include "bindings/core/v8/TraceWrapperV8Reference.h"
#include "core/CoreExport.h"
+#include "core/dom/Script.h"
#include "platform/heap/Handle.h"
#include "platform/loader/fetch/ResourceLoaderOptions.h"
#include "platform/weborigin/KURL.h"
@@ -26,9 +27,7 @@ enum class ModuleInstantiationState {
// ModuleScript is a model object for the "module script" spec concept.
// https://html.spec.whatwg.org/multipage/webappapis.html#module-script
-class CORE_EXPORT ModuleScript final
- : public GarbageCollectedFinalized<ModuleScript>,
- public TraceWrapperBase {
+class CORE_EXPORT ModuleScript final : public Script {
public:
static ModuleScript* Create(
ScriptModule record,
@@ -39,7 +38,7 @@ class CORE_EXPORT ModuleScript final
return new ModuleScript(record, base_url, nonce, parser_state,
credentials_mode);
}
- ~ModuleScript() = default;
+ ~ModuleScript() override = default;
ScriptModule& Record() { return record_; }
void ClearRecord() { record_ = ScriptModule(); }
@@ -74,6 +73,13 @@ class CORE_EXPORT ModuleScript final
parser_state_(parser_state),
credentials_mode_(credentials_mode) {}
+ ScriptType GetScriptType() const override { return ScriptType::kModule; }
+ bool IsEmpty() const override;
+ bool CheckMIMETypeBeforeRunScript(Document* context_document,
+ const SecurityOrigin*) const override;
+ void RunScript(LocalFrame*, const SecurityOrigin*) const override;
+ String InlineSourceTextForCSP() const override;
+
// Note: A "module script"'s "setttings object" is ommitted, as we currently
// always have access to the corresponding Modulator when operating on a
// ModuleScript instance.
« no previous file with comments | « third_party/WebKit/Source/core/dom/ClassicScript.cpp ('k') | third_party/WebKit/Source/core/dom/ModuleScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698