OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "core/dom/ClassicScript.h" | 5 #include "core/dom/ClassicScript.h" |
6 | 6 |
7 #include "bindings/core/v8/ScriptController.h" | 7 #include "bindings/core/v8/ScriptController.h" |
8 #include "core/dom/Document.h" | 8 #include "core/dom/Document.h" |
9 #include "core/frame/LocalFrame.h" | 9 #include "core/frame/LocalFrame.h" |
10 #include "core/frame/UseCounter.h" | 10 #include "core/frame/UseCounter.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 UseCounter::Count(frame, feature); | 44 UseCounter::Count(frame, feature); |
45 } | 45 } |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 DEFINE_TRACE(ClassicScript) { | 49 DEFINE_TRACE(ClassicScript) { |
50 Script::Trace(visitor); | 50 Script::Trace(visitor); |
51 visitor->Trace(script_source_code_); | 51 visitor->Trace(script_source_code_); |
52 } | 52 } |
53 | 53 |
54 DEFINE_TRACE_WRAPPERS(ClassicScript) { | |
55 Script::TraceWrappers(visitor); | |
56 } | |
57 | |
58 bool ClassicScript::IsEmpty() const { | 54 bool ClassicScript::IsEmpty() const { |
59 return GetScriptSourceCode().IsEmpty(); | 55 return GetScriptSourceCode().IsEmpty(); |
60 } | 56 } |
61 | 57 |
62 bool ClassicScript::CheckMIMETypeBeforeRunScript( | 58 bool ClassicScript::CheckMIMETypeBeforeRunScript( |
63 Document* context_document, | 59 Document* context_document, |
64 const SecurityOrigin* security_origin) const { | 60 const SecurityOrigin* security_origin) const { |
65 ScriptResource* resource = GetScriptSourceCode().GetResource(); | 61 ScriptResource* resource = GetScriptSourceCode().GetResource(); |
66 CHECK(resource); | 62 CHECK(resource); |
67 | 63 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 access_control_status = | 109 access_control_status = |
114 GetScriptSourceCode().GetResource()->CalculateAccessControlStatus( | 110 GetScriptSourceCode().GetResource()->CalculateAccessControlStatus( |
115 security_origin); | 111 security_origin); |
116 } | 112 } |
117 | 113 |
118 frame->GetScriptController().ExecuteScriptInMainWorld(GetScriptSourceCode(), | 114 frame->GetScriptController().ExecuteScriptInMainWorld(GetScriptSourceCode(), |
119 access_control_status); | 115 access_control_status); |
120 } | 116 } |
121 | 117 |
122 } // namespace blink | 118 } // namespace blink |
OLD | NEW |