| 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/loader/modulescript/ModuleScriptLoader.h" | 5 #include "core/loader/modulescript/ModuleScriptLoader.h" |
| 6 | 6 |
| 7 #include "core/dom/Modulator.h" | 7 #include "core/dom/Modulator.h" |
| 8 #include "core/dom/ModuleScript.h" | 8 #include "core/dom/ModuleScript.h" |
| 9 #include "core/loader/modulescript/ModuleScriptLoaderClient.h" | 9 #include "core/loader/modulescript/ModuleScriptLoaderClient.h" |
| 10 #include "core/loader/modulescript/ModuleScriptLoaderRegistry.h" | 10 #include "core/loader/modulescript/ModuleScriptLoaderRegistry.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // wasModuleLoadSuccessful(). | 191 // wasModuleLoadSuccessful(). |
| 192 // Step 7. If any of the following conditions are met, set moduleMap[url] to | 192 // Step 7. If any of the following conditions are met, set moduleMap[url] to |
| 193 // null, asynchronously complete this algorithm with null, and abort these | 193 // null, asynchronously complete this algorithm with null, and abort these |
| 194 // steps. | 194 // steps. |
| 195 if (!WasModuleLoadSuccessful(GetResource())) { | 195 if (!WasModuleLoadSuccessful(GetResource())) { |
| 196 AdvanceState(State::kFinished); | 196 AdvanceState(State::kFinished); |
| 197 return; | 197 return; |
| 198 } | 198 } |
| 199 | 199 |
| 200 // Step 8. Let source text be the result of UTF-8 decoding response's body. | 200 // Step 8. Let source text be the result of UTF-8 decoding response's body. |
| 201 String source_text = GetResource()->Script(); | 201 String source_text = GetResource()->SourceText(); |
| 202 | 202 |
| 203 AccessControlStatus access_control_status = | 203 AccessControlStatus access_control_status = |
| 204 GetResource()->CalculateAccessControlStatus( | 204 GetResource()->CalculateAccessControlStatus( |
| 205 modulator_->GetSecurityOrigin()); | 205 modulator_->GetSecurityOrigin()); |
| 206 | 206 |
| 207 // Step 9. Let module script be the result of creating a module script given | 207 // Step 9. Let module script be the result of creating a module script given |
| 208 // source text, module map settings object, response's url, cryptographic | 208 // source text, module map settings object, response's url, cryptographic |
| 209 // nonce, parser state, and credentials mode. | 209 // nonce, parser state, and credentials mode. |
| 210 module_script_ = CreateModuleScript( | 210 module_script_ = CreateModuleScript( |
| 211 source_text, GetResource()->GetResponse().Url(), modulator_, nonce_, | 211 source_text, GetResource()->GetResponse().Url(), modulator_, nonce_, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 DEFINE_TRACE(ModuleScriptLoader) { | 251 DEFINE_TRACE(ModuleScriptLoader) { |
| 252 visitor->Trace(modulator_); | 252 visitor->Trace(modulator_); |
| 253 visitor->Trace(module_script_); | 253 visitor->Trace(module_script_); |
| 254 visitor->Trace(registry_); | 254 visitor->Trace(registry_); |
| 255 visitor->Trace(client_); | 255 visitor->Trace(client_); |
| 256 ResourceOwner<ScriptResource>::Trace(visitor); | 256 ResourceOwner<ScriptResource>::Trace(visitor); |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace blink | 259 } // namespace blink |
| OLD | NEW |