Summary: | DOMWindow properties may get GC'd before their Window object | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
Component: | Bindings | Assignee: | Chris Dumez <cdumez> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, commit-queue, darin, ggaren, rniwa, webkit-bug-importer, youennf | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=200436 | ||||||||
Bug Depends on: | |||||||||
Bug Blocks: | 199517 | ||||||||
Attachments: |
|
Description
Chris Dumez
2019-08-01 14:22:58 PDT
Created attachment 375345 [details]
Patch
Comment on attachment 375345 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=375345&action=review > Source/WebCore/bindings/scripts/CodeGeneratorJS.pm:4683 > + } elsif (GetGenerateIsReachable($interface) eq "ImplWindow") { Can we use more sensible names like ReachableFromDOMWindow? I really hate these Impl*. It doesn't explain what it does at all. > LayoutTests/fast/dom/dom-window-property-gc-after-frame-detach.html:13 > + w = document.getElementById("testFrame").contentWindow; Nit: Please don't use one letter variable like w. > LayoutTests/fast/dom/dom-window-property-gc-after-frame-detach.html:14 > + for (let p of window_properties) Dito for p. Also use camelCase? > LayoutTests/fast/dom/dom-window-property-gc-after-frame-detach.html:17 > + for (let p of window_properties) Ditto. > LayoutTests/fast/dom/dom-window-property-gc-after-frame-detach.html:26 > + for (let p of window_properties) Ditto. Created attachment 375410 [details]
Patch
Comment on attachment 375410 [details] Patch Clearing flags on attachment: 375410 Committed r248155: <https://trac.webkit.org/changeset/248155> All reviewed patches have been landed. Closing bug. Is there any case where using ImplFrame is correct, now? (In reply to Darin Adler from comment #7) > Is there any case where using ImplFrame is correct, now? It is only used by Geolocation now. navigator.geolocation never returns null (e.g. when the frame is detached), so I do not think it makes sense to tie to lifetime of its wrapper to the frame. We should tie it to the Window instead. I'll follow-up. |