-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't...
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 May 2019 23:29:46 +0000 (23:29 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 6 May 2019 23:29:46 +0000 (23:29 +0000)
commit2fd4e3a8e98cb72345ae3c6eb677ecb1eae2d0bf
tree4e672dd0ce9f52abd4172e39c4bc8a1141f5346b
parentebf7e03018ae1e08a6036cb15937ba1a1babfef8
-[WKWebsiteDataStore removeDataOfTypes:forDataRecords:completionHandler:] doesn't delete _WKWebsiteDataTypeCredentials
https://bugs.webkit.org/show_bug.cgi?id=197510
Source/WebCore:

<rdar://problem/50372338>

Reviewed by Alex Christensen.

This patch implements deletion of non persistent credentials for a set of origins. In order for this to work, fetching
credentials from the credential storage needs to return a set of SecurityOriginData objects, instead of a set of origin
strings. This is implemented by iterating over all the elements in the credential map, and creating a SecurityOriginData
object for each credential based on the protection space.

API test: WKWebsiteDataStore.RemoveNonPersistentCredentials

* platform/network/CredentialStorage.cpp:
(WebCore::CredentialStorage::removeCredentialsWithOrigin):
(WebCore::CredentialStorage::originsWithCredentials const):
* platform/network/CredentialStorage.h:
(WebCore::CredentialStorage::originsWithCredentials const): Deleted.

Source/WebKit:

Reviewed by Alex Christensen.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::fetchWebsiteData):
(WebKit::NetworkProcess::deleteWebsiteDataForOrigins):
(WebKit::NetworkProcess::registrableDomainsWithWebsiteData):

Tools:

Reviewed by Alex Christensen.

* TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/network/CredentialStorage.cpp
Source/WebCore/platform/network/CredentialStorage.h
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/NetworkProcess.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebsiteDatastore.mm