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 #ifndef ModuleScript_h | 5 #ifndef ModuleScript_h |
6 #define ModuleScript_h | 6 #define ModuleScript_h |
7 | 7 |
8 #include "bindings/core/v8/ScriptModule.h" | 8 #include "bindings/core/v8/ScriptModule.h" |
9 #include "bindings/core/v8/ScriptValue.h" | 9 #include "bindings/core/v8/ScriptValue.h" |
10 #include "bindings/core/v8/ScriptWrappable.h" | 10 #include "bindings/core/v8/ScriptWrappable.h" |
(...skipping 12 matching lines...) Expand all Loading... |
23 enum class ModuleInstantiationState { | 23 enum class ModuleInstantiationState { |
24 kUninstantiated, | 24 kUninstantiated, |
25 kErrored, | 25 kErrored, |
26 kInstantiated, | 26 kInstantiated, |
27 }; | 27 }; |
28 | 28 |
29 // ModuleScript is a model object for the "module script" spec concept. | 29 // ModuleScript is a model object for the "module script" spec concept. |
30 // https://html.spec.whatwg.org/multipage/webappapis.html#module-script | 30 // https://html.spec.whatwg.org/multipage/webappapis.html#module-script |
31 class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase { | 31 class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase { |
32 public: | 32 public: |
33 static ModuleScript* Create( | 33 // https://html.spec.whatwg.org/#creating-a-module-script |
| 34 static ModuleScript* Create(const String& source_text, |
| 35 Modulator*, |
| 36 const KURL& base_url, |
| 37 const String& nonce, |
| 38 ParserDisposition, |
| 39 WebURLRequest::FetchCredentialsMode, |
| 40 AccessControlStatus); |
| 41 |
| 42 static ModuleScript* CreateForTest( |
34 Modulator* settings_object, | 43 Modulator* settings_object, |
35 ScriptModule record, | 44 ScriptModule record, |
36 const KURL& base_url, | 45 const KURL& base_url, |
37 const String& nonce, | 46 const String& nonce, |
38 ParserDisposition parser_state, | 47 ParserDisposition parser_state, |
39 WebURLRequest::FetchCredentialsMode credentials_mode) { | 48 WebURLRequest::FetchCredentialsMode credentials_mode) { |
40 return new ModuleScript(settings_object, record, base_url, nonce, | 49 return new ModuleScript(settings_object, record, base_url, nonce, |
41 parser_state, credentials_mode); | 50 parser_state, credentials_mode); |
42 } | 51 } |
43 ~ModuleScript() override = default; | 52 ~ModuleScript() override = default; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-scrip
t-parser | 129 // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-scrip
t-parser |
121 const ParserDisposition parser_state_; | 130 const ParserDisposition parser_state_; |
122 | 131 |
123 // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-scrip
t-credentials-mode | 132 // https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-scrip
t-credentials-mode |
124 const WebURLRequest::FetchCredentialsMode credentials_mode_; | 133 const WebURLRequest::FetchCredentialsMode credentials_mode_; |
125 }; | 134 }; |
126 | 135 |
127 } // namespace blink | 136 } // namespace blink |
128 | 137 |
129 #endif | 138 #endif |
OLD | NEW |