[webkit-changes] [WebKit/WebKit] 4bb2d5: Only access NetworkStorageSession StorageAccess qu...
Matthew Finkel
noreply at github.com
Wed Jan 3 14:11:03 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 4bb2d534b3cd4cf4c7f7c7ab229e38909ae3552b
https://github.com/WebKit/WebKit/commit/4bb2d534b3cd4cf4c7f7c7ab229e38909ae3552b
Author: Matthew Finkel <sysrqb at apple.com>
Date: 2024-01-03 (Wed, 03 Jan 2024)
Changed paths:
M Source/WebCore/platform/network/NetworkStorageSession.cpp
M Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp
M Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h
M Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp
M Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h
M Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm
Log Message:
-----------
Only access NetworkStorageSession StorageAccess quirks on main thread
https://bugs.webkit.org/show_bug.cgi?id=266246
rdar://119507955
Reviewed by Alex Christensen.
Currently, all NetworkStorageSession storage-access-related quirks are static
members, and they are safely accessed from multiple threads. In 271821 at main, I
introduced a mechanism for updatable storage access quirks. In that patch, we
store the quirks in a process-global data structure, and that structure should
only be accessed on the main thread. However, that was incompatible with how
the existing quirks were accessed. This patch solves that issue by ensuring we
only call the functions on the main thread, and we copy the results
cross-thread.
* Source/WebCore/platform/network/NetworkStorageSession.cpp:
(WebCore::NetworkStorageSession::canRequestStorageAccessForLoginOrCompatibilityPurposesWithoutPriorUserInteraction):
(WebCore::NetworkStorageSession::storageAccessQuirkForTopFrameDomain):
(WebCore::NetworkStorageSession::storageAccessQuirkForDomainPair):
* Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.cpp:
(WebKit::ResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::ResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::ResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
(WebKit::ResourceLoadStatisticsStore::grantStorageAccess):
(WebKit::ResourceLoadStatisticsStore::grantStorageAccessInternal):
(WebKit::ResourceLoadStatisticsStore::cookieAccess):
* Source/WebKit/NetworkProcess/Classifier/ResourceLoadStatisticsStore.h:
* Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::hasStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessEphemeral):
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccessUnderOpener):
* Source/WebKit/NetworkProcess/Classifier/WebResourceLoadStatisticsStore.h:
* Tools/TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
(TEST):
Canonical link: https://commits.webkit.org/272628@main
More information about the webkit-changes
mailing list