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 |