[webkit-reviews] review granted: [Bug 189443] Implement the Web Share API for mac : [Attachment 349348] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 10 21:32:57 PDT 2018


Tim Horton <thorton at apple.com> has granted Olivia Barnett
<obarnett at apple.com>'s request for review:
Bug 189443: Implement the Web Share API for mac
https://bugs.webkit.org/show_bug.cgi?id=189443

Attachment 349348: Patch

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




--- Comment #22 from Tim Horton <thorton at apple.com> ---
Comment on attachment 349348
  --> https://bugs.webkit.org/attachment.cgi?id=349348
Patch

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

ALSO it looks like you missed a trailing space in the new expected test result
:P (or your editor deleted it on you!)

> Source/WebKit/ChangeLog:2
> +

To fix the 32-bit build, let's just make this feature modern-API only (the
other option is to make it legacy-runtime-compatible by moving the ivar
definitions to the header, but that is ugly and less forward-looking), by doing
the following:

> Source/WebKit/UIProcess/API/mac/WKView.mm:1334
> +- (void)shareSheetDidDismiss:(WKShareSheet *)shareSheet

Get rid of this.

> Source/WebKit/UIProcess/Cocoa/WKShareSheet.h:26
> +#if PLATFORM(COCOA) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)

Add a && WK_API_ENABLED here, so it only builds in places where WKWebView
exists

> Source/WebKit/UIProcess/Cocoa/WKShareSheet.h:44
> +- (instancetype)initWithView:(NSView *)view;

Make this take a WKWebView instead.

> Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm:29
> +#if PLATFORM(COCOA) && !PLATFORM(WATCHOS) && !PLATFORM(APPLETV)

WK_API_ENABLED

> Source/WebKit/UIProcess/Cocoa/WKShareSheet.mm:45
> +    WeakObjCPtr<NSView> _view;

WKWebView (and in various other places here).

> Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:2730
> +void WebViewImpl::showShareSheet(const WebCore::ShareDataWithParsedURL&
data, WTF::CompletionHandler<void(bool)>&& completionHandler, NSView *view)

WKWebView.

> Source/WebKit/UIProcess/Cocoa/WebViewImpl.mm:2738
> +    [_shareSheet setDelegate:(NSView<WKShareSheetDelegate> *)view];

No more need for this ugly cast!

> Source/WebKit/UIProcess/mac/PageClientImplMac.mm:546
> +    m_impl->showShareSheet(shareData, WTFMove(completionHandler), m_view);

Pass m_webView instead


More information about the webkit-reviews mailing list