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

Side by Side 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 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 ClassicScript_h
6 #define ClassicScript_h
7
8 #include "bindings/core/v8/ScriptSourceCode.h"
9 #include "core/CoreExport.h"
10 #include "core/dom/Script.h"
11
12 namespace blink {
13
14 class CORE_EXPORT ClassicScript final : public Script {
15 public:
16 static ClassicScript* Create(const ScriptSourceCode& script_source_code) {
17 return new ClassicScript(script_source_code);
18 }
19
20 DECLARE_TRACE();
21 DECLARE_TRACE_WRAPPERS();
22
23 const ScriptSourceCode& GetScriptSourceCode() const {
24 return script_source_code_;
25 }
26
27 private:
28 explicit ClassicScript(const ScriptSourceCode& script_source_code)
29 : script_source_code_(script_source_code) {}
30
31 ScriptType GetScriptType() const override { return ScriptType::kClassic; }
32 bool IsEmpty() const override;
33 bool CheckMIMETypeBeforeRunScript(Document* context_document,
34 const SecurityOrigin*) const override;
35 void RunScript(LocalFrame*, const SecurityOrigin*) const override;
36 String InlineSourceTextForCSP() const override {
37 return script_source_code_.Source();
38 }
39
40 const ScriptSourceCode script_source_code_;
41 };
42
43 } // namespace blink
44
45 #endif
OLDNEW
« 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