feat(libSceNKWebKit): implement WTF::portAllowed #14345
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/14345"
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 voidlakhan on 2026-11-01T10:12:20Z.
What
Implement
WTF::portAllowed(const URL&)(mangled:_ZN3WTF11portAllowedERKNS_3URLE, NID:tRrU4kb6AtE) inlibSceNKWebKit.Export.cppwith a typed declaration ininclude/WtfExports.hppand callable implementation insrc/WtfString.cpp.src/WtfString.cppfor the ported WTF URL functions.URLPort(const URL&)internal helper adaptingURL::port()from pinned WebKit sourceneonmodder123/PS5-WebKit-11.x@80f77e9andparseInteger<uint16_t>integer parsing semantics fromSource/WTF/wtf/text/StringToIntegerConversion.h#L33-L104with subtraction-based overflow bounds checking and whitespace skipping (isUnicodeCompatibleASCIIWhitespace:' ','\n','\t','\r','\f').blockedPortListand exceptions fromSource/WTF/wtf/URL.cpp#L952-L1051:trueif no port is present or if the port is unparseable / out of range. In upstream WebKit, invalid ports or values above 65535 failparseIntegerand yieldstd::nulloptinURL::port(), which triggersif (!port) return true;. This behavior matches upstream engine semantics rather than an arbitrary fallback policy.trueif the port is not inblockedPortList.tcpmux) to 10080 (amanda); port 0 is allowed.url.protocolIs("ftp")), including uppercase scheme.url.protocolIs("file")), including uppercase scheme._ZN3WTF27protocolHostAndPortAreEqualERKNS_3URLES2_and this PR implements_ZN3WTF11portAllowedERKNS_3URLE. Both PRs share identical internal implementations ofURLPort()andIsUnicodeCompatibleASCIIWhitespace(). Whichever PR merges second will rebase ontomainand deduplicate into a single shared helper, preserving both PRs' exports and tests.tests/Wtf.cppcovering allowed ports, blocked ports, FTP exceptions (including uppercase scheme), file exceptions (including uppercase scheme), unparseable ports (25x,80junk), integer overflow (65536), whitespace variations (\t,\n,\r,\f), trailing junk, and 16-bit UTF-16 URLs.docs/dev/debt/libSceNKWebKit.md.Tested
ctest --test-dir build-full -R "^nkwebkit_wtf$" -Vpassed locally on Windows host (100% tests passed).python tools/check_conventions.py --base upstream/mainpassed locally.git diff --check upstream/mainpassed locally.python tools/pr_overlap.py --branch feat/nkwebkit-port-allowedverified no duplicate implementations outside companion PR #14303.URLmemory structures. Linux runtime execution and physical PS5 console execution have not been verified.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)URLPorthelper with #14303; whichever merges second will rebase onto main and retain a single shared helper)Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:47:01Z.
Review: COMMENTED
Withdrawn. This review applied a title-ID/log requirement that is not in CONTRIBUTING (
Unblocks: noneis allowed), and it contained no code review.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T06:07:27Z.
Review: COMMENTED
Reviewed — no blocking findings
WTF::portAllowedis now implemented: it parses the port from the URL, blocks the listed ports, and makes exceptions for ftp on 21 and 22 and for thefilescheme. The stub is removed fromExport.cppand from the inventory, and the debt count drops by one. The hosted Windows run passed all 2594 cases, includingnkwebkit_wtf, which holds the new test cases. The file header now carries WebKit's copyright and BSD notice, and that needs a provenance answer (below).What I ran
ed545fd36f9a2070ccd68519cf7c7b062b68819c; basee0caf1360035286bd22b9f2a3030e97b880ffb28. 6 files, +248/-7:src/WtfString.cpp(+75: the license header,IsUnicodeCompatibleASCIIWhitespace,URLPort,portAllowed),tests/Wtf.cpp(+171),Export.cpp(stub removed),include/InventoryExports.hpp(one line removed),include/WtfExports.hpp(declaration added), anddocs/dev/debt/libSceNKWebKit.md(+3/-1).nkwebkit_wtfpassed. One conventions run failed at 19:41 UTC and the latest run passed at 19:47 UTC, so the failure is superseded.Results
URLPort)nkwebkit_wtf(hosted, Windows)Read-only check output
Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: passed (10333 symbols). Stack check: passed. Hosted:
gh api repos/boykopovar/AnyPS5/commits/ed545fd36f9a2070ccd68519cf7c7b062b68819c/check-runs, and the Windows job log.Negative control
Not run here. A negative control needs a build, and code from this head is not run here.
Findings
Blocking
None.
Non-blocking
WtfString.cpp, which had none. The PR checklist says new third-party code is a submodule, and the debt entries for other WTF functions cite the pinned upstream source. Please say whetherportAllowedandURLPortare adapted from WebKit. If they are, name the upstream file and revision in the debt entry. If they are not, drop the notice.truewhen the port cannot be parsed (for example80junkor a value above 65535). The tests pin that. It is a policy choice, and it is not checked against WebKit here.Sources
github.com/boykopovar/AnyPS5@ed545fd36f/core/libs/prx/libSceNKWebKit/src/WtfString.cppgithub.com/boykopovar/AnyPS5@ed545fd36f/core/libs/prx/libSceNKWebKit/tests/Wtf.cppgithub.com/boykopovar/AnyPS5@ed545fd36f/core/libs/prx/libSceNKWebKit/include/WtfExports.hppgithub.com/boykopovar/AnyPS5@ed545fd36f/docs/dev/debt/libSceNKWebKit.mdNot verified
To get this to a good state