Bug 195222

Summary: Drop legacy userAgentForURL injected bundle SPI
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebKit2Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, commit-queue, darin, ggaren, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Description Chris Dumez 2019-03-01 12:46:56 PST
Deprecate userAgentForURL injected bundle SPI. There are no longer any clients, using WebsitePolicies.customUserAgent is the way to go nowadays.
Comment 1 Chris Dumez 2019-03-01 12:47:37 PST
<rdar://problem/46734147>
Comment 2 Chris Dumez 2019-03-01 12:48:29 PST
Created attachment 363361 [details]
Patch
Comment 3 Darin Adler 2019-03-01 22:25:52 PST
Comment on attachment 363361 [details]
Patch

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

> Source/WebKit/ChangeLog:3
> +        Deprecate userAgentForURL injected bundle SPI

This does more than just deprecate it. It also removes support for it, in other words makes it not be called any more. That’s not what "deprecate" means. So this is more like "remove support for" rather than "deprecate".

> Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h:67
> +- (NSString *)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame userAgentForURL:(NSURL *)url WK_API_DEPRECATED("Use _WKWebsitePolicies.customUserAgent instead", macosx(WK_MAC_TBA, WK_MAC_TBA), ios(WK_IOS_TBA, WK_IOS_TBA));

Why are we leaving this in the header at all? This is not API, so what benefit is there for this being here and marked deprecated rather than removed? These deprecation macros have helpful behavior for methods that might be called. I’m not sure they do any good for optional methods in a protocol that are are meant to be implemented.

I suggest just deleting this line unless I am missing something.

> Source/WebKit/WebProcess/WebPage/WebPage.cpp:3169
> +String WebPage::userAgent(WebFrame*, const URL& webcoreURL) const

Should we change this to not even take a WebFrame pointer and update callers to no longer pass it?
Comment 4 Chris Dumez 2019-03-04 11:52:29 PST
Created attachment 363533 [details]
Patch
Comment 5 Chris Dumez 2019-03-04 11:58:38 PST
Created attachment 363536 [details]
Patch
Comment 6 WebKit Commit Bot 2019-03-04 12:36:38 PST
Comment on attachment 363536 [details]
Patch

Clearing flags on attachment: 363536

Committed r242375: <https://trac.webkit.org/changeset/242375>
Comment 7 WebKit Commit Bot 2019-03-04 12:36:40 PST
All reviewed patches have been landed.  Closing bug.