Changeset 242375 in webkit
- Timestamp:
- Mar 4, 2019, 12:36:32 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h (modified) (1 diff)
-
WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h (modified) (1 diff)
-
WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h (modified) (4 diffs)
-
WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm (modified) (2 diffs)
-
WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp (modified) (1 diff)
-
WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h (modified) (1 diff)
-
WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (modified) (1 diff)
-
WebProcess/WebPage/WebPage.cpp (modified) (1 diff)
-
WebProcess/WebPage/WebPage.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r242371 r242375 1 2019-03-04 Chris Dumez <cdumez@apple.com> 2 3 Drop legacy userAgentForURL injected bundle SPI 4 https://bugs.webkit.org/show_bug.cgi?id=195222 5 <rdar://problem/46734147> 6 7 Reviewed by Darin Adler. 8 9 Drop legacy userAgentForURL injected bundle SPI. There are no longer any clients, and using 10 WebsitePolicies.customUserAgent is the way to go nowadays. 11 12 * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: 13 (API::InjectedBundle::PageLoaderClient::willDestroyFrame): 14 (API::InjectedBundle::PageLoaderClient::userAgentForURL const): Deleted. 15 * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: 16 * WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h: 17 * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: 18 (setUpPageLoaderClient): 19 (userAgentForURL): Deleted. 20 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: 21 (WebKit::InjectedBundlePageLoaderClient::userAgentForURL const): Deleted. 22 * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: 23 * WebProcess/WebPage/WebPage.cpp: 24 (WebKit::WebPage::userAgent const): 25 1 26 2019-03-04 Chris Dumez <cdumez@apple.com> 2 27 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h
r241183 r242375 96 96 97 97 virtual void willDestroyFrame(WebKit::WebPage&, WebKit::WebFrame&) { } 98 virtual WTF::String userAgentForURL(WebKit::WebFrame&, const WTF::URL&) const { return WTF::String(); }99 98 100 99 virtual OptionSet<WebCore::LayoutMilestone> layoutMilestones() const { return { }; } -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h
r240808 r242375 65 65 - (void)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame didFailLoadForResource:(uint64_t)resource error:(NSError *)error; 66 66 67 - (NSString *)webProcessPlugInBrowserContextController:(WKWebProcessPlugInBrowserContextController *)controller frame:(WKWebProcessPlugInFrame *)frame userAgentForURL:(NSURL *)url;68 69 67 @end -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/c/WKBundlePageLoaderClient.h
r241128 r242375 63 63 typedef void (*WKBundlePageWillLoadURLRequestCallback)(WKBundlePageRef page, WKURLRequestRef request, WKTypeRef userData, const void *clientInfo); 64 64 typedef void (*WKBundlePageWillLoadDataRequestCallback)(WKBundlePageRef page, WKURLRequestRef request, WKDataRef data, WKStringRef MIMEType, WKStringRef encodingName, WKURLRef unreachableURL, WKTypeRef userData, const void *clientInfo); 65 typedef WKStringRef (*WKBundlePageUserAgentForURLCallback)(WKBundleFrameRef frame, WKURLRef url, const void *clientInfo);66 65 typedef WKLayoutMilestones (*WKBundlePageLayoutMilestonesCallback)(const void* clientInfo); 67 66 … … 464 463 465 464 // Version 8 466 WKBundlePageUserAgentForURLCallback userAgentForURL;465 void* userAgentForURL_unavailable; 467 466 } WKBundlePageLoaderClientV8; 468 467 … … 522 521 523 522 // Version 8 524 WKBundlePageUserAgentForURLCallback userAgentForURL;523 void* userAgentForURL_unavailable; 525 524 526 525 // Version 9 … … 583 582 584 583 // Version 8 585 WKBundlePageUserAgentForURLCallback userAgentForURL;584 void* userAgentForURL_unavailable; 586 585 587 586 // Version 9 -
trunk/Source/WebKit/WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm
r242339 r242375 221 221 } 222 222 223 static WKStringRef userAgentForURL(WKBundleFrameRef frame, WKURLRef url, const void* clientInfo)224 {225 auto pluginContextController = (__bridge WKWebProcessPlugInBrowserContextController *)clientInfo;226 auto loadDelegate = pluginContextController->_loadDelegate.get();227 228 if ([loadDelegate respondsToSelector:@selector(webProcessPlugInBrowserContextController:frame:userAgentForURL:)]) {229 WKWebProcessPlugInFrame *newFrame = wrapper(*WebKit::toImpl(frame));230 NSString *string = [loadDelegate webProcessPlugInBrowserContextController:pluginContextController frame:newFrame userAgentForURL:wrapper(*WebKit::toImpl(url))];231 if (!string)232 return nullptr;233 234 return WKStringCreateWithCFString((__bridge CFStringRef)string);235 }236 237 return nullptr;238 }239 240 223 static void setUpPageLoaderClient(WKWebProcessPlugInBrowserContextController *contextController, WebKit::WebPage& page) 241 224 { … … 257 240 client.didHandleOnloadEventsForFrame = didHandleOnloadEventsForFrame; 258 241 client.didFirstVisuallyNonEmptyLayoutForFrame = didFirstVisuallyNonEmptyLayoutForFrame; 259 client.userAgentForURL = userAgentForURL;260 242 261 243 client.didLayoutForFrame = didLayoutForFrame; -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp
r241128 r242375 354 354 } 355 355 356 String InjectedBundlePageLoaderClient::userAgentForURL(WebFrame& frame, const URL& url) const357 {358 if (!m_client.userAgentForURL)359 return String();360 WKStringRef userAgent = m_client.userAgentForURL(toAPI(&frame), toAPI(API::URL::create(url).ptr()), m_client.base.clientInfo);361 if (!userAgent)362 return String();363 return toImpl(userAgent)->string();364 }365 366 356 OptionSet<WebCore::LayoutMilestone> InjectedBundlePageLoaderClient::layoutMilestones() const 367 357 { -
trunk/Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h
r241128 r242375 86 86 void featuresUsedInPage(WebPage&, const Vector<WTF::String>&) override; 87 87 88 WTF::String userAgentForURL(WebFrame&, const URL&) const override;89 90 88 OptionSet<WebCore::LayoutMilestone> layoutMilestones() const override; 91 89 }; -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r242082 r242375 1371 1371 String WebFrameLoaderClient::userAgent(const URL& url) 1372 1372 { 1373 WebPage* webPage = m_frame->page();1373 auto* webPage = m_frame->page(); 1374 1374 if (!webPage) 1375 1375 return String(); 1376 1376 1377 return webPage->userAgent( m_frame,url);1377 return webPage->userAgent(url); 1378 1378 } 1379 1379 -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.cpp
r242320 r242375 3165 3165 String WebPage::userAgent(const URL& webCoreURL) const 3166 3166 { 3167 return userAgent(nullptr, webCoreURL); 3168 } 3169 3170 String WebPage::userAgent(WebFrame* frame, const URL& webcoreURL) const 3171 { 3172 if (frame) { 3173 String userAgent = m_loaderClient->userAgentForURL(*frame, webcoreURL); 3174 if (!userAgent.isEmpty()) 3175 return userAgent; 3176 } 3177 3178 String userAgent = platformUserAgent(webcoreURL); 3167 String userAgent = platformUserAgent(webCoreURL); 3179 3168 if (!userAgent.isEmpty()) 3180 3169 return userAgent; 3181 3170 return m_userAgent; 3182 3171 } 3183 3172 3184 3173 void WebPage::setUserAgent(const String& userAgent) 3185 3174 { -
trunk/Source/WebKit/WebProcess/WebPage/WebPage.h
r242340 r242375 348 348 void show(); 349 349 String userAgent(const URL&) const; 350 String userAgent(WebFrame*, const URL&) const;351 350 String platformUserAgent(const URL&) const; 352 351 WebCore::KeyboardUIMode keyboardUIMode();
Note:
See TracChangeset
for help on using the changeset viewer.