Repository navigation
feat(libSceNKWebKit): implement WebCore::BlobDataItem::length - #25169
Merged
oneandonlydean merged 1 commit intoNov 22, 2026
Merged
oneandonlydean merged 1 commit into
oneandonlydean merged 1 commit into
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PrivacyOnion
approved these changes
Nov 21, 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 d711c5f2c1:
- Conventions:
tools/check_conventions.pypassed. - Build:
nkwebkit_blobdataitem_testsbuilt cleanly. - CTest (
nkwebkit_blobdataitem):1/1 Test #4785: nkwebkit_blobdataitem ............ Passed 0.07 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/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/BlobDataItem.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass. - Code reading:
- Verified WebCore::BlobDataItem layout matches upstream WebKit with 40-byte size, 8-byte alignment, and verified struct member offsets (type @ 0, data @ 8, file @ 16, offset @ 24, length @ 32).
- Verified GuestCopyIn_nid_no_patch is used properly to read both BlobDataItem and BlobDataFileReference::size safely from guest memory.
- Verified handling of length != kBlobDataItemToEndOfFile (-1), returning item.length directly for both data and file types.
- Verified handling of kBlobDataItemToEndOfFile (-1): returns length directly for Data items, and copies/returns BlobDataFileReference::size cast to long long for File items.
- Verified nullptr validation on self and item.file, throwing std::invalid_argument as specified in debt docs and verified by unit tests.
- Verified AGENTS.md conventions, debt change fragment format, header inclusions in libSceNKWebKit.hpp, and removal of old stub in Export.cpp.
Looks Good To Me
Progress report (8763aef → d711c5f)📈 System libraries: 45.23% (+0.0025%, +1 implemented function) ✅ 1 implemented
Changed libraries (implemented exports)
|
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
WebCore::BlobDataItem::length() const(_ZNK7WebCore12BlobDataItem6lengthEv,wAWyYd8-0Bk)m_lengthunless it istoEndOfFile(-1); for a file item with -1, the file reference'sm_sizeLayouts: the 40-byte
BlobDataItem(intType@0,RefPtr<DataSegment>@8,RefPtr<BlobDataFileReference>@16,long longoffset @24 and length @32,Type::Data = 0,Type::File = 1) follows the pinned BlobData.h#L43-L96 and is declared with static asserts in the newBlobDataItemExports.hpp. The file size is read at offset 32 of the existingBlobDataFileReferencemodel (src/BlobDataFileReferenceAbi.hpp), which matches the pinned BlobDataFileReference.h#L56-L69 withoutFILE_REPLACEMENT. Neither layout is compared with a console module. The item and the size are read withGuestCopyIn_nid_no_patch; an unreadable pointer faults as not implemented, and a null item or a null file reference for an unknown length throwsstd::invalid_argumentwhere the module would crash. A data item or an unknown type with -1 returns -1, as the release build does pastASSERT_NOT_REACHED.Tested
Windows 11, MinGW GCC 15.2, Release.
nkwebkit_blobdataitempasses:-1/-2values of a data item, as upstream returnsm_lengththere after its debug assert);toEndOfFilereturns the referenced file's size (4096, 0 and 2^40) without changing the reference;m_length;toEndOfFilefile item without a reference throwsstd::invalid_argument; unreadable guest memory reports not-implemented.m_offsetinstead ofm_length; reading the file size at theexpectedModificationTimeoffset.main, allnkwebkit_*tests pass, as do theregistration|conventions_pr_template|pr_overlap_exports|conventions_unknown_nidstests and everypublic_headers_compile_*batch (the new header compiles on its own).python tools/check_conventions.py --base origin/mainpasses.python tools/debt_fold.py --checkcurrently fails onmainitself (fix-libkernel-clock-id-15.mdanddocs-libkernel-clock-gettime-1360-divergence.mdchange the same libkernel entry); with that pre-existing pair set aside, it passes and folds this fragment.Not tested on a console.
Overlap (
python tools/pr_overlap.py --namesand--branch feat/nkwebkit-blob-data-item-length):mainand shareExport.cpp,InventoryExports.hpporlibSceNKWebKit.hpp; the--namessearch covers every open PR's changes and finds this export only in the refactors.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