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

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

Issue 2903813002: [ES6 modules] Fix context leak. ModuleScript should use TraceWrapperV8Reference to hold onto v8::Mo… (Closed)
Patch Set: testfix Created 3 years, 7 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 76e42e8c1b7ac184eef3e0777b1db62752499abc..2f4bbbcd7fa79a9e93253d48153140d80dc17893 100644
--- a/third_party/WebKit/Source/core/dom/ModuleScript.h
+++ b/third_party/WebKit/Source/core/dom/ModuleScript.h
@@ -53,7 +53,7 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
~ModuleScript() override = default;
- const ScriptModule& Record() const { return record_; }
+ ScriptModule Record() const;
const KURL& BaseURL() const { return base_url_; }
ModuleInstantiationState InstantiationState() const {
@@ -87,15 +87,7 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
const String& nonce,
ParserDisposition parser_state,
WebURLRequest::FetchCredentialsMode credentials_mode,
- const String& source_text)
- : settings_object_(settings_object),
- record_(record),
- base_url_(base_url),
- instantiation_error_(this),
- nonce_(nonce),
- parser_state_(parser_state),
- credentials_mode_(credentials_mode),
- source_text_(source_text) {}
+ const String& source_text);
static ModuleScript* CreateInternal(const String& source_text,
Modulator*,
@@ -125,7 +117,7 @@ class CORE_EXPORT ModuleScript final : public Script, public TraceWrapperBase {
Member<Modulator> settings_object_;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-module-record
- ScriptModule record_;
+ TraceWrapperV8Reference<v8::Module> record_;
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-module-script-base-url
const KURL base_url_;
« no previous file with comments | « third_party/WebKit/Source/core/dom/ModulatorImpl.h ('k') | third_party/WebKit/Source/core/dom/ModuleScript.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698