Bug 232049 - Web Inspector: extension iframes leak when disabling an extension
Summary: Web Inspector: extension iframes leak when disabling an extension
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-20 15:11 PDT by BJ Burg
Modified: 2021-10-27 14:23 PDT (History)
7 users (show)

See Also:


Attachments
Patch v1.0 (2.94 KB, patch)
2021-10-21 11:17 PDT, BJ Burg
no flags Details | Formatted Diff | Diff
Patch v1.1 (3.00 KB, patch)
2021-10-26 13:42 PDT, BJ Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2021-10-20 15:11:41 PDT
D'oh.
Comment 1 Radar WebKit Bug Importer 2021-10-20 15:33:44 PDT
<rdar://problem/84482021>
Comment 2 BJ Burg 2021-10-21 11:17:49 PDT
Created attachment 442050 [details]
Patch v1.0
Comment 3 Devin Rousso 2021-10-21 11:30:39 PDT
Comment on attachment 442050 [details]
Patch v1.0

View in context: https://bugs.webkit.org/attachment.cgi?id=442050&action=review

> Source/WebInspectorUI/ChangeLog:9
> +        Since shouldNotRemoveFromDOMWhenHidden() is true, the <iframe> will not
> +        be detached and unload its document in the normal tab-closing code path.

This will still remove the `WI.View` from the parent `_subviews` even though the node wont be removed from the DOM, right?

Can we somehow confirm that removing an extension does in fact GC all the related objects?

> Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js:74
> +            tabContentView.dispose();

I would _strongly_ prefer that this be on `WI.WebInspectorExtensionTabContentView` instead of the more generic `WI.TabContentView` as the latter shouldn't ever need this mechanism (i.e. it should _always_ use `WI.View.prototype.removeSubview`)
Comment 4 BJ Burg 2021-10-21 12:19:34 PDT
Comment on attachment 442050 [details]
Patch v1.0

View in context: https://bugs.webkit.org/attachment.cgi?id=442050&action=review

>> Source/WebInspectorUI/UserInterface/Controllers/WebInspectorExtensionController.js:74
>> +            tabContentView.dispose();
> 
> I would _strongly_ prefer that this be on `WI.WebInspectorExtensionTabContentView` instead of the more generic `WI.TabContentView` as the latter shouldn't ever need this mechanism (i.e. it should _always_ use `WI.View.prototype.removeSubview`)

Oh, woops, wrong file :)(
Comment 5 BJ Burg 2021-10-26 13:42:58 PDT
Created attachment 442525 [details]
Patch v1.1
Comment 6 EWS 2021-10-27 14:23:50 PDT
Committed r284958 (243610@main): <https://commits.webkit.org/243610@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 442525 [details].