Skip to content

Commit

Permalink
Add logging for enabling tracking prevention
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=269747
rdar://123265968

Reviewed by Per Arne Vollan.

Also, add logging for changing cookie accept policy, and reduce logging about new IndexedDB paths by only printing them
when files are moved.

* Source/WebKit/NetworkProcess/Cookies/WebCookieManager.cpp:
(WebKit::WebCookieManager::setHTTPCookieAcceptPolicy):
* Source/WebKit/NetworkProcess/storage/OriginStorageManager.cpp:
(WebKit::OriginStorageManager::StorageBucket::resolvedIDBStoragePath):
* Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setTrackingPreventionEnabled):

Canonical link: https://commits.webkit.org/275020@main
  • Loading branch information
szewai committed Feb 20, 2024
1 parent 3504928 commit 79c8f66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions Source/WebKit/NetworkProcess/Cookies/WebCookieManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ void WebCookieManager::stopObservingCookieChanges(PAL::SessionID sessionID)

void WebCookieManager::setHTTPCookieAcceptPolicy(PAL::SessionID sessionID, HTTPCookieAcceptPolicy policy, CompletionHandler<void()>&& completionHandler)
{
RELEASE_LOG(Storage, "WebCookieManager::setHTTPCookieAcceptPolicy set policy %d for session %" PRIu64, static_cast<int>(policy), sessionID.toUInt64());
platformSetHTTPCookieAcceptPolicy(sessionID, policy, [policy, process = protectedProcess(), completionHandler = WTFMove(completionHandler)] () mutable {
process->cookieAcceptPolicyChanged(policy);
completionHandler();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,9 @@ String OriginStorageManager::StorageBucket::resolvedIDBStoragePath()
m_resolvedIDBStoragePath = m_customIDBStoragePath;
} else {
auto idbStoragePath = typeStoragePath(StorageType::IndexedDB);
RELEASE_LOG(Storage, "%p - StorageBucket::resolvedIDBStoragePath New path '%" PUBLIC_LOG_STRING "'", this, idbStoragePath.utf8().data());
auto moved = IDBStorageManager::migrateOriginData(m_customIDBStoragePath, idbStoragePath);
if (moved)
RELEASE_LOG(Storage, "%p - StorageBucket::resolvedIDBStoragePath New path '%" PUBLIC_LOG_STRING "'", this, idbStoragePath.utf8().data());
if (!moved && FileSystem::fileExists(idbStoragePath)) {
auto fileNames = FileSystem::listDirectory(m_customIDBStoragePath);
auto newFileNames = FileSystem::listDirectory(idbStoragePath);
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/UIProcess/WebsiteData/WebsiteDataStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1691,6 +1691,7 @@ void WebsiteDataStore::setTrackingPreventionEnabled(bool enabled)
if (enabled == trackingPreventionEnabled())
return;

RELEASE_LOG(Storage, "%p - WebsiteDataStore::setTrackingPreventionEnabled sessionID=%" PRIu64 ", enabled=%d", this, m_sessionID.toUInt64(), enabled);
if (enabled) {
m_trackingPreventionEnabled = true;

Expand Down

0 comments on commit 79c8f66

Please sign in to comment.