feat(libSceNKWebKit): implement WebCore::SQLiteFileSystem::computeHashForFileName on PAL::CryptoDigest #21173
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21173"
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 B-Howell on 2026-11-15T22:20:36Z.
What
Implements
WebCore::SQLiteFileSystem::computeHashForFileName(const WTF::String&)(_ZN7WebCore16SQLiteFileSystem22computeHashForFileNameERKN3WTF6StringE). It follows SQLiteFileSystem.cpp#L148-L165: it takes the lenient UTF-8 of the name, runs SHA-256 over it and returns 64 uppercase hex characters. It reuses the mergedPAL::CryptoDigest(#19330),WTF::String::utf8andWTF::String::fromUTF8, so no SHA or UTF-8 code is duplicated. The pinned header takes aStringView, but the console export takesconst String&. Both produce the same UTF-8 bytes. The stub and its legacy declaration are removed, and a typed declaration goes inSQLiteFileSystemExports.hpp. The new file keeps the upstream Google BSD notice and aDerived fromline. The export was not in the inventory table, so this PR only adds a debt fragment (docs/dev/debt/changes/feat-nkwebkit-sqlite-filename-hash.md).Tested
Linux (WSL Ubuntu 22.04, GCC 11.4, Release), at
4f6a45d9bbon main54fb9c85fa. The later merge of mainff36fea157changes no libSceNKWebKit or libSceLibreSsl source. The newnkwebkit_sqlitefilesystemhashtest covers the empty,abcand null String cases, Latin-1 and 16-bit text, 3-byte and surrogate-pair UTF-8, lone high and low surrogates as 3-byte lenient UTF-8, and a result that is 8-bit, 64 characters and uppercase. It also checks that the digest object is allocated once and freed.nkwebkit_sqlitefilesystemhash ....Subprocess aborted,_ZN7WebCore16SQLiteFileSystem22computeHashForFileNameERKN3WTF6StringE not implemented.nkwebkit_sqlitefilesystemhashandnkwebkit_palcryptodigestpassed 3/3 runs.^public_headers: 65/65 passed.tools/progress.py: libSceNKWebKit 3150 -> 3151 of 11261 (+1).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-15T23:22:05Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
b734406b75:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_sqlitefilesystemhash_testsbuilt cleanly.nkwebkit_sqlitefilesystemhash):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Pull request closed