Changeset 254884 in webkit
- Timestamp:
- Jan 21, 2020 2:51:41 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r254883 r254884 1 2020-01-21 Jiewen Tan <jiewen_tan@apple.com> 2 3 ProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPolicy flag to WebPageProxy 4 https://bugs.webkit.org/show_bug.cgi?id=206462 5 <rdar://problem/57468718> 6 7 Reviewed by Chris Dumez. 8 9 Covered by API tests. 10 11 This patch also does it for ProvisionalPageProxy::loadRequest. 12 13 * UIProcess/ProvisionalPageProxy.cpp: 14 (WebKit::ProvisionalPageProxy::loadData): 15 (WebKit::ProvisionalPageProxy::loadRequest): 16 * UIProcess/ProvisionalPageProxy.h: 17 * UIProcess/WebPageProxy.cpp: 18 (WebKit::WebPageProxy::continueNavigationInNewProcess): 19 1 20 2020-01-21 Rob Buis <rbuis@igalia.com> 2 21 -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
r253360 r254884 153 153 RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "loadData: pageProxyID=%" PRIu64 " webPageID=%" PRIu64, m_page.identifier().toUInt64(), m_webPageID.toUInt64()); 154 154 155 m_page.loadDataWithNavigationShared(m_process.copyRef(), m_webPageID, navigation, data, MIMEType, encoding, baseURL, userData, WebCore::ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies) );156 } 157 158 void ProvisionalPageProxy::loadRequest(API::Navigation& navigation, WebCore::ResourceRequest&& request, WebCore::ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy,API::Object* userData, Optional<WebsitePoliciesData>&& websitePolicies)155 m_page.loadDataWithNavigationShared(m_process.copyRef(), m_webPageID, navigation, data, MIMEType, encoding, baseURL, userData, WebCore::ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies), navigation.lastNavigationAction().shouldOpenExternalURLsPolicy); 156 } 157 158 void ProvisionalPageProxy::loadRequest(API::Navigation& navigation, WebCore::ResourceRequest&& request, API::Object* userData, Optional<WebsitePoliciesData>&& websitePolicies) 159 159 { 160 160 RELEASE_LOG_IF_ALLOWED(ProcessSwapping, "loadRequest: pageProxyID=%" PRIu64 " webPageID=%" PRIu64, m_page.identifier().toUInt64(), m_webPageID.toUInt64()); … … 166 166 navigation.fromItem()->setLastProcessIdentifier(m_process->coreProcessIdentifier()); 167 167 168 m_page.loadRequestWithNavigationShared(m_process.copyRef(), m_webPageID, navigation, WTFMove(request), shouldOpenExternalURLsPolicy, userData, WebCore::ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies));168 m_page.loadRequestWithNavigationShared(m_process.copyRef(), m_webPageID, navigation, WTFMove(request), navigation.lastNavigationAction().shouldOpenExternalURLsPolicy, userData, WebCore::ShouldTreatAsContinuingLoad::Yes, WTFMove(websitePolicies)); 169 169 } 170 170 -
trunk/Source/WebKit/UIProcess/ProvisionalPageProxy.h
r253346 r254884 93 93 94 94 void loadData(API::Navigation&, const IPC::DataReference&, const String& MIMEType, const String& encoding, const String& baseURL, API::Object* userData, Optional<WebsitePoliciesData>&& = WTF::nullopt); 95 void loadRequest(API::Navigation&, WebCore::ResourceRequest&&, WebCore::ShouldOpenExternalURLsPolicy,API::Object* userData, Optional<WebsitePoliciesData>&& = WTF::nullopt);95 void loadRequest(API::Navigation&, WebCore::ResourceRequest&&, API::Object* userData, Optional<WebsitePoliciesData>&& = WTF::nullopt); 96 96 void goToBackForwardItem(API::Navigation&, WebBackForwardListItem&, Optional<WebsitePoliciesData>&&); 97 97 void cancel(); -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r254877 r254884 3210 3210 m_provisionalPage->loadData(navigation, { substituteData->content.data(), substituteData->content.size() }, substituteData->MIMEType, substituteData->encoding, substituteData->baseURL, substituteData->userData.get(), WTFMove(websitePolicies)); 3211 3211 else 3212 m_provisionalPage->loadRequest(navigation, ResourceRequest { navigation->currentRequest() }, WebCore::ShouldOpenExternalURLsPolicy::ShouldAllowExternalSchemes,nullptr, WTFMove(websitePolicies));3212 m_provisionalPage->loadRequest(navigation, ResourceRequest { navigation->currentRequest() }, nullptr, WTFMove(websitePolicies)); 3213 3213 }; 3214 3214 if (m_inspectorController->shouldPauseLoading(*m_provisionalPage)) -
trunk/Tools/ChangeLog
r254883 r254884 1 2020-01-21 Jiewen Tan <jiewen_tan@apple.com> 2 3 ProvisionalPageProxy::loadData should pass last navigation's shouldOpenExternalURLsPolicy flag to WebPageProxy 4 https://bugs.webkit.org/show_bug.cgi?id=206462 5 <rdar://problem/57468718> 6 7 Reviewed by Chris Dumez. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm: 10 (TestWebKitAPI::TEST): 11 1 12 2020-01-21 Rob Buis <rbuis@igalia.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TestSOAuthorization.mm
r250416 r254884 1017 1017 } 1018 1018 1019 TEST(SOAuthorizationRedirect, InterceptionSucceedSAMLWithPSON) 1020 { 1021 resetState(); 1022 ClassMethodSwizzler swizzler1(PAL::getSOAuthorizationClass(), @selector(canPerformAuthorizationWithURL:responseCode:), reinterpret_cast<IMP>(overrideCanPerformAuthorizationWithURL)); 1023 InstanceMethodSwizzler swizzler2(PAL::getSOAuthorizationClass(), @selector(setDelegate:), reinterpret_cast<IMP>(overrideSetDelegate)); 1024 InstanceMethodSwizzler swizzler3(PAL::getSOAuthorizationClass(), @selector(beginAuthorizationWithURL:httpHeaders:httpBody:), reinterpret_cast<IMP>(overrideBeginAuthorizationWithURL)); 1025 1026 RetainPtr<NSURL> baseURL = [[NSBundle mainBundle] URLForResource:@"simple3" withExtension:@"html" subdirectory:@"TestWebKitAPI.resources"]; 1027 auto testURL = URL(URL(), "http://www.example.com"); 1028 1029 auto webView = adoptNS([[TestWKWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 500)]); 1030 auto delegate = adoptNS([[TestSOAuthorizationDelegate alloc] init]); 1031 configureSOAuthorizationWebView(webView.get(), delegate.get(), OpenExternalSchemesPolicy::Allow); 1032 1033 [webView loadRequest:[NSURLRequest requestWithURL:baseURL.get()]]; 1034 Util::run(&navigationCompleted); 1035 1036 // PSON: file:/// => example.com 1037 [webView loadRequest:[NSURLRequest requestWithURL:(NSURL *)testURL]]; 1038 Util::run(&authorizationPerformed); 1039 1040 navigationCompleted = false; 1041 // Pass a HTTP 200 response with a html to mimic a SAML response. 1042 auto response = adoptNS([[NSHTTPURLResponse alloc] initWithURL:(NSURL *)testURL statusCode:200 HTTPVersion:@"HTTP/1.1" headerFields:nil]); 1043 [gDelegate authorization:gAuthorization didCompleteWithHTTPResponse:response.get() httpBody:adoptNS([[NSData alloc] initWithBytes:samlResponse length:strlen(samlResponse)]).get()]; 1044 Util::run(&navigationCompleted); 1045 1046 authorizationPerformed = false; 1047 navigationPolicyDecided = false; 1048 [webView _evaluateJavaScriptWithoutUserGesture:@"location = 'http://www.example.com'" completionHandler:nil]; 1049 Util::run(&navigationPolicyDecided); 1050 } 1051 1019 1052 TEST(SOAuthorizationRedirect, AuthorizationOptions) 1020 1053 {
Note: See TracChangeset
for help on using the changeset viewer.