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

Side by Side Diff: third_party/WebKit/Source/core/dom/Script.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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef Script_h
6 #define Script_h
7
8 #include "bindings/core/v8/ScriptWrappable.h"
9 #include "core/CoreExport.h"
10 #include "platform/heap/Handle.h"
11 #include "platform/wtf/text/WTFString.h"
12
13 namespace blink {
14
15 class Document;
16 class LocalFrame;
17 class SecurityOrigin;
18
19 enum class ScriptType { kClassic, kModule };
20
21 // https://html.spec.whatwg.org/#concept-script
22 class CORE_EXPORT Script : public GarbageCollectedFinalized<Script>,
23 public TraceWrapperBase {
24 public:
25 DEFINE_INLINE_VIRTUAL_TRACE() {}
26 DEFINE_INLINE_VIRTUAL_TRACE_WRAPPERS() {}
27
28 virtual ~Script() {}
29
30 virtual ScriptType GetScriptType() const = 0;
31
32 // Used to skip execution of the script if it is empty.
33 virtual bool IsEmpty() const = 0;
34
35 // Returns false if the script should not be run due to MIME type check.
36 virtual bool CheckMIMETypeBeforeRunScript(Document* context_document,
37 const SecurityOrigin*) const = 0;
38
39 // https://html.spec.whatwg.org/#run-a-classic-script or
40 // https://html.spec.whatwg.org/#run-a-module-script,
41 // depending on the script type.
42 virtual void RunScript(LocalFrame*, const SecurityOrigin*) const = 0;
43
44 // For CSP check for inline scripts.
45 virtual String InlineSourceTextForCSP() const = 0;
46 };
47
48 } // namespace blink
49
50 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/PendingScript.cpp ('k') | third_party/WebKit/Source/core/dom/ScriptLoader.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698