Changeset 256073 in webkit
- Timestamp:
- Feb 7, 2020 3:30:29 PM (4 years ago)
- Location:
- trunk
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r256066 r256073 1 2020-02-07 Alex Christensen <achristensen@apple.com> 2 3 Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content 4 https://bugs.webkit.org/show_bug.cgi?id=207409 5 rdar://problem/59275641 6 7 Reviewed by Chris Dumez. 8 9 Covered by an API test. 10 11 * history/CachedFrame.cpp: 12 (WebCore::CachedFrame::setHasInsecureContent): 13 * history/CachedFrame.h: 14 (WebCore::CachedFrame::usedLegacyTLS const): 15 * loader/EmptyFrameLoaderClient.h: 16 * loader/FrameLoader.cpp: 17 (WebCore::FrameLoader::receivedFirstData): 18 (WebCore::FrameLoader::commitProvisionalLoad): 19 (WebCore::FrameLoader::dispatchDidCommitLoad): 20 * loader/FrameLoader.h: 21 * loader/FrameLoaderClient.h: 22 1 23 2020-02-07 Ryan Haddad <ryanhaddad@apple.com> 2 24 -
trunk/Source/WebCore/history/CachedFrame.cpp
r251924 r256073 303 303 } 304 304 305 void CachedFrame::setHasInsecureContent(HasInsecureContent hasInsecureContent )305 void CachedFrame::setHasInsecureContent(HasInsecureContent hasInsecureContent, UsedLegacyTLS usedLegacyTLS) 306 306 { 307 307 m_hasInsecureContent = hasInsecureContent; 308 m_usedLegacyTLS = usedLegacyTLS; 308 309 } 309 310 -
trunk/Source/WebCore/history/CachedFrame.h
r239427 r256073 40 40 class Node; 41 41 enum class HasInsecureContent : bool; 42 enum class UsedLegacyTLS : bool; 42 43 43 44 class CachedFrameBase { … … 64 65 bool m_isMainFrame; 65 66 Optional<HasInsecureContent> m_hasInsecureContent; 67 Optional<UsedLegacyTLS> m_usedLegacyTLS; 66 68 67 69 Vector<std::unique_ptr<CachedFrame>> m_childFrames; … … 80 82 WEBCORE_EXPORT CachedFramePlatformData* cachedFramePlatformData(); 81 83 82 WEBCORE_EXPORT void setHasInsecureContent(HasInsecureContent );84 WEBCORE_EXPORT void setHasInsecureContent(HasInsecureContent, UsedLegacyTLS); 83 85 Optional<HasInsecureContent> hasInsecureContent() const { return m_hasInsecureContent; } 86 Optional<UsedLegacyTLS> usedLegacyTLS() const { return m_usedLegacyTLS; } 84 87 85 88 using CachedFrameBase::document; -
trunk/Source/WebCore/loader/EmptyFrameLoaderClient.h
r251488 r256073 90 90 void dispatchDidStartProvisionalLoad() final { } 91 91 void dispatchDidReceiveTitle(const StringWithDirection&) final { } 92 void dispatchDidCommitLoad(Optional<HasInsecureContent> ) final { }92 void dispatchDidCommitLoad(Optional<HasInsecureContent>, Optional<UsedLegacyTLS>) final { } 93 93 void dispatchDidFailProvisionalLoad(const ResourceError&, WillContinueLoading) final { } 94 94 void dispatchDidFailLoad(const ResourceError&) final { } -
trunk/Source/WebCore/loader/FrameLoader.cpp
r255961 r256073 706 706 void FrameLoader::receivedFirstData() 707 707 { 708 dispatchDidCommitLoad(WTF::nullopt );708 dispatchDidCommitLoad(WTF::nullopt, WTF::nullopt); 709 709 dispatchDidClearWindowObjectsInAllWorlds(); 710 710 dispatchGlobalObjectAvailableInAllWorlds(); … … 2073 2073 2074 2074 Optional<HasInsecureContent> hasInsecureContent = cachedPage->cachedMainFrame()->hasInsecureContent(); 2075 2076 dispatchDidCommitLoad(hasInsecureContent); 2075 Optional<UsedLegacyTLS> usedLegacyTLS = cachedPage->cachedMainFrame()->usedLegacyTLS(); 2076 2077 dispatchDidCommitLoad(hasInsecureContent, usedLegacyTLS); 2077 2078 2078 2079 // FIXME: This API should be turned around so that we ground CachedPage into the Page. … … 4008 4009 } 4009 4010 4010 void FrameLoader::dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent )4011 void FrameLoader::dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent, Optional<UsedLegacyTLS> initialUsedLegacyTLS) 4011 4012 { 4012 4013 if (m_stateMachine.creatingInitialEmptyDocument()) 4013 4014 return; 4014 4015 4015 m_client.dispatchDidCommitLoad(initialHasInsecureContent );4016 m_client.dispatchDidCommitLoad(initialHasInsecureContent, initialUsedLegacyTLS); 4016 4017 4017 4018 if (m_frame.isMainFrame()) { -
trunk/Source/WebCore/loader/FrameLoader.h
r253964 r256073 88 88 enum class NavigationPolicyDecision : uint8_t; 89 89 enum class ShouldTreatAsContinuingLoad : bool; 90 enum class UsedLegacyTLS : bool; 90 91 91 92 struct WindowFeatures; … … 378 379 bool shouldReloadToHandleUnreachableURL(DocumentLoader&); 379 380 380 void dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent );381 void dispatchDidCommitLoad(Optional<HasInsecureContent> initialHasInsecureContent, Optional<UsedLegacyTLS> initialUsedLegacyTLS); 381 382 382 383 void urlSelected(FrameLoadRequest&&, Event*, Optional<AdClickAttribution>&& = WTF::nullopt); -
trunk/Source/WebCore/loader/FrameLoaderClient.h
r254064 r256073 103 103 enum class LockBackForwardList : bool; 104 104 enum class PolicyDecisionMode; 105 enum class UsedLegacyTLS : bool; 105 106 106 107 struct StringWithDirection; … … 174 175 virtual void dispatchDidStartProvisionalLoad() = 0; 175 176 virtual void dispatchDidReceiveTitle(const StringWithDirection&) = 0; 176 virtual void dispatchDidCommitLoad(Optional<HasInsecureContent> ) = 0;177 virtual void dispatchDidCommitLoad(Optional<HasInsecureContent>, Optional<UsedLegacyTLS>) = 0; 177 178 virtual void dispatchDidFailProvisionalLoad(const ResourceError&, WillContinueLoading) = 0; 178 179 virtual void dispatchDidFailLoad(const ResourceError&) = 0; -
trunk/Source/WebKit/ChangeLog
r256072 r256073 1 2020-02-07 Alex Christensen <achristensen@apple.com> 2 3 Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content 4 https://bugs.webkit.org/show_bug.cgi?id=207409 5 rdar://problem/59275641 6 7 Reviewed by Chris Dumez. 8 9 * Scripts/webkit/messages.py: 10 * UIProcess/WebPageProxy.cpp: 11 (WebKit::WebPageProxy::hasInsecureContent): 12 * UIProcess/WebPageProxy.h: 13 * UIProcess/WebPageProxy.messages.in: 14 * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: 15 (WebKit::WebFrameLoaderClient::dispatchDidCommitLoad): 16 (WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame): 17 * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: 18 1 19 2020-02-07 Wenson Hsieh <wenson_hsieh@apple.com> 2 20 -
trunk/Source/WebKit/Scripts/webkit/messages.py
r255133 r256073 603 603 'WebCore::ThirdPartyCookieBlockingMode': ['<WebCore/NetworkStorageSession.h>'], 604 604 'WebCore::FirstPartyWebsiteDataRemovalMode': ['<WebCore/NetworkStorageSession.h>'], 605 'WebCore::UsedLegacyTLS': ['<WebCore/ResourceResponseBase.h>'], 605 606 'WebCore::ViewportAttributes': ['<WebCore/ViewportArguments.h>'], 606 607 'WebCore::WillContinueLoading': ['<WebCore/FrameLoaderTypes.h>'], -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r255992 r256073 4225 4225 } 4226 4226 4227 void WebPageProxy::hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent)>&& completionHandler) 4228 { 4229 completionHandler(m_pageLoadState.committedHasInsecureContent() ? HasInsecureContent::Yes : HasInsecureContent::No); 4227 void WebPageProxy::hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent, WebCore::UsedLegacyTLS)>&& completionHandler) 4228 { 4229 completionHandler( 4230 m_pageLoadState.committedHasInsecureContent() ? HasInsecureContent::Yes : HasInsecureContent::No, 4231 m_pageLoadState.hasNegotiatedLegacyTLS() ? UsedLegacyTLS::Yes : UsedLegacyTLS::No 4232 ); 4230 4233 } 4231 4234 -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r255992 r256073 1761 1761 void setNetworkRequestsInProgress(bool); 1762 1762 1763 void hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent )>&&);1763 void hasInsecureContent(CompletionHandler<void(WebCore::HasInsecureContent, WebCore::UsedLegacyTLS)>&&); 1764 1764 1765 1765 void didDestroyNavigation(uint64_t navigationID); -
trunk/Source/WebKit/UIProcess/WebPageProxy.messages.in
r255846 r256073 143 143 DidDestroyNavigation(uint64_t navigationID) 144 144 145 HasInsecureContent() -> (enum:bool WebCore::HasInsecureContent hasInsecureContent ) Synchronous145 HasInsecureContent() -> (enum:bool WebCore::HasInsecureContent hasInsecureContent, enum:bool WebCore::UsedLegacyTLS usedLegacyTLS) Synchronous 146 146 147 147 MainFramePluginHandlesPageScaleGestureDidChange(bool mainFramePluginHandlesPageScaleGesture) -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
r255846 r256073 546 546 } 547 547 548 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent> hasInsecureContent )548 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent> hasInsecureContent, Optional<UsedLegacyTLS> usedLegacyTLSFromPageCache) 549 549 { 550 550 WebPage* webPage = m_frame->page(); … … 560 560 webPage->sandboxExtensionTracker().didCommitProvisionalLoad(m_frame); 561 561 562 bool usedLegacyTLS = documentLoader.response().usedLegacyTLS(); 563 if (!usedLegacyTLS && usedLegacyTLSFromPageCache) 564 usedLegacyTLS = usedLegacyTLSFromPageCache == UsedLegacyTLS::Yes; 565 562 566 // Notify the UIProcess. 563 webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), valueOrCompute(documentLoader.response().certificateInfo(), [] { return CertificateInfo(); }), documentLoader.response().usedLegacyTLS(), m_frame->coreFrame()->document()->isPluginDocument(), hasInsecureContent, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get())));567 webPage->send(Messages::WebPageProxy::DidCommitLoadForFrame(m_frame->frameID(), documentLoader.navigationID(), documentLoader.response().mimeType(), m_frameHasCustomContentProvider, static_cast<uint32_t>(m_frame->coreFrame()->loader().loadType()), valueOrCompute(documentLoader.response().certificateInfo(), [] { return CertificateInfo(); }), usedLegacyTLS, m_frame->coreFrame()->document()->isPluginDocument(), hasInsecureContent, UserData(WebProcess::singleton().transformObjectsToHandles(userData.get()).get()))); 564 568 webPage->didCommitLoad(m_frame); 565 569 } … … 1468 1472 1469 1473 HasInsecureContent hasInsecureContent; 1470 if (webPage->sendSync(Messages::WebPageProxy::HasInsecureContent(), Messages::WebPageProxy::HasInsecureContent::Reply(hasInsecureContent))) 1471 cachedFrame->setHasInsecureContent(hasInsecureContent); 1474 UsedLegacyTLS usedLegacyTLS; 1475 if (webPage->sendSync(Messages::WebPageProxy::HasInsecureContent(), Messages::WebPageProxy::HasInsecureContent::Reply(hasInsecureContent, usedLegacyTLS))) 1476 cachedFrame->setHasInsecureContent(hasInsecureContent, usedLegacyTLS); 1472 1477 } 1473 1478 -
trunk/Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.h
r251787 r256073 115 115 void dispatchDidStartProvisionalLoad() final; 116 116 void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) final; 117 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent> ) final;117 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>, Optional<WebCore::UsedLegacyTLS>) final; 118 118 void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&, WebCore::WillContinueLoading) final; 119 119 void dispatchDidFailLoad(const WebCore::ResourceError&) final; -
trunk/Source/WebKitLegacy/mac/ChangeLog
r256066 r256073 1 2020-02-07 Alex Christensen <achristensen@apple.com> 2 3 Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content 4 https://bugs.webkit.org/show_bug.cgi?id=207409 5 rdar://problem/59275641 6 7 Reviewed by Chris Dumez. 8 9 * WebCoreSupport/WebFrameLoaderClient.h: 10 * WebCoreSupport/WebFrameLoaderClient.mm: 11 (WebFrameLoaderClient::dispatchDidCommitLoad): 12 1 13 2020-02-07 Ryan Haddad <ryanhaddad@apple.com> 2 14 -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.h
r251488 r256073 116 116 void dispatchDidStartProvisionalLoad() final; 117 117 void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) final; 118 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent> ) final;118 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>, Optional<WebCore::UsedLegacyTLS>) final; 119 119 void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&, WebCore::WillContinueLoading) final; 120 120 void dispatchDidFailLoad(const WebCore::ResourceError&) final; -
trunk/Source/WebKitLegacy/mac/WebCoreSupport/WebFrameLoaderClient.mm
r255226 r256073 699 699 } 700 700 701 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent> )701 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>, Optional<WebCore::UsedLegacyTLS>) 702 702 { 703 703 // Tell the client we've committed this URL. -
trunk/Source/WebKitLegacy/win/ChangeLog
r255961 r256073 1 2020-02-07 Alex Christensen <achristensen@apple.com> 2 3 Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content 4 https://bugs.webkit.org/show_bug.cgi?id=207409 5 rdar://problem/59275641 6 7 Reviewed by Chris Dumez. 8 9 * WebCoreSupport/WebFrameLoaderClient.cpp: 10 (WebFrameLoaderClient::dispatchDidCommitLoad): 11 * WebCoreSupport/WebFrameLoaderClient.h: 12 1 13 2020-02-06 Brent Fulgham <bfulgham@apple.com> 2 14 -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.cpp
r253135 r256073 439 439 } 440 440 441 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent> )441 void WebFrameLoaderClient::dispatchDidCommitLoad(Optional<HasInsecureContent>, Optional<UsedLegacyTLS>) 442 442 { 443 443 WebView* webView = m_webFrame->webView(); -
trunk/Source/WebKitLegacy/win/WebCoreSupport/WebFrameLoaderClient.h
r253135 r256073 93 93 void dispatchDidStartProvisionalLoad() override; 94 94 void dispatchDidReceiveTitle(const WebCore::StringWithDirection&) override; 95 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent> ) override;95 void dispatchDidCommitLoad(Optional<WebCore::HasInsecureContent>, Optional<WebCore::UsedLegacyTLS>) override; 96 96 void dispatchDidFailProvisionalLoad(const WebCore::ResourceError&, WebCore::WillContinueLoading) override; 97 97 void dispatchDidFailLoad(const WebCore::ResourceError&) override; -
trunk/Tools/ChangeLog
r256066 r256073 1 2020-02-07 Alex Christensen <achristensen@apple.com> 2 3 Remember if we used legacy TLS in the back/forward cache like we remember if we have only secure content 4 https://bugs.webkit.org/show_bug.cgi?id=207409 5 rdar://problem/59275641 6 7 Reviewed by Chris Dumez. 8 9 * TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm: 10 (TestWebKitAPI::TEST): 11 1 12 2020-02-07 Ryan Haddad <ryanhaddad@apple.com> 2 13 -
trunk/Tools/TestWebKitAPI/Tests/WebKitCocoa/TLSDeprecation.mm
r255880 r256073 313 313 314 314 HTTPServer modernTLSServer({ 315 { "/", { makeString("<script>fetch('https://127.0.0.1:", static_cast<unsigned>(legacyTLSServer.port()), "/',{mode:'no-cors'})</script>") } } 315 { "/", { makeString("<script>fetch('https://127.0.0.1:", static_cast<unsigned>(legacyTLSServer.port()), "/',{mode:'no-cors'})</script>") } }, 316 { "/pageWithoutSubresource", { "hello" }} 316 317 }, HTTPServer::Protocol::Https); 317 318 … … 324 325 while (![webView _negotiatedLegacyTLS]) 325 326 [observer waitUntilNegotiatedLegacyTLSChanged]; 327 328 EXPECT_TRUE([webView _negotiatedLegacyTLS]); 329 [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://127.0.0.1:%d/pageWithoutSubresource", modernTLSServer.port()]]]]; 330 [delegate waitForDidFinishNavigation]; 331 EXPECT_FALSE([webView _negotiatedLegacyTLS]); 332 333 [webView goBack]; 334 [delegate waitForDidFinishNavigation]; 335 EXPECT_TRUE([webView _negotiatedLegacyTLS]); 326 336 327 337 [webView removeObserver:observer.get() forKeyPath:@"_negotiatedLegacyTLS"];
Note: See TracChangeset
for help on using the changeset viewer.