[webkit-reviews] review granted: [Bug 238747] Use Ref and RefPtr pattern when handling document close calls : [Attachment 456594] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 4 11:30:36 PDT 2022


Sam Weinig <sam at webkit.org> has granted Gabriel Nava Marino
<gnavamarino at apple.com>'s request for review:
Bug 238747: Use Ref and RefPtr pattern when handling document close calls
https://bugs.webkit.org/show_bug.cgi?id=238747

Attachment 456594: Patch

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




--- Comment #2 from Sam Weinig <sam at webkit.org> ---
Comment on attachment 456594
  --> https://bugs.webkit.org/attachment.cgi?id=456594
Patch

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

> Source/WebCore/ChangeLog:8
> +	   Ensure document object remains for the scope of the call.

I wonder ifs we should come up with some convention (naming or otherwise) to
indicate that a caller is responsible for maintaining an external ref. Like,
Document::close_mayDestroy(), or perhaps even take it a step further and
require a separate type to call close()?  

Ref closer = document.closer()
closer.close()

/* can safely use document as long as closer is in scope */


More information about the webkit-reviews mailing list