Bug 237986

Summary: Don't build WebPageProxy::writePromisedAttachmentToPasteboard() and its IPC on macOS
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, kkinnunen, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=237839
Attachments:
Description Flags
Patch
none
Patch none

Description Chris Dumez 2022-03-16 15:26:45 PDT
Don't build WebPageProxy::writePromisedAttachmentToPasteboard() and its IPC on macOS since it is only useful on iOS.
Comment 1 Chris Dumez 2022-03-16 15:29:15 PDT
Created attachment 454903 [details]
Patch
Comment 2 Brent Fulgham 2022-03-16 15:42:23 PDT
Comment on attachment 454903 [details]
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:10196
> +#if PLATFORM(IOS_FAMILY)

It seems like this message is only ever used on iOS/iPadOS (_writePromisedAttachmentToPasteboard is a no-op on watchOS/tvOS), so it might be possible to remove the message entirely on tvOS/watchOS (though perhaps not worth doing).
Comment 3 Brent Fulgham 2022-03-16 15:44:02 PDT
Comment on attachment 454903 [details]
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.h:2546
>      void writePromisedAttachmentToPasteboard(WebCore::PromisedAttachmentInfo&&, const String& authorizationToken);

You could probably make this change to "PageClient" as well, so it would avoid compiling another virtual method on macOS.
Comment 4 Chris Dumez 2022-03-16 15:48:32 PDT
(In reply to Brent Fulgham from comment #2)
> Comment on attachment 454903 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=454903&action=review
> 
> > Source/WebKit/UIProcess/WebPageProxy.cpp:10196
> > +#if PLATFORM(IOS_FAMILY)
> 
> It seems like this message is only ever used on iOS/iPadOS
> (_writePromisedAttachmentToPasteboard is a no-op on watchOS/tvOS), so it
> might be possible to remove the message entirely on tvOS/watchOS (though
> perhaps not worth doing).

Based on the IPC sender, the condition is PLATFORM(IOS_FAMILY) && ENABLE(ATTACHMENT_ELEMENT). It matches what I have here on recipient side.
Comment 5 Chris Dumez 2022-03-16 15:50:46 PDT
Created attachment 454904 [details]
Patch
Comment 6 Chris Dumez 2022-03-16 15:51:52 PDT
(In reply to Brent Fulgham from comment #3)
> Comment on attachment 454903 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=454903&action=review
> 
> > Source/WebKit/UIProcess/WebPageProxy.h:2546
> >      void writePromisedAttachmentToPasteboard(WebCore::PromisedAttachmentInfo&&, const String& authorizationToken);
> 
> You could probably make this change to "PageClient" as well, so it would
> avoid compiling another virtual method on macOS.

Good idea, done.
Comment 7 Brent Fulgham 2022-03-16 16:58:15 PDT
Comment on attachment 454904 [details]
Patch

r=me
Comment 8 EWS 2022-03-16 17:56:43 PDT
Committed r291381 (248512@main): <https://commits.webkit.org/248512@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 454904 [details].
Comment 9 Radar WebKit Bug Importer 2022-03-16 17:57:17 PDT
<rdar://problem/90402469>