feat(libSceNKWebKit): implement WebCore::CookieUtil::defaultPathForURL #16642
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16642"
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 AlexWhitehouse on 2026-11-07T12:08:30Z.
What
Implements libSceNKWebKit
WebCore::CookieUtil::defaultPathForURL(const WTF::URL&)(_ZN7WebCore10CookieUtil17defaultPathForURLERKN3WTF3URLE, NIDitSSjy-a4Ig), which threw throughNotImplemented_nid_no_patch. WebKit's curl cookie jar calls it when a cookie has noPathattribute (CookieJarDB.cpp).Source:
Source/WebCore/platform/network/curl/CookieUtil.cpp, lines 184–198, at the PS5 WebKit revision the NKWebKit debt file and earlier ports use (80f77e94). It is RFC 6265 §5.1.4:src/CookieUtil.cppstarts with that file's notice, copied byte for byte.Implementation:
WTF::URL::pathexport already onmain, which excludes the query and fragment and gives an empty view for an invalid URL. It is copied into aStringImplof the same character width through the existingStringImpl::createexports, astoString()does.StringImpl::substringexport. Each"/"result is a fresh 8-bitStringImplthat points at static literal bytes without copying them, as"/"_sbuilds one.WTF::StringlayoutWtfStringAbi.hppalready defines, with reference counts balanced.WtfString.cppcode is touched.Debt: a new entry records that the console's URL/String layouts and return convention are unverified. Guest calls to
StringImpl::destroyon the result still reach that export, which is a stub onmain. The inventory count drops from 6401 to 6400.Tested
tests/CookieUtil.cpp, registered by the NKWebKit tests glob. URL objects are built by hand in the layoutmainalready defines, so the test doesn't depend on the open URL parser PRs (#14926–#14930, #15867)."",/,/file,/a/b,/a/b/,//x,a/b, an invalid URL, a long path, and non-ASCII 16-bit characters including a surrogate pair. Each runs with 8-bit and 16-bit URL strings, and each URL carries a query and fragment containing/.StringImplper call; the input's reference count unchanged; and balanced reference counts on the result, including after copying it.main, the 39 existing tests pass and the new test fails with_ZN7WebCore10CookieUtil17defaultPathForURLERKN3WTF3URLE not implemented;/a/b→/a/) fails the length assertion.nkwebkit_cookieutil, with no warnings in the new files.python3 tools/check_conventions.py --base origin/main: all conventions checks passed.python3 tools/pr_overlap.py --branch feat/libscenkwebkit-cookie-default-path: no open PR implements this export or works inCookieUtil.main. Trial merges add no conflicts beyond the shared NKWebKit inventory count line.parseCacheControlDirectives) will share that line too.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)🤖 Generated with Claude Code