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

Issue 2903813002: [ES6 modules] Fix context leak. ModuleScript should use TraceWrapperV8Reference to hold onto v8::Mo… (Closed)

Created:
3 years, 7 months ago by kouhei (in TOK)
Modified:
3 years, 7 months ago
CC:
chromium-reviews, sof, eae+blinkwatch, blink-reviews-dom_chromium.org, dglazkov+blink, blink-reviews-bindings_chromium.org, blink-reviews, rwlbuis
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[ES6 modules] Fix context leak. ModuleScript should use TraceWrapperV8Reference to hold onto v8::Module. Before this CL, ModuleScript referenced v8::Module via SharedPersistent<> in ScriptModule. This created cycle of v8::Context -> V8PerContextData -> Modulator -> ModuleMap -> ModuleScript -(persistent)-> v8::Module -> v8::Context. This CL breaks the cycle (partially) by making ModuleScript use TraceWrapperV8Reference to reference v8::Module, and create ScriptModule on the fly. More CLs will follow to break other parts of the cycle graph. BUG=594639, 725816 Review-Url: https://codereview.chromium.org/2903813002 Cr-Commit-Position: refs/heads/master@{#474543} Committed: https://chromium.googlesource.com/chromium/src/+/7fa31ddf3b196d9873d615e7aabe4285fed4cef8

Patch Set 1 #

Patch Set 2 : expected.txt #

Total comments: 2

Patch Set 3 : testfix #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -13 lines) Patch
A third_party/WebKit/LayoutTests/fast/dom/script-module-with-export-leak.html View 1 chunk +9 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/dom/script-module-with-export-leak-expected.txt View 1 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptModule.h View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/bindings/core/v8/ScriptModule.cpp View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/Modulator.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ModulatorImpl.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ModuleScript.h View 3 chunks +3 lines, -11 lines 0 comments Download
M third_party/WebKit/Source/core/dom/ModuleScript.cpp View 1 2 3 chunks +40 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/dom/ScriptModuleResolverImplTest.cpp View 1 2 4 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/modulescript/ModuleScriptLoaderTest.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/modulescript/ModuleTreeLinkerTest.cpp View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/DummyModulator.h View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/testing/DummyModulator.cpp View 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 20 (12 generated)
kouhei (in TOK)
3 years, 7 months ago (2017-05-24 08:22:35 UTC) #5
haraken
LGTM https://codereview.chromium.org/2903813002/diff/20001/third_party/WebKit/Source/core/dom/ModuleScript.h File third_party/WebKit/Source/core/dom/ModuleScript.h (left): https://codereview.chromium.org/2903813002/diff/20001/third_party/WebKit/Source/core/dom/ModuleScript.h#oldcode128 third_party/WebKit/Source/core/dom/ModuleScript.h:128: ScriptModule record_; Is there any other place that ...
3 years, 7 months ago (2017-05-24 09:28:12 UTC) #8
yhirano
lgtm
3 years, 7 months ago (2017-05-24 10:15:28 UTC) #11
Michael Lippautz
LGTM
3 years, 7 months ago (2017-05-24 10:42:21 UTC) #12
kinuko
whoa. lgtm
3 years, 7 months ago (2017-05-24 10:45:05 UTC) #13
kouhei (in TOK)
https://codereview.chromium.org/2903813002/diff/20001/third_party/WebKit/Source/core/dom/ModuleScript.h File third_party/WebKit/Source/core/dom/ModuleScript.h (left): https://codereview.chromium.org/2903813002/diff/20001/third_party/WebKit/Source/core/dom/ModuleScript.h#oldcode128 third_party/WebKit/Source/core/dom/ModuleScript.h:128: ScriptModule record_; On 2017/05/24 09:28:12, haraken wrote: > > ...
3 years, 7 months ago (2017-05-24 13:06:36 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2903813002/40001
3 years, 7 months ago (2017-05-25 01:45:00 UTC) #17
commit-bot: I haz the power
3 years, 7 months ago (2017-05-25 03:33:36 UTC) #20
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as
https://chromium.googlesource.com/chromium/src/+/7fa31ddf3b196d9873d615e7aabe...

Powered by Google App Engine
This is Rietveld 408576698