Changeset 235368 in webkit
- Timestamp:
- Aug 27, 2018, 9:16:10 AM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r235365 r235368 1 2018-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 1 33 2018-08-26 Darin Adler <darin@apple.com> 2 34 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextController.mm
r235365 r235368 321 321 } 322 322 323 static void didStartProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) 324 { 325 if (!WKFrameIsMainFrame(frame)) 326 return; 327 323 static void didStartProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 324 { 328 325 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; 329 326 auto loadDelegate = browsingContext->_loadDelegate.get(); … … 333 330 } 334 331 335 static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) 336 { 337 if (!WKFrameIsMainFrame(frame)) 338 return; 339 332 static void didReceiveServerRedirectForProvisionalNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 333 { 340 334 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; 341 335 auto loadDelegate = browsingContext->_loadDelegate.get(); … … 345 339 } 346 340 347 static void didFailProvisionalLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo) 348 { 349 if (!WKFrameIsMainFrame(frame)) 350 return; 351 341 static void didFailProvisionalNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo) 342 { 352 343 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; 353 344 auto loadDelegate = browsingContext->_loadDelegate.get(); … … 357 348 } 358 349 359 static void didCommitLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) 360 { 361 if (!WKFrameIsMainFrame(frame)) 362 return; 363 350 static void didCommitNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 351 { 364 352 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; 365 353 auto loadDelegate = browsingContext->_loadDelegate.get(); … … 369 357 } 370 358 371 static void didFinishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef userData, const void* clientInfo) 372 { 373 if (!WKFrameIsMainFrame(frame)) 374 return; 375 359 static void didFinishNavigation(WKPageRef page, WKNavigationRef, WKTypeRef userData, const void* clientInfo) 360 { 376 361 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; 377 362 auto loadDelegate = browsingContext->_loadDelegate.get(); … … 381 366 } 382 367 383 static void didFailLoadWithErrorForFrame(WKPageRef page, WKFrameRef frame, WKErrorRef error, WKTypeRef userData, const void* clientInfo) 384 { 385 if (!WKFrameIsMainFrame(frame)) 386 return; 387 368 static void didFailNavigation(WKPageRef page, WKNavigationRef, WKErrorRef error, WKTypeRef userData, const void* clientInfo) 369 { 388 370 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; 389 371 auto loadDelegate = browsingContext->_loadDelegate.get(); … … 393 375 } 394 376 395 static bool canAuthenticateAgainstProtectionSpace InFrame(WKPageRef page, WKFrameRef frame, WKProtectionSpaceRef protectionSpace, const void *clientInfo)377 static bool canAuthenticateAgainstProtectionSpace(WKPageRef page, WKProtectionSpaceRef protectionSpace, const void *clientInfo) 396 378 { 397 379 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; … … 404 386 } 405 387 406 static void didReceiveAuthenticationChallenge InFrame(WKPageRef page, WKFrameRef frame, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo)388 static void didReceiveAuthenticationChallenge(WKPageRef page, WKAuthenticationChallengeRef authenticationChallenge, const void *clientInfo) 407 389 { 408 390 auto browsingContext = (__bridge WKBrowsingContextController *)clientInfo; … … 413 395 } 414 396 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 455 397 static void processDidCrash(WKPageRef page, const void* clientInfo) 456 398 { … … 464 406 static void setUpPageLoaderClient(WKBrowsingContextController *browsingContext, WebPageProxy& page) 465 407 { 466 WKPage LoaderClientV4loaderClient;408 WKPageNavigationClientV0 loaderClient; 467 409 memset(&loaderClient, 0, sizeof(loaderClient)); 468 410 469 loaderClient.base.version = 4;411 loaderClient.base.version = 0; 470 412 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); 489 424 } 490 425 … … 598 533 setUpPageLoaderClient(self, *_page); 599 534 else 600 WKPageSetPage LoaderClient(toAPI(_page.get()), nullptr);535 WKPageSetPageNavigationClient(toAPI(_page.get()), nullptr); 601 536 } 602 537 -
trunk/Source/WebKit/UIProcess/API/Cocoa/WKBrowsingContextLoadDelegate.h
r177760 r235368 54 54 - (void)browsingContextController:(WKBrowsingContextController *)sender didFailLoadWithError:(NSError *)error; 55 55 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)); 59 59 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)); 61 61 62 62 @end
Note:
See TracChangeset
for help on using the changeset viewer.