feat(libSceNKWebKit): implement WebCore::Cookie hash and operator== #22451
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22451"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by RiverWhy on 2026-11-17T16:41:08Z.
What
Implements
WebCore::Cookie::hashandWebCore::Cookie::operator==: 2 exports that both throw onmaintoday.Source: the non-Cocoa Cookie.cpp at
e12a212a531a. The PS5 11.xCookie.cppandCookie.hhave the same code and fields.operator==comparesname,domain,path(WTF::equal) andsecure.hashaddsStringHash::hashofname,domainandpathandsecure, modulo 2^32. The cachedStringImplhash is used, andhashSlowCasewhen there is none.Layout: 136 bytes, measured by compiling the 2021 field list against that revision's WTF
String,Optional<double>,URLandVectorand checked withstatic_asserts.nameis at 0,domainat 16,pathat 24, the 16-byteexpiresat 40,secureat 57 andsameSiteat 128.StringHash::hashfaults on a null string, sohashthrows for a null name, domain or path. A null cookie also throws.Debt: a fragment,
docs/dev/debt/changes/feat-nkwebkit-cookie-hash.md, adds the entry under Functional and removes the 2 inventory rows.Overlap:
pr_overlap.pyfinds no open PR with these exports.libSceNKWebKit.hpp, which is a line conflict only.Tested
Linux Mint 22.3:
nkwebkit_webcorecookietest:==in both directions and bothhashvalues, and the result is compared with the hash from the real 2021Cookie.cppand WTFStringHashrunning the same driver. As a one-off, 300 sequences of 3,000 pairs also matched.n,example.com,/, secure) hashes to the oracle's 21286027;securefromoperator==fails the transcript check.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-17T16:44:59Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
fa9c87ade7:tools/check_conventions.pypassed.nkwebkit_webcorecookie_testsbuilt cleanly.nkwebkit_webcorecookie):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/WebCoreCookie.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T00:33:14Z.
Review: COMMENTED
Reviewed — comments
Changes are required before merge: confirm the guest ABI behavior for null
WTF::Stringvalues before relying on the implementation’s different null handling.What I ran
Reviewed head
0f412bbac2066964d1b362a338dffc71968b3ef6using the prepared diff andrepo_read.pyfor targeted source ranges. No build or tests were run. The author reports Linux Mint tests and a negative control in the PR description; those were not run in this review.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceNKWebKit/src/WebCoreCookie.cpp:47rejects null string implementations inhash, whileoperator==delegates to WTF equality at lines 59–61. The PR description says upstreamStringHashthrows for null values, but does not establish how the actual consoleString/equality implementation handles nulls. Verify this behavior against the PS5 module or an appropriate ABI oracle and align both operations with it; current tests encode the implementation’s null assumptions rather than verifying console behavior.Not verified
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwere excluded as too large. Their changed hunks were present indiff.patchand inspected, but their full text was not read.core/libs/prx/libSceNKWebKit/include/WebCoreCookieExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/WebCoreCookie.cpp,core/libs/prx/libSceNKWebKit/tests/WebCoreCookie.cpp, anddocs/dev/debt/changes/feat-nkwebkit-cookie-hash.md.To get this to a good state
Nothing is required. Optional: confirm null-string behavior against the console module and adjust the tests or implementation if it differs.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T03:49:03Z.
Review: COMMENTED
Review unavailable — comments
I could not inspect the prepared review materials or repository source in this environment, so this review is incomplete.
What I ran
No reader commands could be run.
Results
Findings
Blocking
None verified.
Non-blocking
Review cannot establish whether the change is safe to merge without inspecting its diff and source.
Not verified
Description, commits, diff, manifest, changed files and tests were not read.
To get this to a good state
Nothing is required by verified findings. Complete a review after the reader is available.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T12:21:57Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this change; the points below are optional.
What I ran
Reviewed head
28514ceec496e9dafabd62a418f2b77b751f8172using the prepared diff andrepo_read.pyfor targeted source context. No build or test commands were run.Results
Export.cppwas unavailable in the review folderFindings
Blocking
None.
Non-blocking
Not verified
core/libs/prx/libSceNKWebKit/Export.cppwas excluded as too large, so its removals were checked only in the prepared diff.include/InventoryExports.hpp,include/WebCoreCookieExports.hpp,libSceNKWebKit.hpp,src/WebCoreCookie.cpp,tests/WebCoreCookie.cpp, anddocs/dev/debt/changes/feat-nkwebkit-cookie-hash.md;Export.cppwas not read. All seven changed paths are listed in the manifest.To get this to a good state
Nothing is required. Optionally confirm null-input behavior against expected callers and compare the implementation with a console module.