[webkit-reviews] review granted: [Bug 221988] REGRESSION(r266890): [Cocoa] Fix InspectorDelegate / API::InspectorClient leak : [Attachment 420528] Patch v1.0

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 16 13:14:45 PST 2021


Devin Rousso <drousso at apple.com> has granted BJ Burg <bburg at apple.com>'s
request for review:
Bug 221988: REGRESSION(r266890): [Cocoa] Fix InspectorDelegate /
API::InspectorClient leak
https://bugs.webkit.org/show_bug.cgi?id=221988

Attachment 420528: Patch v1.0

https://bugs.webkit.org/attachment.cgi?id=420528&action=review




--- Comment #2 from Devin Rousso <drousso at apple.com> ---
Comment on attachment 420528
  --> https://bugs.webkit.org/attachment.cgi?id=420528
Patch v1.0

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

r=me, nice fix :)

> Source/WebKit/ChangeLog:27
> +	   via the constructor. If a nil delegate is passedâfor example, when
> +	   closing the WKWebViewâthen don't create an API::InspectorClient

i think there's non-ascii here :(

> Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm:61
> +    if (!delegate && !_delegate)
> +	   return;

What about if `!delegate` but `_delegate`?  Should we `_delegate = nullptr;` in
that scenario?

> Source/WebKit/UIProcess/API/Cocoa/_WKInspector.mm:63
> +    _delegate = makeUnique<WebKit::InspectorDelegate>(self, delegate);

I could be crazy, but I think you can drop the `<WebKit::InspectorDelegate>` as
`makeUnique` might be able to deduce the type.


More information about the webkit-reviews mailing list