Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 370bb39b1eb902b87a1d62296916573ef368aca0
https://github.com/WebKit/WebKit/commit/370bb39b1eb902b87a1d62296916573ef368aca0
Author: Franco Vieira de Souza <[email protected]>
Date: 2026-06-11 (Thu, 11 Jun 2026)
Changed paths:
M Source/WebKit/UIProcess/API/APINavigation.h
M Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp
M Source/WebKit/UIProcess/WebFramePolicyListenerProxy.h
M Source/WebKit/UIProcess/WebPageProxy.cpp
Log Message:
-----------
Deliver delayed safebrowsing results before timeout
https://bugs.webkit.org/show_bug.cgi?id=312807
rdar://179032738
Reviewed by Pascoe.
Schedule for didReceiveSafeBrowsingResults() to run when
SafeBrowsing results arrive, with whenSafeBrowsingCheckCompletes().
This fixes a race that can cause the UIProcess to wait for a
timeout instead of delivering SafeBrowsing lookup results as soon
as the answer becomes available. The previous behavior could
harm load time.
The race triggers if the page responded faster than the SafeBrowsing
service. Here's a breakdown of the (now removed) race:
1) Navigation to an URL is triggered
2) PolicyChecker::checkNavigationPolicy() validates the navigation
action. It also starts a SafeBrowsing lookup
(WebPageProxy::beginSafeBrowsingCheck()), but doesn't wait on
it - results are simply parked for later use
3) If the policy check (which is *not* the SafeBrowsing check) is ok,
the page is requested
4) Resource arrives, now the WebContent process requests the
SafeBrowsing results before committing the load
5) UIProcess (who owns the SafeBrowsing logic) receives IPC requesting
the SafeBrowsing answer. Answer is provided immediately, if
available. If not available, a timeout handler to send an answer
is queued. Receiving SafeBrowsing results before the timeout causes
the appropriate state to be set (which may cause an the warning to
be shown), but does not expedite the response. The response is only
sent after the deadline, which is
`timeout = (MonotonicTime::now() - requestStart) * 1.5 + 0.25_s`
6) The navigation is only committed when the SafeBrowsing results
are received by the WebContent process. Only after this can the
page begin to be parsed
A minor refactor on WebFramePolicyListenerProxy was also included,
reflecting how SafeBrowsing results are no longer sent through
this class.
Canonical link: https://commits.webkit.org/315035@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications