Changeset 202700 in webkit
- Timestamp:
- Jun 30, 2016 2:17:05 PM (8 years ago)
- Location:
- trunk/Source/WebKit2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit2/ChangeLog
r202696 r202700 1 2016-06-30 Brian Burg <bburg@apple.com> 2 3 REGRESSION(r202329): WebInspectorProxy's WKPagePolicyClient callbacks are not being called 4 https://bugs.webkit.org/show_bug.cgi?id=159308 5 <rdar://problem/27111764> 6 7 Reviewed by Tim Horton. 8 9 Adopt WKPageNavigationClient and ditch WKPolicyClient and WKPageLoaderClient. 10 After r202329, it's not possible to set a WKPolicyClient for a WKPage/WebPageProxy that backs a WKWebView. 11 12 * UIProcess/WebInspectorProxy.cpp: 13 (WebKit::isMainOrTestInspectorPage): Take a WebCore::ResourceRequest. 14 (WebKit::processDidCrash): Deleted. 15 (WebKit::webProcessDidCrash): Rename to match new client callback name. 16 (WebKit::decidePolicyForNavigationAction): Rework this to take new argument types. 17 (WebKit::WebInspectorProxy::eagerlyCreateInspectorPage): 18 Install a WKPageNavigationClient. 19 1 20 2016-06-30 Chris Dumez <cdumez@apple.com> 2 21 -
trunk/Source/WebKit2/UIProcess/WebInspectorProxy.cpp
r202611 r202700 28 28 #include "WebInspectorProxy.h" 29 29 30 #include "APINavigationAction.h" 30 31 #include "APIProcessPoolConfiguration.h" 31 #include "APIURLRequest.h"32 32 #include "WKArray.h" 33 33 #include "WKContextMenuItem.h" … … 355 355 } 356 356 357 static bool isMainOrTestInspectorPage(W KURLRequestRef requestRef)357 static bool isMainOrTestInspectorPage(WebCore::ResourceRequest& request) 358 358 { 359 359 // Use URL so we can compare the paths and protocols. 360 const URL& requestURL = toImpl(requestRef)->resourceRequest().url();360 const URL& requestURL = request.url(); 361 361 URL mainPageURL(URL(), WebInspectorProxy::inspectorPageURL()); 362 362 if (requestURL.protocol() == mainPageURL.protocol() && decodeURLEscapeSequences(requestURL.path()) == decodeURLEscapeSequences(mainPageURL.path())) … … 372 372 } 373 373 374 static void processDidCrash(WKPageRef, const void* clientInfo)374 static void webProcessDidCrash(WKPageRef, const void* clientInfo) 375 375 { 376 376 WebInspectorProxy* webInspectorProxy = static_cast<WebInspectorProxy*>(const_cast<void*>(clientInfo)); … … 379 379 } 380 380 381 static void decidePolicyForNavigationAction(WKPageRef , WKFrameRef frameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKFrameRef, WKURLRequestRef requestRef, WKFramePolicyListenerRef listenerRef, WKTypeRef, const void* clientInfo)381 static void decidePolicyForNavigationAction(WKPageRef pageRef, WKNavigationActionRef navigationActionRef, WKFramePolicyListenerRef listenerRef, WKTypeRef, const void* clientInfo) 382 382 { 383 383 // Allow non-main frames to navigate anywhere. 384 if (!toImpl(frameRef)->isMainFrame()) { 384 API::FrameInfo* sourceFrame = toImpl(navigationActionRef)->sourceFrame(); 385 if (sourceFrame && !sourceFrame->isMainFrame()) { 385 386 toImpl(listenerRef)->use(); 386 387 return; … … 390 391 ASSERT(webInspectorProxy); 391 392 393 WebCore::ResourceRequest request = toImpl(navigationActionRef)->request(); 394 392 395 // Allow loading of the main inspector file. 393 if (isMainOrTestInspectorPage(request Ref)) {396 if (isMainOrTestInspectorPage(request)) { 394 397 toImpl(listenerRef)->use(); 395 398 return; … … 400 403 401 404 // And instead load it in the inspected page. 402 webInspectorProxy->inspectedPage()->loadRequest( toImpl(requestRef)->resourceRequest());405 webInspectorProxy->inspectedPage()->loadRequest(request); 403 406 } 404 407 … … 462 465 pageLevelMap().set(m_inspectorPage, inspectionLevel()); 463 466 464 WKPagePolicyClientV1 policyClient = { 465 { 1, this }, 466 nullptr, // decidePolicyForNavigationAction_deprecatedForUseWithV0 467 nullptr, // decidePolicyForNewWindowAction 468 nullptr, // decidePolicyForResponse_deprecatedForUseWithV0 469 nullptr, // unableToImplementPolicy 467 WKPageNavigationClientV0 navigationClient = { 468 { 0, this }, 470 469 decidePolicyForNavigationAction, 471 nullptr, // decidePolicyForResponse 472 }; 473 474 WKPageLoaderClientV5 loaderClient = { 475 { 5, this }, 476 nullptr, // didStartProvisionalLoadForFrame 477 nullptr, // didReceiveServerRedirectForProvisionalLoadForFrame 478 nullptr, // didFailProvisionalLoadWithErrorForFrame 479 nullptr, // didCommitLoadForFrame 480 nullptr, // didFinishDocumentLoadForFrame 481 nullptr, // didFinishLoadForFrame 482 nullptr, // didFailLoadWithErrorForFrame 483 nullptr, // didSameDocumentNavigationForFrame 484 nullptr, // didReceiveTitleForFrame 485 nullptr, // didFirstLayoutForFrame 486 nullptr, // didFirstVisuallyNonEmptyLayoutForFrame 487 nullptr, // didRemoveFrameFromHierarchy 488 nullptr, // didDisplayInsecureContentForFrame 489 nullptr, // didRunInsecureContentForFrame 490 nullptr, // canAuthenticateAgainstProtectionSpaceInFrame 491 nullptr, // didReceiveAuthenticationChallengeInFrame 492 nullptr, // didStartProgress 493 nullptr, // didChangeProgress 494 nullptr, // didFinishProgress 495 nullptr, // didBecomeUnresponsive 496 nullptr, // didBecomeResponsive 497 processDidCrash, 498 nullptr, // didChangeBackForwardList 499 nullptr, // shouldGoToBackForwardListItem 500 nullptr, // didFailToInitializePlugin_deprecatedForUseWithV0 501 nullptr, // didDetectXSSForFrame 502 nullptr, // didNewFirstVisuallyNonEmptyLayout_unavailable 503 nullptr, // willGoToBackForwardListItem 504 nullptr, // interactionOccurredWhileProcessUnresponsive 505 nullptr, // pluginDidFail_deprecatedForUseWithV1 506 nullptr, // didReceiveIntentForFrame_unavailable 507 nullptr, // registerIntentServiceForFrame_unavailable 508 nullptr, // didLayout 509 nullptr, // pluginLoadPolicy_deprecatedForUseWithV2 510 nullptr, // pluginDidFail 511 nullptr, // pluginLoadPolicy 512 nullptr, // webGLLoadPolicy 513 nullptr, // resolveWebGLLoadPolicy 514 nullptr, // shouldKeepCurrentBackForwardListItemInList 470 nullptr, // decidePolicyForNavigationResponse 471 nullptr, // decidePolicyForPluginLoad 472 nullptr, // didStartProvisionalNavigation 473 nullptr, // didReceiveServerRedirectForProvisionalNavigation 474 nullptr, // didFailProvisionalNavigation 475 nullptr, // didCommitNavigation 476 nullptr, // didFinishNavigation 477 nullptr, // didFailNavigation 478 nullptr, // didFailProvisionalLoadInSubframe 479 nullptr, // didFinishDocumentLoad 480 nullptr, // didSameDocumentNavigation 481 nullptr, // renderingProgressDidChange 482 nullptr, // canAuthenticateAgainstProtectionSpace 483 nullptr, // didReceiveAuthenticationChallenge 484 webProcessDidCrash, 485 nullptr, // copyWebCryptoMasterKey 486 487 nullptr, // didBeginNavigationGesture 488 nullptr, // willEndNavigationGesture 489 nullptr, // didEndNavigationGesture 490 nullptr, // didRemoveNavigationGestureSnapshot 515 491 }; 516 492 517 493 WKPageContextMenuClientV3 contextMenuClient = { 518 494 { 3, this }, 519 0, // getContextMenuFromProposedMenu_deprecatedForUseWithV0520 0, // customContextMenuItemSelected521 0, // contextMenuDismissed495 nullptr, // getContextMenuFromProposedMenu_deprecatedForUseWithV0 496 nullptr, // customContextMenuItemSelected 497 nullptr, // contextMenuDismissed 522 498 getContextMenuFromProposedMenu, 523 0, // showContextMenu524 0, // hideContextMenu499 nullptr, // showContextMenu 500 nullptr, // hideContextMenu 525 501 }; 526 502 527 WKPageSetPagePolicyClient(toAPI(m_inspectorPage), &policyClient.base); 528 WKPageSetPageLoaderClient(toAPI(m_inspectorPage), &loaderClient.base); 503 WKPageSetPageNavigationClient(toAPI(m_inspectorPage), &navigationClient.base); 529 504 WKPageSetPageContextMenuClient(toAPI(m_inspectorPage), &contextMenuClient.base); 530 505
Note: See TracChangeset
for help on using the changeset viewer.