[webkit-changes] [WebKit/WebKit] 31d01d: Initialize organization storage access prompt quir...

Matthew Finkel noreply at github.com
Thu Mar 14 06:18:52 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 31d01d86c4f5bbc1dabc06aaf23fd0c0e7f1912a
      https://github.com/WebKit/WebKit/commit/31d01d86c4f5bbc1dabc06aaf23fd0c0e7f1912a
  Author: Matthew Finkel <sysrqb at apple.com>
  Date:   2024-03-14 (Thu, 14 Mar 2024)

  Changed paths:
    M Source/WebCore/loader/DocumentLoader.cpp
    M Source/WebCore/loader/FrameLoader.cpp
    M Source/WebKit/Platform/cocoa/WebPrivacyHelpers.h
    M Source/WebKit/Platform/cocoa/WebPrivacyHelpers.mm
    M Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp
    M Source/WebKit/UIProcess/WebProcessPool.cpp
    M Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm

  Log Message:
  -----------
  Initialize organization storage access prompt quirks if needed
https://bugs.webkit.org/show_bug.cgi?id=270206
rdar://123728311

Reviewed by Wenson Hsieh.

The API tests I added in 271821 at main directly initialize the cache, but in
reality we actually need another mechanism to pull existing data from the
framework. This patch adds initialization support.

The callback is now dispatched onto the runloop because refing an APIObject in its
own constructor is not supported on some architectures.

Also this change now fetches the quirked domains to be a little earlier in the
page-load process, making the quirk behavior less racy. It also resets resource
load statistics database for some tests where stale data was causing issues.

* Source/WebCore/loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::finishedLoading):
* Source/WebCore/loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadCompleteForThisFrame):

Fetch the quirk data from the network process when the main document is
finished loading.

* Source/WebKit/Platform/cocoa/WebPrivacyHelpers.h:
* Source/WebKit/Platform/cocoa/WebPrivacyHelpers.mm:
(WebKit::StorageAccessPromptQuirkController::setCachedQuirksForTesting):
(WebKit::StorageAccessPromptQuirkController::initialize):

Set and check initialized state.

(WebKit::StorageAccessPromptQuirkController::updateQuirks):

Avoid calling the completion handler synchronously. This ensures we never call
it in the WebProcessPool constructor.

(WebKit::StorageAccessUserAgentStringQuirkController::setCachedQuirksForTesting):
(WebKit::StorageAccessUserAgentStringQuirkController::initialize):
Set and check initialized state.

(WebKit::StorageAccessUserAgentStringQuirkController::updateQuirks):

Avoid calling the completion handler synchronously. This ensures we never call
it in the WebProcessPool constructor.

* Source/WebKit/UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::sendCreationParametersToNewProcess):

I missed initializing this in 271748 at main.

* Source/WebKit/UIProcess/WebProcessPool.cpp:

Initialize quirk sets when creating a new web process, if necessary.

* Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
(TEST):

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



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


More information about the webkit-changes mailing list