Skip to content

Commit

Permalink
Cherry-pick b6a2c10. rdar://123640341
Browse files Browse the repository at this point in the history
    Preload restricted window opener data
    https://bugs.webkit.org/show_bug.cgi?id=270106
    rdar://123640341

    Reviewed by Wenson Hsieh.

    The first call to check for the restricted opener type for a domain currently always claims that the
    domain should have an unrestricted opener. This is because we load the list of restricted openers
    from WebPrivacy both lazily and asynchronously.

    To make it much more likely that the first call has up-to-date data, we now load the data in
    `WebProcessPool::didReachGoodTimeToPrewarm`.

    * Source/WebKit/UIProcess/WebProcessPool.cpp:
    (WebKit::loadRestrictedOpenerTypeDataIfNeeded):
    (WebKit::WebProcessPool::didReachGoodTimeToPrewarm):

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

Canonical link: https://commits.webkit.org/274941.47@safari-7619.1.5-branch
  • Loading branch information
bnham authored and rjepstein committed Feb 28, 2024
1 parent 4c9ff96 commit aa2ff44
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Source/WebKit/UIProcess/WebProcessPool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1368,8 +1368,17 @@ void WebProcessPool::postMessageToInjectedBundle(const String& messageName, API:
}
}

static void loadRestrictedOpenerTypeDataIfNeeded()
{
#if ENABLE(ADVANCED_PRIVACY_PROTECTIONS)
RestrictedOpenerDomainsController::shared();
#endif
}

void WebProcessPool::didReachGoodTimeToPrewarm()
{
loadRestrictedOpenerTypeDataIfNeeded();

if (!configuration().isAutomaticProcessWarmingEnabled() || !configuration().processSwapsOnNavigation() || usesSingleWebProcess())
return;

Expand Down

0 comments on commit aa2ff44

Please sign in to comment.