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

Unified Diff: third_party/WebKit/Source/bindings/core/v8/ScriptModule.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/bindings/core/v8/ScriptModule.h
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
index 05a79624a86083b4f98b9957d456c71515c3fc09..2dccaa579cff111bd2fba500e00b489e8e2f5999 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptModule.h
@@ -77,8 +77,16 @@ class CORE_EXPORT ScriptModule final {
bool IsNull() const { return !module_ || module_->IsEmpty(); }
private:
+ // ModuleScript instances store their record as
+ // TraceWrapperV8Reference<v8::Module>, and reconstructs ScriptModule from it.
+ friend class ModuleScript;
+
ScriptModule(v8::Isolate*, v8::Local<v8::Module>);
+ v8::Local<v8::Module> NewLocal(v8::Isolate* isolate) {
+ return module_->NewLocal(isolate);
+ }
+
static v8::MaybeLocal<v8::Module> ResolveModuleCallback(
v8::Local<v8::Context>,
v8::Local<v8::String> specifier,

Powered by Google App Engine
This is Rietveld 408576698