Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0eb1707b5f2106c7b18204f2a772afc102abbf74
      
https://github.com/WebKit/WebKit/commit/0eb1707b5f2106c7b18204f2a772afc102abbf74
  Author: Charlie Wolfe <[email protected]>
  Date:   2026-10-01 (Thu, 01 Oct 2026)

  Changed paths:
    M Source/WebKit/UIProcess/WebPageProxy.cpp
    M Source/WebKit/UIProcess/WebProcessCache.cpp
    M Source/WebKit/UIProcess/WebProcessCache.h
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Source/WebKit/UIProcess/WebProcessPool.h
    M Source/WebKit/UIProcess/WebProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessProxy.h
    M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ProcessSwapOnNavigation.mm

  Log Message:
  -----------
  Cache web processes used for COOP swaps by origin so they can be reused
https://bugs.webkit.org/show_bug.cgi?id=325879
rdar://188866253

Reviewed by Ben Nham.

Processes created for a COOP browsing context group switch were marked 
ineligible for the web
process cache, so every COOP navigation spawned a new process. This change 
keeps a separate cache of
COOP processes keyed by exact origin. These processes are only reused for a 
later COOP swap to the
same origin, and never for site-based lookups.

~3.7% overall PLT improvement.

Test: Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ProcessSwapOnNavigation.mm

* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::triggerBrowsingContextGroupSwitchForNavigation):
* Source/WebKit/UIProcess/WebProcessCache.cpp:
(WebKit::WebProcessCache::addProcess):
(WebKit::WebProcessCache::evictAtRandomIfNeeded):
(WebKit::WebProcessCache::takeCOOPProcess):
(WebKit::WebProcessCache::clear):
(WebKit::WebProcessCache::clearAllProcessesForSession):
(WebKit::WebProcessCache::removeProcess):
* Source/WebKit/UIProcess/WebProcessCache.h:
* Source/WebKit/UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::processForSite):
* Source/WebKit/UIProcess/WebProcessPool.h:
* Source/WebKit/UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didCommitMainFrameLoad):
(WebKit::WebProcessProxy::didCommitMainFrameLoadWithoutSiteIsolation): Deleted.
* Source/WebKit/UIProcess/WebProcessProxy.h:
* Tools/TestWebKitAPI/Tests/WebKit/WKWebView/ProcessSwapOnNavigation.mm:
((ProcessSwap, UseWebProcessCacheForCOOPSwapToSameOrigin)):
((ProcessSwap, UseWebProcessCacheForCOOPSwapToSameOriginWithSiteIsolation)):
((ProcessSwap, DoNotUseWebProcessCacheForCOOPSwapAfterCommittingOtherOrigin)):
((ProcessSwap, 
DoNotUseWebProcessCacheForCOOPSwapAfterCommittingOtherOriginWithSiteIsolation)):

Canonical link: https://commits.webkit.org/322438@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to