Repository navigation
feat(libSceNKWebKit): implement WebCore::SecurityOrigin and SecurityOriginData origin queries - #22751
Merged
oneandonlydean merged 2 commits intoNov 18, 2026
Conversation
Progress report (33b6998 → b444623)📈 System libraries: 42.34% (+0.02%, +9 implemented functions) ✅ 9 implemented
Changed libraries (implemented exports)
|
PrivacyOnion
approved these changes
Nov 18, 2026
PrivacyOnion
left a comment
Contributor
There was a problem hiding this comment.
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against b4446230cf:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_securityorigin_testsbuilt cleanly. - CTest (
nkwebkit_securityorigin):1/1 Test #4545: nkwebkit_securityorigin .......... Passed 0.02 sec 100% tests passed, 0 tests failed out of 1 - Negative control: with
core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/SecurityOriginExports.hpp,core/libs/prx/libSceNKWebKit/src/Mime.cpp,core/libs/prx/libSceNKWebKit/src/SecurityOrigin.cpp,core/libs/prx/libSceNKWebKit/src/WtfString.cpp,core/libs/prx/libSceNKWebKit/src/WtfStringAbi.hppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- SecurityOriginAbi.hpp: verified struct alignments, sizes (64B for SecurityOrigin, 32B for SecurityOriginData), and offset static_asserts against WebKit release layout and libc++ variant layout
- SecurityOrigin.cpp: verified null pointer checks using Checked() for self, other, and url across all exported WebCore::SecurityOrigin and WebCore::SecurityOriginData functions
- SecurityOrigin.cpp: verified fastMalloc/fastFree and atomic refCount memory management in PendingOrigin, CreateFromURL, CreateFromData, and SecurityOrigin::deref
- SecurityOrigin.cpp: checked string concatenation and length limits in Concatenate, ensuring protection against integer overflow (> std::numeric_limits<int32_t>::max())
- SecurityOrigin.cpp: checked origin comparisons (equal, isSameOriginAs) for correct handling of opaque identifiers and domainWasSetInDOM semantics
- docs/dev/debt/changes/feat-libscenkwebkit-security-origin.md: verified debt fragment records all unimplemented paths (blob URLs, non-file local schemes in CreateFromData, etc.) per AGENTS.md rules
Looks Good To Me
12 tasks done
Open
12 tasks done
12 tasks done
12 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements 11
libSceNKWebKitexports for WebKit's origin model, ported from the pinned PS5 WebKit source neonmodder123/PS5-WebKit-11.x@80f77e94c63e (SecurityOrigin.cpp/.h,SecurityOriginData.cpp/.h,OriginAccessEntry.cpp, andURL::hasSpecialSchemefromWTF/wtf/URL.cpp):WebCore::SecurityOrigin::create(const URL&),toString,toRawString,isolatedCopy,equal,isSameOriginAs,domainForCachePartition,isMatchingRegistrableDomainSuffixWebCore::SecurityOriginData::toString,databaseIdentifier,securityOriginChanges:
src/SecurityOriginAbi.hpp(new) models the release-build layout ofSecurityOrigin(64 bytes) andSecurityOriginData(32 bytes, astd::variantof tuple and opaque data), taken from the pinnedSecurityOrigin.h,SecurityOriginData.handProcessQualified.h.static_asserts pin every offset and both sizes.include/SecurityOriginExports.hppholds the typed declarations. The stubs are removed fromExport.cpp, and the declarations fromInventoryExports.hpp.src/Mime.cppgets two small accessors over the existing no-access and cache-partitioned scheme registries.src/WtfString.cppexposes the existing URL port helper.Paths that still throw
NotImplemented_nid_no_patch, all recorded in the debt fragment:create(URL)forblob:URLs, because there is no blob origin cache;SecurityOriginData::securityOriginfor local schemes other thanfile, because there is no URL parser.The fragment also records the layout assumption that libc++'s
std::variantindex is 32 bits.Known nit, left for review: raw URL bit masks could be a named helper.
Note on overlap:
tools/pr_overlap.py --branchreports a textual conflict with #19636 insrc/Mime.cpp(L711-712 on main). Both PRs append new code at the end of the file, so the conflict is trivial to resolve and neither PR changes the other's code. The tool could not compare 29 other PRs (#13515, #14138, #14164, #14259, #14860, #16510, #17550, #17569, #17695, #17771, #17793, #17805, #17922, #17927, #17933, #18395, #18797, #18802, #19105, #19823, #20304, #20314, #20327, #21957, #22454, #22555, #22556, #22557, #22674), because each conflicts withmain. They share onlyExport.cpp/InventoryExports.hppwith this PR. I checked their diffs by hand: none adds, edits or removes any of the exports this PR implements.Tested
Not tested with a title or homebrew. Unit tests only, on Linux (Docker, Ubuntu image).
The build targets were
libSceNKWebKit nkwebkit_securityorigin_tests nkwebkit_forwarding_tests nkwebkit_symbolset_tests, run withctest -R '^(nkwebkit_securityorigin|nkwebkit_forwarding|nkwebkit_symbolset|public_headers.*)$':nkwebkit_securityorigin,nkwebkit_forwardingandnkwebkit_symbolsetpass. Four tests fail:public_headers_compile_1/16/29/39, on-Winvalid-offsetofforRegioninRegionExports.hpp, a file this PR does not touch. Unmodifiedmain(324cc95) built with Clang fails the same four tests (4 of 67), so they fail before this PR too.New tests cover:
fileorigins;equal,isSameOriginAsanddocument.domainhandling;isolatedCopy(deep string copies, every flag, refcounts);domainForCachePartition, including a registered scheme;isMatchingRegistrableDomainSuffix(public suffixes, IP address vs domain);SecurityOriginData::toString,databaseIdentifierandsecurityOrigin;NotImplementedpaths, a valueless variant and null-pointer throws.A scratch program built with both g++ and clang++ checked the layout offsets against the
static_asserts.Also passed:
tools/check_conventions.py --base upstream/mainandtools/debt_fold.py --check.Not run: the Windows (MSYS2) build, and the Clang tests after the rebase. None of the commits the rebase took in touch
libSceNKWebKit.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)