Changeset 235368 in webkit


Ignore:
Timestamp:
Aug 27, 2018, 9:16:10 AM (7 years ago)
Author:
achristensen@apple.com
Message:

Transition WKBrowsingContextController from WKPageLoaderClient to WKPageNavigationClient
https://bugs.webkit.org/show_bug.cgi?id=188942

Reviewed by Andy Estes.

  • UIProcess/API/Cocoa/WKBrowsingContextController.mm:

(didStartProvisionalNavigation):
(didReceiveServerRedirectForProvisionalNavigation):
(didFailProvisionalNavigation):
(didCommitNavigation):
(didFinishNavigation):
(didFailNavigation):
(canAuthenticateAgainstProtectionSpace):
(didReceiveAuthenticationChallenge):
(setUpPageLoaderClient):
(-[WKBrowsingContextController setLoadDelegate:]):
(didStartProvisionalLoadForFrame): Deleted.
(didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
(didFailProvisionalLoadWithErrorForFrame): Deleted.
(didCommitLoadForFrame): Deleted.
(didFinishLoadForFrame): Deleted.
(didFailLoadWithErrorForFrame): Deleted.
(canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
(didReceiveAuthenticationChallengeInFrame): Deleted.
(didStartProgress): Deleted.
(didChangeProgress): Deleted.
(didFinishProgress): Deleted.
(didChangeBackForwardList): Deleted.

  • UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r235365 r235368  
     12018-08-27  Alex Christensen  <achristensen@webkit.org>
     2
     3        Transition WKBrowsingContextController from WKPageLoaderClient to WKPageNavigationClient
     4        https://bugs.webkit.org/show_bug.cgi?id=188942
     5
     6        Reviewed by Andy Estes.
     7
     8        * UIProcess/API/Cocoa/WKBrowsingContextController.mm:
     9        (didStartProvisionalNavigation):
     10        (didReceiveServerRedirectForProvisionalNavigation):
     11        (didFailProvisionalNavigation):
     12        (didCommitNavigation):
     13        (didFinishNavigation):
     14        (didFailNavigation):
     15        (canAuthenticateAgainstProtectionSpace):
     16        (didReceiveAuthenticationChallenge):
     17        (setUpPageLoaderClient):
     18        (-[WKBrowsingContextController setLoadDelegate:]):
     19        (didStartProvisionalLoadForFrame): Deleted.
     20        (didReceiveServerRedirectForProvisionalLoadForFrame): Deleted.
     21        (didFailProvisionalLoadWithErrorForFrame): Deleted.
     22        (didCommitLoadForFrame): Deleted.
     23        (didFinishLoadForFrame): Deleted.
     24        (didFailLoadWithErrorForFrame): Deleted.
     25        (canAuthenticateAgainstProtectionSpaceInFrame): Deleted.
     26        (didReceiveAuthenticationChallengeInFrame): Deleted.
     27        (didStartProgress): Deleted.
     28        (didChangeProgress): Deleted.
     29        (didFinishProgress): Deleted.
     30        (didChangeBackForwardList): Deleted.
     31        * UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h:
     32
    1332018-08-26  Darin Adler  <darin@apple.com>
    234
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm

    r235365 r235368  
    321321}
    322322
    323 static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
    324 {
    325     if (!WKFrameIsMainFrame(frame))
    326         return;
    327 
     323static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
     324{
    328325    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    329326    auto loadDelegate = browsingContext->_loadDelegate.get();
     
    333330}
    334331
    335 static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
    336 {
    337     if (!WKFrameIsMainFrame(frame))
    338         return;
    339 
     332static void didReceiveServerRedirectForProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
     333{
    340334    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    341335    auto loadDelegate = browsingContext->_loadDelegate.get();
     
    345339}
    346340
    347 static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
    348 {
    349     if (!WKFrameIsMainFrame(frame))
    350         return;
    351 
     341static void didFailProvisionalNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
     342{
    352343    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    353344    auto loadDelegate = browsingContext->_loadDelegate.get();
     
    357348}
    358349
    359 static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
    360 {
    361     if (!WKFrameIsMainFrame(frame))
    362         return;
    363 
     350static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
     351{
    364352    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    365353    auto loadDelegate = browsingContext->_loadDelegate.get();
     
    369357}
    370358
    371 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo)
    372 {
    373     if (!WKFrameIsMainFrame(frame))
    374         return;
    375 
     359static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo)
     360{
    376361    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    377362    auto loadDelegate = browsingContext->_loadDelegate.get();
     
    381366}
    382367
    383 static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
    384 {
    385     if (!WKFrameIsMainFrame(frame))
    386         return;
    387 
     368static void didFailNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo)
     369{
    388370    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    389371    auto loadDelegate = browsingContext->_loadDelegate.get();
     
    393375}
    394376
    395 static bool canAuthenticateAgainstProtectionSpaceInFrame(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo)
     377static bool canAuthenticateAgainstProtectionSpace(WKPageRef page, WKProtectionSpaceRef protectionSpace, const void *clientInfo)
    396378{
    397379    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     
    404386}
    405387
    406 static void didReceiveAuthenticationChallengeInFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo)
     388static void didReceiveAuthenticationChallenge(WKPageRef page, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo)
    407389{
    408390    auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
     
    413395}
    414396
    415 static void didStartProgress(WKPageRef page, const void* clientInfo)
    416 {
    417     auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    418     auto loadDelegate = browsingContext->_loadDelegate.get();
    419 
    420     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidStartProgress:)])
    421         [loadDelegate browsingContextControllerDidStartProgress:browsingContext];
    422 }
    423 
    424 static void didChangeProgress(WKPageRef page, const void* clientInfo)
    425 {
    426     auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    427     auto loadDelegate = browsingContext->_loadDelegate.get();
    428 
    429     if ([loadDelegate respondsToSelector:@selector(browsingContextController:estimatedProgressChangedTo:)])
    430         [loadDelegate browsingContextController:browsingContext estimatedProgressChangedTo:toImpl(page)->estimatedProgress()];
    431 }
    432 
    433 static void didFinishProgress(WKPageRef page, const void* clientInfo)
    434 {
    435     auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    436     auto loadDelegate = browsingContext->_loadDelegate.get();
    437 
    438     if ([loadDelegate respondsToSelector:@selector(browsingContextControllerDidFinishProgress:)])
    439         [loadDelegate browsingContextControllerDidFinishProgress:browsingContext];
    440 }
    441 
    442 static void didChangeBackForwardList(WKPageRef page, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void *clientInfo)
    443 {
    444     auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo;
    445     auto loadDelegate = browsingContext->_loadDelegate.get();
    446 
    447     if (![loadDelegate respondsToSelector:@selector(browsingContextControllerDidChangeBackForwardList:addedItem:removedItems:)])
    448         return;
    449 
    450     WKBackForwardListItem *added = addedItem ? wrapper(*toImpl(addedItem)) : nil;
    451     NSArray *removed = removedItems ? wrapper(*toImpl(removedItems)) : nil;
    452     [loadDelegate browsingContextControllerDidChangeBackForwardList:browsingContext addedItem:added removedItems:removed];
    453 }
    454 
    455397static void processDidCrash(WKPageRef page, const void* clientInfo)
    456398{
     
    464406static void setUpPageLoaderClient(WKBrowsingContextController *browsingContext, WebPageProxy& page)
    465407{
    466     WKPageLoaderClientV4 loaderClient;
     408    WKPageNavigationClientV0 loaderClient;
    467409    memset(&loaderClient, 0, sizeof(loaderClient));
    468410
    469     loaderClient.base.version = 4;
     411    loaderClient.base.version = 0;
    470412    loaderClient.base.clientInfo = (__bridge void*)browsingContext;
    471     loaderClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
    472     loaderClient.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
    473     loaderClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
    474     loaderClient.didCommitLoadForFrame = didCommitLoadForFrame;
    475     loaderClient.didFinishLoadForFrame = didFinishLoadForFrame;
    476     loaderClient.didFailLoadWithErrorForFrame = didFailLoadWithErrorForFrame;
    477 
    478     loaderClient.canAuthenticateAgainstProtectionSpaceInFrame = canAuthenticateAgainstProtectionSpaceInFrame;
    479     loaderClient.didReceiveAuthenticationChallengeInFrame = didReceiveAuthenticationChallengeInFrame;
    480 
    481     loaderClient.didStartProgress = didStartProgress;
    482     loaderClient.didChangeProgress = didChangeProgress;
    483     loaderClient.didFinishProgress = didFinishProgress;
    484     loaderClient.didChangeBackForwardList = didChangeBackForwardList;
    485 
    486     loaderClient.processDidCrash = processDidCrash;
    487 
    488     WKPageSetPageLoaderClient(toAPI(&page), &loaderClient.base);
     413    loaderClient.didStartProvisionalNavigation = didStartProvisionalNavigation;
     414    loaderClient.didReceiveServerRedirectForProvisionalNavigation = didReceiveServerRedirectForProvisionalNavigation;
     415    loaderClient.didFailProvisionalNavigation = didFailProvisionalNavigation;
     416    loaderClient.didCommitNavigation = didCommitNavigation;
     417    loaderClient.didFinishNavigation = didFinishNavigation;
     418    loaderClient.didFailNavigation = didFailNavigation;
     419    loaderClient.canAuthenticateAgainstProtectionSpace = canAuthenticateAgainstProtectionSpace;
     420    loaderClient.didReceiveAuthenticationChallenge = didReceiveAuthenticationChallenge;
     421    loaderClient.webProcessDidCrash = processDidCrash;
     422
     423    WKPageSetPageNavigationClient(toAPI(&page), &loaderClient.base);
    489424}
    490425
     
    598533        setUpPageLoaderClient(self, *_page);
    599534    else
    600         WKPageSetPageLoaderClient(toAPI(_page.get()), nullptr);
     535        WKPageSetPageNavigationClient(toAPI(_page.get()), nullptr);
    601536}
    602537
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h

    r177760 r235368  
    5454- (void)browsingContextController:(WKBrowsingContextController *)sender didFailLoadWithError:(NSError *)error;
    5555
    56 - (void)browsingContextControllerDidStartProgress:(WKBrowsingContextController *)sender;
    57 - (void)browsingContextController:(WKBrowsingContextController *)sender estimatedProgressChangedTo:(double)estimatedProgress;
    58 - (void)browsingContextControllerDidFinishProgress:(WKBrowsingContextController *)sender;
     56- (void)browsingContextControllerDidStartProgress:(WKBrowsingContextController *)sender WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.estimatedProgress", macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
     57- (void)browsingContextController:(WKBrowsingContextController *)sender estimatedProgressChangedTo:(double)estimatedProgress WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.estimatedProgress", macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
     58- (void)browsingContextControllerDidFinishProgress:(WKBrowsingContextController *)sender WK_API_DEPRECATED_WITH_REPLACEMENT("WKWebView.estimatedProgress", macosx(WK_MAC_TBA), ios(WK_IOS_TBA));
    5959
    60 - (void)browsingContextControllerDidChangeBackForwardList:(WKBrowsingContextController *)sender addedItem:(WKBackForwardListItem *)addedItem removedItems:(NSArray *)removedItems;
     60- (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));
    6161
    6262@end
Note: See TracChangeset for help on using the changeset viewer.