Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Unified Diff: third_party/WebKit/Source/core/dom/ModuleScript.h

Issue 2820533003: Make Script non-TraceWrapperBase and add a comment about ModuleScript tracing (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 6624f60570f11c3ef51329963a50025e81dfed92..dbe6db95b273d80b695eead1b5b8557685ac66c5 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.h
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.h
@@ -27,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 Script {
+class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
public:
static ModuleScript* Create(
ScriptModule record,
@@ -58,7 +58,7 @@ class CORE_EXPORT ModuleScript final : public Script {
const String& Nonce() const { return nonce_; }
DECLARE_TRACE();
- DECLARE_VIRTUAL_TRACE_WRAPPERS();
+ DECLARE_TRACE_WRAPPERS();
private:
ModuleScript(ScriptModule record,
@@ -96,6 +96,13 @@ class CORE_EXPORT ModuleScript final : public Script {
ModuleInstantiationState::kUninstantiated;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-instantiation-error
+ //
+ // |instantiation_error_| is TraceWrappers()ed and kept alive via the path of
+ // v8::Context -> PerContextData -> Modulator/ModulatorImpl
+ // -> ModuleMap -> ModuleMap::Entry -> ModuleScript -> instantiation_error_.
+ // All the classes/references on the path above should be
+ // TraceWrapperBase/TraceWrapperMember<>/etc.,
+ // but other references to those classes can be normal Member<>.
TraceWrapperV8Reference<v8::Value> instantiation_error_;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-nonce
« no previous file with comments | « third_party/WebKit/Source/core/dom/ClassicScript.cpp ('k') | third_party/WebKit/Source/core/dom/ModuleScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698