Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3684d814f24ed972b5a89f9e0d12bb882be4400b
https://github.com/WebKit/WebKit/commit/3684d814f24ed972b5a89f9e0d12bb882be4400b
Author: Alex Christensen <[email protected]>
Date: 2026-09-15 (Tue, 15 Sep 2026)
Changed paths:
M Source/WebKit/Shared/FrameInfoData.cpp
M Source/WebKit/Shared/FrameInfoData.h
M Source/WebKit/Shared/FrameInfoData.serialization.in
M Source/WebKit/UIProcess/API/APIFrameInfo.cpp
M Source/WebKit/UIProcess/API/APIFrameInfo.h
M Source/WebKit/UIProcess/API/Cocoa/WKFrameInfo.mm
M Source/WebKit/UIProcess/ProvisionalPageProxy.cpp
M Source/WebKit/UIProcess/WebFrameProxy.cpp
M Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
M Source/WebKit/WebProcess/WebPage/WebFrame.cpp
M Source/WebKit/WebProcess/WebPage/WebFrame.h
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
Log Message:
-----------
Use certificate info from network process instead of web content process for
WKFrameInfo
https://bugs.webkit.org/show_bug.cgi?id=324184
rdar://187404896
Reviewed by Ben Nham.
In 290521@main I added an SPI way to access a frame's certificate info, but it
was found to be
a significant performance regression serializing large certificate chains for
each callback
that has a WKFrameInfo, so in 293073@main I restricted it to only the callbacks
where it was needed.
In 298413@main we added another case where the certificate info was available
with tests in 298455@main
but we still didn't have a good path to making this a good abstraction. An
object with a property
that is only there sometimes even though it is conceptually always there isn't
a good design.
In 316854@main I made it so we send CertificateInfo straight from the network
process to the
UI process. In several commits since then I've fixed things that were broken
by that change,
but I now think it's pretty stable and reliable.
In 316322@main we introduced a check that the certificate info received from
the web content
process was reasonable, except we used operator== to compare them which always
failed because
it used pointer comparison instead of something like certificatesMatch, which
would probably
be too expensive. The result of that check was that we were already taking the
certificate
info from the WebFrameProxy, so in that regard this is not a change in behavior.
This PR removes CertificateInfo from FrameInfoData. That solves the issue of
the expensive
serialization of large certificate chains in the many callbacks that offer a
WKFrameInfo.
It gets the certificate info for each API::FrameInfo using a cheap hash lookup
and a RetainPtr
constructor, which eliminates the reason we restricted its availability with
WithCertificateInfo
and now we always have a CertificateInfo when the frame's main resource was
loaded over https.
Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm
* Source/WebKit/Shared/FrameInfoData.cpp:
(WebKit::legacyEmptyFrameInfo):
* Source/WebKit/Shared/FrameInfoData.h:
* Source/WebKit/Shared/FrameInfoData.serialization.in:
* Source/WebKit/UIProcess/API/APIFrameInfo.cpp:
(API::certificateInfoFromFrameID):
(API::FrameInfo::FrameInfo):
* Source/WebKit/UIProcess/API/APIFrameInfo.h:
* Source/WebKit/UIProcess/API/Cocoa/WKFrameInfo.mm:
(-[WKFrameInfo _serverTrust]):
* Source/WebKit/UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::cancel):
* Source/WebKit/UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::getFrameInfo):
* Source/WebKit/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::navigationActionData const):
* Source/WebKit/WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::getFrameInfo):
(WebKit::WebFrame::info const):
* Source/WebKit/WebProcess/WebPage/WebFrame.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::getFrameTreeForBackForwardCacheEntry):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::focusedElementInformationWithoutLayout):
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/SiteIsolation.mm:
(TestWebKitAPI::TEST(SiteIsolation, FrameServerTrust)):
Canonical link: https://commits.webkit.org/321220@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications