feat(libSceNKWebKit): implement WebCore::BlobDataFileReference #21422
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/21422"
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 RiverWhy on 2026-11-16T05:57:33Z.
What
Implements the 11 exports of
WebCore::BlobDataFileReference, the reference-counted file aBlobis backed by. It is ported from BlobDataFileReference.cpp ate12a212a531a, the 2021 revision whose WTF ABI the module matches. PlayStation has noFILE_REPLACEMENT, so the replacement-file generation paths are not part of it.C1,C2): vtable, reference count 1, both paths copied, size 0, no expected modification time.create: allocates with the guestoperator newand constructs (the class is notWTF_MAKE_FAST_ALLOCATED), returned as aRef.D1,D2, andD0, which also calls the guestoperator delete): a non-null replacement path is deleted the way that revision'sFileSystem::deleteFiledoes (not when it is a directory,unlink).path(): the replacement path when it is not null, otherwise the path.expectedModificationTime():Optional<WallTime>, empty until tracking found the file.startTrackingModifications(): takes the modification time of the path; the size comes from the replacement file when there is one, otherwise from the path. If the path is missing, nothing changes; if only the replacement is missing, the time is kept and the size is not set.prepareForFileAccess,revokeFileAccess: no-ops, as in the source.Layout and ABI, measured on a Linux build of that revision (
-fdump-lang-class,offsetof, generated assembly) and checked withstatic_asserts:RefCountedcount at 8, path at 16, replacement path at 24, size at 0x20 (where the existingBlobDataFileReference::size()getter already reads it),Markable<WallTime>at 40 with NaN as empty.prepareForFileAccess,revokeFileAccess.Optional<WallTime>is not trivially copyable, so it is returned through a hidden pointer as{bool, double}. The host type copies that, and the compiled export stores the flag at 0 and the time at 8, as the 2021 build's code does.File metadata follows that revision's
fileMetadataFollowingSymlinks, which the module does not export: a gueststat(it follows links), the modification time in whole seconds (file_clock::to_time_tin libc++), and a length only for regular files (directory_entry::file_sizefails for anything else and WebKit then uses 0).expectedModificationTimewas a legacy stub inLegacyExports.hpp, so it has no debt row; the other 10 come out of the inventory.A null object or path throws.
Debt: a fragment,
docs/dev/debt/changes/feat-nkwebkit-blob-data-file-reference.md, adds the entry under Functional and removes the 10 inventory rows.Overlap:
pr_overlap.py --namesfinds no open PR with these exports.--branchcould not merge-compare 25 older NKWebKit PRs that conflict withmain; none of their diffs mentionsBlobDataFileReference. Other NKWebKit PRs touchExport.cpp,InventoryExports.hppand the end oflibSceNKWebKit.hpp, which can give line conflicts only.Tested
Linux Mint 22.3:
Optional<WallTime>return checked against a Linux build ofe12a212a531a(probe of the class with WTF's ownRefCounted,MarkableandOptional), and the export's assembly compared with that build's.nkwebkit_blobdatafilereferencetest, with files under a guest path alias:path()with and without a replacement;stat;createallocating one object on a recording guest heap, the four vtable slots called as guest code would, and the deleting destructor freeing it;ctest -R nkwebkit: 105 tests passed.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-16T06:21:56Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
205f48ba63:tools/check_conventions.pypassed;git diff --checkclean.nkwebkit_blobdatafilereference_testsbuilt cleanly.nkwebkit_blobdatafilereference):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hppreverted 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-16T06:34:38Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation has no verified blocking defect, but the full review is incomplete because two changed files were excluded from the review folder and no checks were run.
What I ran
Reviewed head
205f48ba63f2f87fccfc4820019da0e143d1db8cusing the prepared diff andrepo_read.py. No build or tests were run.Read:
description.md,commits.md,manifest.json,diff.patch;CMakeLists.txt,BlobDataFileReferenceExports.hpp,libSceNKWebKit.hpp,BlobDataFileReference.cpp, andBlobDataFileReferenceAbi.hpp.Excluded: full text of
Export.cppandInventoryExports.hpp(too large for the review folder). The changed hunks for both are present indiff.patch.Results
Findings
Blocking
None verified in the inspected code.
Non-blocking
None.
Sources
Behavior and implementation claims are based on the prepared diff and files read at the pinned head. No external sources were consulted.
Not verified
The full contents of
Export.cppandInventoryExports.hppwere not read. Build and test results reported in the PR description were author-reported and not independently run.To get this to a good state
Nothing is required. The review remains incomplete until the excluded changed files and checks are reviewed.