Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 25c05d906dcd30e93d960bfd4ef6e108762e3f64
      
https://github.com/WebKit/WebKit/commit/25c05d906dcd30e93d960bfd4ef6e108762e3f64
  Author: Rupin Mittal <[email protected]>
  Date:   2025-12-15 (Mon, 15 Dec 2025)

  Changed paths:
    M Source/WebCore/Modules/cookie-store/CookieStore.cpp
    M Source/WebCore/Modules/cookie-store/CookieStore.h

  Log Message:
  -----------
  [Cookie Store API] get() and getAll() should share the same code path
https://bugs.webkit.org/show_bug.cgi?id=303860
rdar://166158960

Reviewed by Chris Dumez.

Both functions have all the same checks and steps with only two differences:

1. If the passed in CookieStoreGetOptions is empty, get() throws a TypeError,
   getAll() does not throw any error.

2. get() returns a single cookie, getAll() returns a set of cookies.

So, to reduce code duplication, we create a new getShared() function that both
get() and getAll() will call. In order to differentiate between get() and 
getAll()
so we can implement the two differences noted above, we introduce a new enum
GetType.

This is tested by existing Cookie Store tests.

* Source/WebCore/Modules/cookie-store/CookieStore.cpp:
(WebCore::CookieStore::get):
(WebCore::CookieStore::getAll):
(WebCore::CookieStore::getShared):
(WebCore::CookieStore::MainThreadBridge::getAll): Deleted.
* Source/WebCore/Modules/cookie-store/CookieStore.h:

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



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

Reply via email to