[Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Apr 2018 05:26:40 +0000 (05:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 29 Apr 2018 05:26:40 +0000 (05:26 +0000)
commit1fb7700ae1f0ac038ae96186acdb1930c57f63f4
tree206166c2dbe1a2bfd762c3896e67591106239b11
parente659c8e923fde8cdb8b4f87cb76ae94c3c906fb6
[Cocoa] Set HTTPOnly flag when converting Cookie to NSHTTPCookie
https://bugs.webkit.org/show_bug.cgi?id=185052

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-04-28
Reviewed by Geoffrey Garen.

Source/WebCore:

Set HTTPOnly for NSHTTPCookie when it's converted from Cookie, so the WebKit APIs could
create NSHTTPCookie with correct HTTPOnly flag. Also, reverted the change made to operator
function because we want the Cookie class to act as a wrapper for NSHTTPCookie and leverage
its equal function.

Modified API test: WebKit.WKHTTPCookieStoreHttpOnly

* platform/network/cocoa/CookieCocoa.mm:
(WebCore::Cookie::operator NSHTTPCookie * const):
(WebCore::Cookie::operator== const):
* platform/network/cocoa/NetworkStorageSessionCocoa.mm:
(WebCore::NetworkStorageSession::deleteCookie):

Tools:

Modified API test to provide correct test cases for HTTPOnly flag.

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

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@231146 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/network/cocoa/CookieCocoa.mm
Source/WebCore/platform/network/cocoa/NetworkStorageSessionCocoa.mm
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebKitCocoa/WKHTTPCookieStore.mm