[webkit-reviews] review granted: [Bug 190319] Make it more clear that a WebPageProxy always has an API::UIClient : [Attachment 351702] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Oct 6 01:51:25 PDT 2018


Michael Catanzaro <mcatanzaro at igalia.com> has granted Alex Christensen
<achristensen at apple.com>'s request for review:
Bug 190319: Make it more clear that a WebPageProxy always has an API::UIClient
https://bugs.webkit.org/show_bug.cgi?id=190319

Attachment 351702: Patch

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




--- Comment #4 from Michael Catanzaro <mcatanzaro at igalia.com> ---
Comment on attachment 351702
  --> https://bugs.webkit.org/attachment.cgi?id=351702
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:-601
> -    if (!uiClient) {
> -	   m_uiClient = std::make_unique<API::UIClient>();
> -	   return;
> -    }

Yeah this wasn't great.

> Source/WebKit/UIProcess/WebPageProxy.h:1863
> -    std::unique_ptr<API::UIClient> m_uiClient;
> +    UniqueRef<API::UIClient> m_uiClient;

OK, so this is an opportunity for me to learn about UniqueRef. Looks like it's
good when:

 * You need polymorphism, so a pointer or reference is required
 * You want ownership of a non-refcounted type
 * It's nonnull, so a reference is better than a pointer

I wonder why the standard library doesn't have this....


More information about the webkit-reviews mailing list