Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b6e0a91ee2ab0e4da5f86317b2eb16a6dcdc0400
      
https://github.com/WebKit/WebKit/commit/b6e0a91ee2ab0e4da5f86317b2eb16a6dcdc0400
  Author: Zak Ridouh <[email protected]>
  Date:   2026-08-13 (Thu, 13 Aug 2026)

  Changed paths:
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp
    M Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h

  Log Message:
  -----------
  Consolidate NetworkProcess cookie IPC authorization into one function
https://bugs.webkit.org/show_bug.cgi?id=321444
rdar://184535736

Reviewed by Alex Christensen.

All eleven cookie messages repeated the same authorization preamble: an
allowsFirstPartyForCookies() call, a MESSAGE_CHECK against Terminate, a silent
return on anything other than Allow, and for six of them a sameSiteInfo check.

Move it into validateCookieAccess(). The MESSAGE_CHECK stays at each call site 
so
the fault log keeps naming the message that failed and the completion handler is
still run before returning.

No change in behavior. Handlers with no sameSiteInfo pass nullptr and remain
unchecked, domCookiesForHost still authorizes its url as its own first party, 
and
setRawCookie and deleteCookie keep their other message checks in the same order.

* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::validateCookieAccess):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOM):
(WebKit::NetworkConnectionToWebProcess::setCookiesFromDOM):
(WebKit::NetworkConnectionToWebProcess::cookiesEnabled):
(WebKit::NetworkConnectionToWebProcess::cookieRequestHeaderFieldValue):
(WebKit::NetworkConnectionToWebProcess::getRawCookies):
(WebKit::NetworkConnectionToWebProcess::setRawCookie):
(WebKit::NetworkConnectionToWebProcess::deleteCookie):
(WebKit::NetworkConnectionToWebProcess::cookiesForDOMAsync):
(WebKit::NetworkConnectionToWebProcess::setCookieFromDOMAsync):
(WebKit::NetworkConnectionToWebProcess::domCookiesForHost):
(WebKit::NetworkConnectionToWebProcess::subscribeToCookieChangeNotifications):
* Source/WebKit/NetworkProcess/NetworkConnectionToWebProcess.h:

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



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

Reply via email to