feat(libSceNKWebKit): implement FourCC fromString #18802
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18802"
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-12T10:40:31Z.
What
libSceNKWebKit
WebCore::FourCC::fromString(const WTF::String&)(_ZN7WebCore6FourCC10fromStringERKN3WTF6StringE, NID6jXcZuxLnX4) threwnot implemented. This PR ports it from WebKit c55364d5, a revision NKWebKit already cites; the PS5-WebKit tree (80f77e94) has only aStringViewoverload with a different signature.FourCC.cpp:fromStringconverts the string withascii()and returnsnulloptunless the result is exactly four bytes, then packs them big-endian;WTFString.cpplines 735–771:ascii()keeps NUL and 0x20–0x7F and replaces every other code unit with?, so the length always equals the string's;Optional.h: the result type.Behaviour:
"ftyp"is0x66747970.Optional<FourCC>at this revision is 8 bytes with 4-byte alignment: the engaged flag at 0 and the value at 4. Its copy and move constructors are non-trivial, so the System V ABI returns it through a hidden pointer, which the export takes and returns explicitly.The new
src/FourCC.cppstarts with the notices ofFourCC.cppandWTFString.cpp. The stub is removed (it had no inventory row, so the NKWebKit inventory is unchanged), and a debt fragment (docs/dev/debt/changes/feat-libscenkwebkit-fourcc-from-string.md) adds an entry recording that the console's behaviour and ABI are unmeasured.Tested
nkwebkit_fourcc(core/libs/prx/libSceNKWebKit/tests/FourCC.cpp) covers:?;main, the test fails with_ZN7WebCore6FourCC10fromStringERKN3WTF6StringE not implemented;nkwebkit_fourcc,nkwebkit_wtfandpublic_headerspass.nkwebkit_fourcc,nkwebkit_wtfandpublic_headerspass at 531ce500f8, with no compiler warnings in the changed files. The branch was then rebased onto currentmain; only an include line and the count line conflicted. The focused tests pass again on Linux. After a second rebase ontoeb63620639(stub conflict with the ISOWebVTTCue change, debt entry moved to a fragment),nkwebkit_fourccandnkwebkit_wtfpass on Linux with GCC 15.python3 tools/check_conventions.py --base origin/main: all checks passed.python3 tools/pr_overlap.py: no open PR implements this export or NID. I compared 118 NKWebKit PR diffs. About 20 of them, including my HTML space-trim, GL-extension, referrer and cross-origin PRs, shared only the NKWebKit count line, which main has since removed, so they no longer overlap.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
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-12T11:07:11Z.
Review: CHANGES_REQUESTED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
279f5af357:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_fourcc_testsbuilt cleanly.nkwebkit_fourcc):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.#endifand namespace ends.' Lines 1-44 contain two multi-line copyright and license comment blocks (lines 1-24 and lines 26-44), which violates this repository rule.Generated withfooter from the description; the AI-assisted checkbox can stay.Requesting changes for the points above.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-15T21:00:38Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d2c6e1b275:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_fourcc_testsbuilt cleanly.nkwebkit_fourcc):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.OptionalFourCClayout incore/libs/prx/libSceNKWebKit/include/FourCCExports.hpp(sizeof == 8,alignof == 4,engagedat offset 0,valueat offset 4) and hidden-pointer return ABI for_ZN7WebCore6FourCC10fromStringERKN3WTF6StringE.core/libs/prx/libSceNKWebKit/src/FourCC.cpp:55-58ensuring nullresult, nullstring, and non-emptyStringImplwith nulldatathrowstd::invalid_argumentbefore dereferencing.String::ascii()conversion and big-endian packing incore/libs/prx/libSceNKWebKit/src/FourCC.cpp:59-68for both 8-bit (hashAndFlags & 4) and 16-bit strings, preserving NUL (0x00) and0x20–0x7fwhile mapping all other code units to'?'(0x3f) and disengaging whenimplis null orlength != 4.core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/LegacyExports.hppstub removal and header inclusion incore/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp.core/libs/prx/libSceNKWebKit/tests/FourCC.cppexercises both 8-bit and 16-bit representations, lengths 0/3/4/5, all byte values 0–255, non-Latin1/surrogate 16-bit code units, nullString, and canary bounds aroundOptionalFourCC.Derived fromheaders incore/libs/prx/libSceNKWebKit/src/FourCC.cppwere verified by maintaineroneandonlydean, and technical debt is documented indocs/dev/debt/libSceNKWebKit.md.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T10:51:18Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
d2ccf146b9:tools/check_conventions.pypassed.nkwebkit_fourcc_testsbuilt cleanly.nkwebkit_fourcc):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/FourCC.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me