Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm (235367 => 235368)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm 2018-08-27 16:08:17 UTC (rev 235367)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm 2018-08-27 16:16:10 UTC (rev 235368)
@@ -320,11 +320,8 @@
_page->setPageZoomFactor(pageZoom);
}
-static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
{
- if (!WKFrameIsMainFrame(frame))
- return;
-
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -332,11 +329,8 @@
[loadDelegate browsingContextControllerDidStartProvisionalLoad:browsingContext];
}
-static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+static void didReceiveServerRedirectForProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
{
- if (!WKFrameIsMainFrame(frame))
- return;
-
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -344,11 +338,8 @@
[loadDelegate browsingContextControllerDidReceiveServerRedirectForProvisionalLoad:browsingContext];
}
-static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
+static void didFailProvisionalNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
{
- if (!WKFrameIsMainFrame(frame))
- return;
-
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -356,11 +347,8 @@
[loadDelegate browsingContextController:browsingContext didFailProvisionalLoadWithError:wrapper(*toImpl(error))];
}
-static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
{
- if (!WKFrameIsMainFrame(frame))
- return;
-
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -368,11 +356,8 @@
[loadDelegate browsingContextControllerDidCommitLoad:browsingContext];
}
-static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
+static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
{
- if (!WKFrameIsMainFrame(frame))
- return;
-
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -380,11 +365,8 @@
[loadDelegate browsingContextControllerDidFinishLoad:browsingContext];
}
-static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
+static void didFailNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
{
- if (!WKFrameIsMainFrame(frame))
- return;
-
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -392,7 +374,7 @@
[loadDelegate browsingContextController:browsingContext didFailLoadWithError:wrapper(*toImpl(error))];
}
-static bool canAuthenticateAgainstProtectionSpaceInFrame(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo)
+static bool canAuthenticateAgainstProtectionSpace(WKPageRef page, WKProtectionSpaceRef protectionSpace, const void *clientInfo)
{
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -403,7 +385,7 @@
return false;
}
-static void didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo)
+static void didReceiveAuthenticationChallenge(WKPageRef page, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo)
{
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
auto loadDelegate = browsingContext->_loadDelegate.get();
@@ -412,46 +394,6 @@
[(id <WKBrowsingContextLoadDelegatePrivate>)loadDelegate browsingContextController:browsingContext didReceiveAuthenticationChallenge:wrapper(*toImpl(authenticationChallenge))];
}
-static void didStartProgress(WKPageRef page, const void* clientInfo)
-{
- auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
- auto loadDelegate = browsingContext->_loadDelegate.get();
-
- if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidStartProgress:)])
- [loadDelegate browsingContextControllerDidStartProgress:browsingContext];
-}
-
-static void didChangeProgress(WKPageRef page, const void* clientInfo)
-{
- auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
- auto loadDelegate = browsingContext->_loadDelegate.get();
-
- if ([loadDelegate respondsToSelector:@selector(browsingContextController:estimatedProgressChangedTo:)])
- [loadDelegate browsingContextController:browsingContext estimatedProgressChangedTo:toImpl(page)->estimatedProgress()];
-}
-
-static void didFinishProgress(WKPageRef page, const void* clientInfo)
-{
- auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
- auto loadDelegate = browsingContext->_loadDelegate.get();
-
- if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidFinishProgress:)])
- [loadDelegate browsingContextControllerDidFinishProgress:browsingContext];
-}
-
-static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo)
-{
- auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
- auto loadDelegate = browsingContext->_loadDelegate.get();
-
- if (![loadDelegate respondsToSelector:@selector(browsingContextControllerDidChangeBackForwardList:addedItem:removedItems:)])
- return;
-
- WKBackForwardListItem *added = addedItem ? wrapper(*toImpl(addedItem)) : nil;
- NSArray *removed = removedItems ? wrapper(*toImpl(removedItems)) : nil;
- [loadDelegate browsingContextControllerDidChangeBackForwardList:browsingContext addedItem:added removedItems:removed];
-}
-
static void processDidCrash(WKPageRef page, const void* clientInfo)
{
auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
@@ -463,29 +405,22 @@
static void setUpPageLoaderClient(WKBrowsingContextController *browsingContext, WebPageProxy& page)
{
- WKPageLoaderClientV4 loaderClient;
+ WKPageNavigationClientV0 loaderClient;
memset(&loaderClient, 0, sizeof(loaderClient));
- loaderClient.base.version = 4;
+ loaderClient.base.version = 0;
loaderClient.base.clientInfo = (__bridge void*)browsingContext;
- loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
- loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
- loaderClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
- loaderClient.didCommitLoadForFrame = didCommitLoadForFrame;
- loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
- loaderClient.didFailLoadWithErrorForFrame = didFailLoadWithErrorForFrame;
+ loaderClient.didStartProvisionalNavigation = didStartProvisionalNavigation;
+ loaderClient.didReceiveServerRedirectForProvisionalNavigation = didReceiveServerRedirectForProvisionalNavigation;
+ loaderClient.didFailProvisionalNavigation = didFailProvisionalNavigation;
+ loaderClient.didCommitNavigation = didCommitNavigation;
+ loaderClient.didFinishNavigation = didFinishNavigation;
+ loaderClient.didFailNavigation = didFailNavigation;
+ loaderClient.canAuthenticateAgainstProtectionSpace = canAuthenticateAgainstProtectionSpace;
+ loaderClient.didReceiveAuthenticationChallenge = didReceiveAuthenticationChallenge;
+ loaderClient.webProcessDidCrash = processDidCrash;
- loaderClient.canAuthenticateAgainstProtectionSpaceInFrame = canAuthenticateAgainstProtectionSpaceInFrame;
- loaderClient.didReceiveAuthenticationChallengeInFrame = didReceiveAuthenticationChallengeInFrame;
-
- loaderClient.didStartProgress = didStartProgress;
- loaderClient.didChangeProgress = didChangeProgress;
- loaderClient.didFinishProgress = didFinishProgress;
- loaderClient.didChangeBackForwardList = didChangeBackForwardList;
-
- loaderClient.processDidCrash = processDidCrash;
-
- WKPageSetPageLoaderClient(toAPI(&page), &loaderClient.base);
+ WKPageSetPageNavigationClient(toAPI(&page), &loaderClient.base);
}
static WKPolicyDecisionHandler makePolicyDecisionBlock(WKFramePolicyListenerRef listener)
@@ -597,7 +532,7 @@
if (loadDelegate)
setUpPageLoaderClient(self, *_page);
else
- WKPageSetPageLoaderClient(toAPI(_page.get()), nullptr);
+ WKPageSetPageNavigationClient(toAPI(_page.get()), nullptr);
}
- (id <WKBrowsingContextPolicyDelegate>)policyDelegate
Modified: trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h (235367 => 235368)
--- trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h 2018-08-27 16:08:17 UTC (rev 235367)
+++ trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h 2018-08-27 16:16:10 UTC (rev 235368)
@@ -53,11 +53,11 @@
/* Sent if the commited load fails. */
- (void)browsingContextController:(WKBrowsingContextController *)sender didFailLoadWithError:(NSError *)error;
-- (void)browsingContextControllerDidStartProgress:(WKBrowsingContextController *)sender;
-- (void)browsingContextController:(WKBrowsingContextController *)sender estimatedProgressChangedTo:(double)estimatedProgress;
-- (void)browsingContextControllerDidFinishProgress:(WKBrowsingContextController *)sender;
+- (void)browsingContextControllerDidStartProgress:(WKBrowsingContextController *)sender WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.estimatedProgress", macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)browsingContextController:(WKBrowsingContextController *)sender estimatedProgressChangedTo:(double)estimatedProgress WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.estimatedProgress", macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
+- (void)browsingContextControllerDidFinishProgress:(WKBrowsingContextController *)sender WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.estimatedProgress", macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
-- (void)browsingContextControllerDidChangeBackForwardList:(WKBrowsingContextController *)sender addedItem:(WKBackForwardListItem *)addedItem removedItems:(NSArray *)removedItems;
+- (void)browsingContextControllerDidChangeBackForwardList:(WKBrowsingContextController *)sender addedItem:(WKBackForwardListItem *)addedItem removedItems:(NSArray *)removedItems WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.backForwardList", macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
@end