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

Unified Diff: third_party/WebKit/Source/core/dom/ClassicScript.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
« no previous file with comments | « third_party/WebKit/Source/core/dom/BUILD.gn ('k') | third_party/WebKit/Source/core/dom/ClassicScript.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ClassicScript.h
diff --git a/third_party/WebKit/Source/core/dom/ClassicScript.h b/third_party/WebKit/Source/core/dom/ClassicScript.h
new file mode 100644
index 0000000000000000000000000000000000000000..b8c36533e0c4563e5283a8515e72ae5fe181625a
--- /dev/null
+++ b/third_party/WebKit/Source/core/dom/ClassicScript.h
@@ -0,0 +1,45 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef ClassicScript_h
+#define ClassicScript_h
+
+#include "bindings/core/v8/ScriptSourceCode.h"
+#include "core/CoreExport.h"
+#include "core/dom/Script.h"
+
+namespace blink {
+
+class CORE_EXPORT ClassicScript final : public Script {
+ public:
+ static ClassicScript* Create(const ScriptSourceCode& script_source_code) {
+ return new ClassicScript(script_source_code);
+ }
+
+ DECLARE_TRACE();
+ DECLARE_TRACE_WRAPPERS();
+
+ const ScriptSourceCode& GetScriptSourceCode() const {
+ return script_source_code_;
+ }
+
+ private:
+ explicit ClassicScript(const ScriptSourceCode& script_source_code)
+ : script_source_code_(script_source_code) {}
+
+ ScriptType GetScriptType() const override { return ScriptType::kClassic; }
+ bool IsEmpty() const override;
+ bool CheckMIMETypeBeforeRunScript(Document* context_document,
+ const SecurityOrigin*) const override;
+ void RunScript(LocalFrame*, const SecurityOrigin*) const override;
+ String InlineSourceTextForCSP() const override {
+ return script_source_code_.Source();
+ }
+
+ const ScriptSourceCode script_source_code_;
+};
+
+} // namespace blink
+
+#endif
« no previous file with comments | « third_party/WebKit/Source/core/dom/BUILD.gn ('k') | third_party/WebKit/Source/core/dom/ClassicScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698