feat(libSceNKWebKit): implement WebCore::HTTPHeaderMap #15326
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15326"
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-03T00:02:42Z.
What
Implements 11 libSceNKWebKit
WebCore::HTTPHeaderMapexports that threw throughNotImplemented_nid_no_patch:_ZN7WebCore13HTTPHeaderMapC1Ev/C2EvqVrMxeDN6Zs/lsMB2OXXR-Q_ZN7WebCore13HTTPHeaderMap3addERKN3WTF6StringES4_+7HpqmfJz48_ZN7WebCore13HTTPHeaderMap3setERKN3WTF6StringES4_CUlajtWO-L4_ZN7WebCore13HTTPHeaderMap6appendERKN3WTF6StringES4_17lDGYhSTx4_ZN7WebCore13HTTPHeaderMap6removeENS_14HTTPHeaderNameE+uk5J35y6WQ_ZN7WebCore13HTTPHeaderMap6removeERKN3WTF6StringE-LVXigKk--w_ZNK7WebCore13HTTPHeaderMap3getENS_14HTTPHeaderNameEZkmt7pm3d5M_ZNK7WebCore13HTTPHeaderMap8containsENS_14HTTPHeaderNameEoKamLgrFO+k_ZNK7WebCore13HTTPHeaderMap8containsERKN3WTF6StringE9w0VG82erX8_ZN7WebCore20httpHeaderNameStringENS_14HTTPHeaderNameEjajO-tAdNekThey are ported from the PS5 WebKit source the library's debt file already pins,
neonmodder123/PS5-WebKit-11.x@80f77e94c63e:HTTPHeaderMap.cpplines 40–265.addjoins an existing value with", ", andsetreplaces it.appendalways appends: its uniqueness check is a debug-onlyASSERT, so duplicates stay and lookup and removal act on the first match.removedrops the first match, and a missing header reads as the null string.HTTPHeaderNames.in(95 names) andcreate-http-header-name-table.sort()of the names, and the table here matches that order.%ignore-case). A non-ASCII name is an uncommon header.httpHeaderNameStringreturnsASCIILiteral, a trivial one-pointer object returned inrax.src/HttpHeaderMap.cppstarts withHTTPHeaderMap.cpp's notice, and the names table withHTTPHeaderNames.in's, each byte for byte.Layout (
src/HttpHeaderMapAbi.hpp, pinned withstatic_asserts):HTTPHeaderMapis 32 bytes.CommonHeadersVectorisVector<CommonHeader, 0, CrashOnOverflow, 6>. The 0 is the inline capacity and the 6 the minimum capacity (Forward.hline 98).VectorBufferBase'sT* m_buffer; unsigned m_capacity; unsigned m_size;(Vector.hlines 395–397), 16 bytes. The common vector sits at offset 0, the uncommon one at 16.WTF::fastMalloc/fastFreeexports, so guest code that destroys or copies a map inline uses the same allocator.All of this is in new files.
WtfString.cppandWtfStringAbi.hppare not touched; the shared edits are limited to removing the stubs and adding the new public header.HTTPHeaderMap::isolatedCopystays unimplemented: the inventory symbol has no ref qualifier, while the pinned source declaresconst &and&&overloads. The debt entry says so.Debt (
docs/dev/debt/libSceNKWebKit.md):Api.hppdeclarations outside the table, which reproduces every earlier value of that line;main(cdefa2cf7c) the table lists 6508 rows, of which 6501 still throw (#14387 and #14981 implemented seven without removing their rows), and the prose says 6501; this PR removes 10 throwing rows, so it now says 6491.Related open PRs: #15214 and #15228 (simnJS) reserve 128 bytes for
HTTPHeaderMapin theirResourceRequestBaseandResourceResponseBaselayouts, reading the 6 above as inline slots. The derivation is in a comment on #15214. This PR doesn't touch their files, but the two layouts disagree.Tested
nkwebkit_httpheadermap(core/libs/prx/libSceNKWebKit/tests/HttpHeaderMap.cpp, registered by the existingtests/*.cppglob) covers:setversusadd, duplicateappendand first-match removal;mainwith only the test added, it fails with_ZN7WebCore13HTTPHeaderMapC1Ev not implemented, and separate probes confirm all 11 exports throw;guest_nkwebkit_datesandguest_nkwebkit_numbers.main(cdefa2cf7c), at9b7b551bd7all 33 NKWebKit tests pass, including those added onmainsince this PR was opened.main(5cb015caaa) with only the test added, it fails with the samenot implementedmessage, and a probe run reports11/11 threw;gettakes the hidden return pointer in RDI withselfin RSI, andhttpHeaderNameStringreturns its pointer in RAX;known header classification;","failsheader value mismatch;ASCII case equivalence.python3 tools/check_conventions.py --base origin/main: all conventions checks passed. The public-header audit passes, and the new header compiles on its own.python3 tools/pr_overlap.py: no other PR implements these exports. The search hit on #15214 is its use of the type, described above.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 MarcZX10 on 2026-11-03T00:16:36Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The uncommon-header comparison distinguishes null and empty names, while the pinned WebKit implementation treats both zero-length names as equal.
What I ran
Reviewed all 10 changed files at head
b6ffdb9ebca345a34e741a19a4b019a65369ebdaagainst base5cb015caaaaf83f8ee431414ee6a457b5b307d49; the exact head merges cleanly into currentmain. Environment: Debian 12, Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or C++ tests were run.Results
tests/*.cppglob registers this test.Raw check output
Negative control
Findings
Blocking
Equalreturns false when exactly one key has a nullStringImpl, even when both keys have length zero. The pinned WebKitequalIgnoringASCIICaseCommoncompares lengths and then characters; for two empty views, the zero-iteration character comparison returns true.setUncommonHeaderuses that comparison, so setting a null name and then an empty name updates the same first entry in WebKit, while this implementation creates two entries. The new test asserts that the keys coexist. Please match the source comparison and change the test to cover null/empty lookup, update, and removal consistently.Non-blocking
None.
Sources
Not verified
No build, CTest, runtime behavior, Linux/Windows comparison, console layout, allocation-failure test, or negative control was run. The six hosted checks were still queued at the final status query. The precheck's ABI and test-quality steps could not find their optional scripts in its isolated snapshot; both were run manually against the exact PR commits, and the test-quality warning was checked against the exact-head CMake glob.
To get this to a good state
Make the null-versus-empty comparison and regression test match the pinned WebKit behavior. On the new head, I will rerun the no-build precheck, ABI audit, test-quality inspection, and hosted-check review; C++ runtime tests still need an exact-head build.