feat(libSceNKWebKit): implement WTF::printInternal for StringImpl pointers and WTF::URL::dump #24896
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24896"
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 XFlawless1 on 2026-11-21T09:52:02Z.
What
Implements two
WTF::PrintStreamstring dumps that were throwing stubs:WTF::printInternal(PrintStream&, const StringImpl*)(null StringImpl*); otherwise the string's lenient UTF-8 (tryGetUTF8()), each through the stream'sprintf("%s", …)WTF::URL::dump(PrintStream&) constout.print(m_string):begin(),printInternal(const String&)on the returned stream (lenient UTF-8, an empty string for a null URL string),end()PrintStreamis the guest object ofWtfDumpStreamAbi.hpp;printfgoes through itsvprintfslot with a System Vva_list, andprintthrough itsbegin/endslots, asWtfTimeDump.cppalready does. The UTF-8 comes from this library'sStringImpl::utf8(LenientConversion). Lenient conversion does not fail and allocation failure is not reported here, so the pinned(Out of memory while converting …)/(failed to convert …)texts are never printed; that is recorded in debt. Like upstream,%sstops at an embedded NUL. A null stream or URL throws.The code is in new files (
src/WtfStringDump.cpp,include/WtfStringDumpExports.hpp); #19839 and #19841, which implement otherprintInternaloverloads, addWtfPrintStream.cppandWtfPrintStreamAbi.hpp, and nothing here touches those names.Tested
Windows 11, MinGW GCC 15.2, Release.
nkwebkit_wtfstringdumppasses, using a fake guest stream whosevprintf(it also checks the format is%s),beginandendslots log what they receive:printInternal: null →(null StringImpl*); empty; ASCII; Latin-1é, U+00A0 and U+00FF → two-byte UTF-8; UTF-16€, an astral emoji andé; ASCII in a 16-bit string; unpaired high and low surrogates → U+FFFD; an embedded NUL stops output;%characters pass through as data; output goes to the stream itself with nobegin/end; the string's reference count is unchanged;URL::dump: a parsed URL prints its canonical string, an invalid URL its input, a null URL an empty string and a 16-bit URL string its UTF-8, each between the outer stream'sbeginandendand written to the streambeginreturns;std::invalid_argumentwithout writing anything.URL::dumpwriting to the outer stream instead of the onebeginreturns; strict instead of lenient conversion.nkwebkit_wtftimedumpstill passes.main, all 181nkwebkit_*tests pass, as do the 15registration|conventions_pr_template|pr_overlap_exports|conventions_unknown_nidstests.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.Not tested on a console.
Overlap (
python tools/pr_overlap.py --namesand--branch feat/nkwebkit-wtf-string-print-stream-dumps):printInternaloverloads) delete stubs next to these inExport.cppandInventoryExports.hpp, so whichever merges second gets a textual conflict there; the resolution keeps all deletions.PalCryptoDigestExports.hpp; this PR's include is elsewhere and the two merge without conflict (git merge-tree).mainand shareExport.cpp,InventoryExports.hpporlibSceNKWebKit.hpp; the--namessearch covers every open PR's changes and finds these exports only in #24322.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-21T09:54:15Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
5f31cd8eeb:tools/check_conventions.pypassed.nkwebkit_wtfstringdump_testsbuilt cleanly.nkwebkit_wtfstringdump):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/WtfStringDump.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T10:10:03Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
5f31cd8eebb75b0ea32d887468835d3b527212fausing the prepared diff and pinned repository reader. No tests or builds were run; the test results in the PR description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
The full texts of
core/libs/prx/libSceNKWebKit/Export.cppandcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppwere excluded as too large; their changed hunks were visible in the prepared diff, but their surrounding code was not read. No build, tests, console behavior, or PR-reported checks were independently verified. Read:description.md,commits.md,manifest.json,diff.patch,src/WtfStringDump.cpp,include/WtfStringDumpExports.hpp,libSceNKWebKit.hpp,tests/WtfStringDump.cpp,src/WtfStringAbi.hpp,src/WtfDumpStreamAbi.hpp,src/WtfTimeDump.cpp, andCMakeLists.txt. Excluded:Export.cppandInventoryExports.hppfull text;files.jsonwas unavailable through the reader.To get this to a good state
Nothing is required.