feat(libSceNKWebKit): implement WebCore::toString(Vector<ProxyServer>) and proxyServersForURL #24614
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24614"
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 ToRaNek on 2026-11-20T21:01:04Z.
What
Implements two exports that were throwing stubs, both in the 3.20 inventory only:
WebCore::toString(const Vector<ProxyServer>&)WebCore::proxyServersForURL(const URL&)toStringfollows ProxyServer.cpp on the 24-byteProxyServerof ProxyServer.h (type at 0, host at 8, port at 16):DIRECT;DIRECT, and its host and port are not written;PROXY host:port, a SOCKS entrySOCKS host:port;"; ".Three details come from the source rather than from what one would guess:
case, so the entry has no keyword and readshost:port.:-1.StringBuilderkeeps an 8-bit buffer when it is given a single 16-bit code unit that fits Latin-1 (StringBuilder.cpp L332-L335), so a one-character 16-bit host does not widen the string, while a longer one does even if every character is ASCII.proxyServersForURLreturns an empty vector through its hidden result pointer and does not read the URL, which is what ProxyServerCurl.cpp does;PlatformPlayStation.cmakebuilds the curl port. Whether the console build replaces that file is not known and is recorded in debt.The five source files involved (
ProxyServer.h,ProxyServer.cpp,ProxyServerCurl.cpp,StringBuilder.h,StringBuilder.cpp) are byte-identical at both ends of the window the 3.20 names allow (WebKit34fe4d7c1658, 2020-06-13, and9fd169d0da68, 2020-11-12).Where
StringBuilderwould overflowString::MaxLengthand assert,toStringthrows. A null vector, a non-empty vector with a null buffer and a null result pointer throw.Tested
Windows 11, MinGW GCC 15.2.
nkwebkit_proxyserverpasses: empty lists (null buffer, and a reserved buffer with size 0), each type, five out-of-range types, a four-entry list, null and empty hosts, ports -1, 0,INT_MAXandINT_MIN, Latin-1 in an 8-bit host, the three 16-bit cases above plus an empty 16-bit host, a mixed list that widens midway, host reference counts unchanged, andproxyServersForURLover a pre-filled result, with and without a URL.";"without the space; a direct entry going on to write host and port; widening on any 16-bit host; never widening; an empty list giving an empty string; the port written unsigned.nkwebkit_*tests andpatched_librariespass on the branch.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.Not tested on a console.
Overlap (
python tools/pr_overlap.py --branch feat/nkwebkit-proxy-server-to-string):mainand shareExport.cpp,LegacyExports.hpporlibSceNKWebKit.hpp(#13515, #14138, #14164, #14259, #16510, #17550, #17569, #17771, #17793, #17805, #17912, #17917, #17933, #22678, #22684, #22689, #22937, #23847, #24154, #24172). I searched each of their diffs for the two export names and forProxyServer: none mentions them.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-20T22:12:46Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
a1d0be25b0:tools/check_conventions.pypassed.nkwebkit_proxyserver_testsbuilt cleanly.nkwebkit_proxyserver):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/ProxyServer.cpp,core/libs/prx/libSceNKWebKit/src/ProxyServerCurl.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-20T22:17:16Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the behavior is consistent with the described WebKit implementation, with console behavior still unverified.
What I ran
Reviewed head
a1d0be25b0cfe8f09567ffa1c5e7fbfe14de3cb8against the prepared diff. No build or tests were run. I readdescription.md,commits.md,manifest.json,diff.patch, and the full text of every included changed file exceptLegacyExports.hpp, whose changed lines are empty. I also read the changed portions ofExport.cpp, the include site inlibSceNKWebKit.hpp, and theStringViewdefinition andViewOfimplementation inWtfStringAbi.hppandWtfString.cpp.files.jsonwas not available in the review folder; the manifest listsExport.cppas excluded because it is too large.Results
Findings
Blocking
None.
Non-blocking
proxyServersForURLfollows the curl-port behavior described in the change, but whether the console build uses this implementation remains uncertain. The change records that limitation as technical debt (core/libs/prx/libSceNKWebKit/src/ProxyServerCurl.cpp:33).Not verified
The author reports Windows 11/MinGW tests and repository checks passing; I did not run them. I did not read the full 2,132-line
LegacyExports.hppbecause its changed lines are empty, or the excluded fullExport.cpp; I inspected only the relevantExport.cppranges from the diff. I did not verify console implementation behavior or the author's upstream source comparison.To get this to a good state
Nothing is required. Optional: compare
proxyServersForURLwith a console module and update the recorded technical debt if needed.