| 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..a7cb01272b954d802710e94c731968e4d0bc4886
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/dom/ClassicScript.h
|
| @@ -0,0 +1,47 @@
|
| +// 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& scriptSourceCode) {
|
| + return new ClassicScript(scriptSourceCode);
|
| + }
|
| +
|
| + DEFINE_INLINE_TRACE() {
|
| + Script::trace(visitor);
|
| + visitor->trace(m_scriptSourceCode);
|
| + }
|
| +
|
| + const ScriptSourceCode& scriptSourceCode() const {
|
| + return m_scriptSourceCode;
|
| + }
|
| +
|
| + private:
|
| + explicit ClassicScript(const ScriptSourceCode& scriptSourceCode)
|
| + : m_scriptSourceCode(scriptSourceCode) {}
|
| +
|
| + ScriptType scriptType() const override { return ScriptType::Classic; }
|
| + bool isEmpty() const override;
|
| + bool checkMIMETypeBeforeRunScript(Document* contextDocument,
|
| + const SecurityOrigin*) const override;
|
| + void runScript(LocalFrame*, const SecurityOrigin*) const override;
|
| + String inlineSourceTextForCSP() const override {
|
| + return m_scriptSourceCode.source();
|
| + }
|
| +
|
| + const ScriptSourceCode m_scriptSourceCode;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif
|
|
|