| Index: third_party/WebKit/Source/core/dom/Script.h
|
| diff --git a/third_party/WebKit/Source/core/dom/Script.h b/third_party/WebKit/Source/core/dom/Script.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..cd5ea6131f804b97d50c7f2940651e29a51a0ff3
|
| --- /dev/null
|
| +++ b/third_party/WebKit/Source/core/dom/Script.h
|
| @@ -0,0 +1,46 @@
|
| +// 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 Script_h
|
| +#define Script_h
|
| +
|
| +#include "core/CoreExport.h"
|
| +#include "platform/heap/Handle.h"
|
| +#include "platform/wtf/text/WTFString.h"
|
| +
|
| +namespace blink {
|
| +
|
| +class Document;
|
| +class LocalFrame;
|
| +class SecurityOrigin;
|
| +
|
| +enum class ScriptType { Classic, Module };
|
| +
|
| +// https://html.spec.whatwg.org/#concept-script
|
| +class CORE_EXPORT Script : public GarbageCollectedFinalized<Script> {
|
| + public:
|
| + DEFINE_INLINE_VIRTUAL_TRACE() {}
|
| + virtual ~Script() {}
|
| +
|
| + virtual ScriptType scriptType() const = 0;
|
| +
|
| + // Used to skip execution of the script if it is empty.
|
| + virtual bool isEmpty() const = 0;
|
| +
|
| + // Returns false if the script should not be run due to MIME type check.
|
| + virtual bool checkMIMETypeBeforeRunScript(Document* contextDocument,
|
| + const SecurityOrigin*) const = 0;
|
| +
|
| + // https://html.spec.whatwg.org/#run-a-classic-script or
|
| + // https://html.spec.whatwg.org/#run-a-module-script,
|
| + // depending on the script type.
|
| + virtual void runScript(LocalFrame*, const SecurityOrigin*) const = 0;
|
| +
|
| + // For CSP check for inline scripts.
|
| + virtual String inlineSourceTextForCSP() const = 0;
|
| +};
|
| +
|
| +} // namespace blink
|
| +
|
| +#endif
|
|
|