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/ModulatorImpl.h" | 5 #include "core/dom/ModulatorImpl.h" |
6 | 6 |
7 #include "core/dom/ExecutionContext.h" | 7 #include "core/dom/ExecutionContext.h" |
8 #include "core/dom/ModuleMap.h" | 8 #include "core/dom/ModuleMap.h" |
9 #include "core/dom/ModuleScript.h" | 9 #include "core/dom/ModuleScript.h" |
10 #include "core/dom/ScriptModuleResolverImpl.h" | 10 #include "core/dom/ScriptModuleResolverImpl.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 // https://crbug.com/715376 | 104 // https://crbug.com/715376 |
105 CHECK(RuntimeEnabledFeatures::moduleScriptsEnabled()); | 105 CHECK(RuntimeEnabledFeatures::moduleScriptsEnabled()); |
106 | 106 |
107 loader_registry_->Fetch(request, level, this, fetcher_.Get(), client); | 107 loader_registry_->Fetch(request, level, this, fetcher_.Get(), client); |
108 } | 108 } |
109 | 109 |
110 ModuleScript* ModulatorImpl::GetFetchedModuleScript(const KURL& url) { | 110 ModuleScript* ModulatorImpl::GetFetchedModuleScript(const KURL& url) { |
111 return map_->GetFetchedModuleScript(url); | 111 return map_->GetFetchedModuleScript(url); |
112 } | 112 } |
113 | 113 |
114 bool ModulatorImpl::IsContextValid() { | |
neis
2017/05/16 09:10:55
Could you rename this to ContextIsValid (for consi
kouhei (in TOK)
2017/05/16 17:52:34
Done.
| |
115 return script_state_->ContextIsValid(); | |
116 } | |
117 | |
114 ScriptModule ModulatorImpl::CompileModule( | 118 ScriptModule ModulatorImpl::CompileModule( |
115 const String& provided_source, | 119 const String& provided_source, |
116 const String& url_str, | 120 const String& url_str, |
117 AccessControlStatus access_control_status) { | 121 AccessControlStatus access_control_status) { |
118 // Implements Steps 3-6 of | 122 // Implements Steps 3-6 of |
119 // https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-module-sc ript | 123 // https://html.spec.whatwg.org/multipage/webappapis.html#creating-a-module-sc ript |
120 | 124 |
121 // Step 3. Let realm be the provided environment settings object's Realm. | 125 // Step 3. Let realm be the provided environment settings object's Realm. |
122 // Note: Realm is v8::Context. | 126 // Note: Realm is v8::Context. |
123 | 127 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
214 visitor->Trace(loader_registry_); | 218 visitor->Trace(loader_registry_); |
215 visitor->Trace(tree_linker_registry_); | 219 visitor->Trace(tree_linker_registry_); |
216 visitor->Trace(script_module_resolver_); | 220 visitor->Trace(script_module_resolver_); |
217 } | 221 } |
218 | 222 |
219 DEFINE_TRACE_WRAPPERS(ModulatorImpl) { | 223 DEFINE_TRACE_WRAPPERS(ModulatorImpl) { |
220 visitor->TraceWrappers(map_); | 224 visitor->TraceWrappers(map_); |
221 } | 225 } |
222 | 226 |
223 } // namespace blink | 227 } // namespace blink |
OLD | NEW |