Index: third_party/WebKit/Source/core/dom/ModuleScript.h |
diff --git a/third_party/WebKit/Source/core/dom/ModuleScript.h b/third_party/WebKit/Source/core/dom/ModuleScript.h |
index 5efe745b3db767df8531fd460c6ba0047e8e33c9..6282d02a8706a9791e4728bdfb5190bcfda7bbb2 100644 |
--- a/third_party/WebKit/Source/core/dom/ModuleScript.h |
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.h |
@@ -6,6 +6,9 @@ |
#define ModuleScript_h |
#include "bindings/core/v8/ScriptModule.h" |
+#include "bindings/core/v8/ScriptValue.h" |
+#include "bindings/core/v8/ScriptWrappable.h" |
+#include "bindings/core/v8/TraceWrapperV8Reference.h" |
#include "core/CoreExport.h" |
#include "platform/heap/Handle.h" |
#include "platform/loader/fetch/ResourceLoaderOptions.h" |
@@ -24,7 +27,7 @@ enum class ModuleInstantiationState { |
// ModuleScript is a model object for the "module script" spec concept. |
// https://html.spec.whatwg.org/multipage/webappapis.html#module-script |
class CORE_EXPORT ModuleScript final |
- : public GarbageCollectedFinalized<ModuleScript> { |
+ : public GarbageCollectedFinalized<ModuleScript>, public TraceWrapperBase { |
public: |
static ModuleScript* create( |
ScriptModule record, |
@@ -41,17 +44,21 @@ class CORE_EXPORT ModuleScript final |
void clearRecord() { m_record = ScriptModule(); } |
const KURL& baseURL() const { return m_baseURL; } |
+ ModuleInstantiationState instantiationState() const { |
+ return m_instantiationState; |
+ } |
+ |
+ void setInstantiationSuccess(); |
+ void setInstantiationError(v8::Isolate* isolate, v8::Local<v8::Value> error); |
+ |
ParserDisposition parserState() const { return m_parserState; } |
WebURLRequest::FetchCredentialsMode credentialsMode() const { |
return m_credentialsMode; |
} |
const String& nonce() const { return m_nonce; } |
- ModuleInstantiationState instantiationState() const { |
- return m_instantiationState; |
- } |
- |
DECLARE_TRACE(); |
+ DECLARE_VIRTUAL_TRACE_WRAPPERS(); |
private: |
ModuleScript(ScriptModule record, |
@@ -61,6 +68,7 @@ class CORE_EXPORT ModuleScript final |
WebURLRequest::FetchCredentialsMode credentialsMode) |
: m_record(record), |
m_baseURL(baseURL), |
+ m_instantiationError(this), |
m_nonce(nonce), |
m_parserState(parserState), |
m_credentialsMode(credentialsMode) {} |
@@ -81,7 +89,7 @@ class CORE_EXPORT ModuleScript final |
ModuleInstantiationState::Uninstantiated; |
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-instantiation-error |
- // TODO(kouhei): Add a corresponding member. |
+ TraceWrapperV8Reference<v8::Value> m_instantiationError; |
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-nonce |
const String m_nonce; |