feat(libSceNKWebKit): implement the EmptyFrameLoaderClient error factories #23737

Merged
Dark3581 merged 1 commit from upstream-pr/23737 into main 2026-11-19 18:37:02 +00:00
Dark3581 commented 2026-11-19 15:03:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Dark3581 on 2026-11-19T15:03:43Z.


What

Implements the eight WebCore::EmptyFrameLoaderClient error factories in libSceNKWebKit. All were throwing stubs in Export.cpp.

  • Each returns the empty ResourceError of the pinned PS5 WebKit 11.x EmptyClients.cpp: type Cancellation for cancelledError, Null for the other seven.

  • The seven Null factories are blockedError, blockedByContentBlockerError, cannotShowURLError, interruptedForPolicyChangeError, cannotShowMIMETypeError, fileDoesNotExistError and pluginWillHandleLoadError.

  • Each export's signature matches the source exactly. The arguments are ignored, as in WebKit.

  • New src/ResourceErrorAbi.hpp is the 80-byte release layout of the pinned ResourceErrorBase.h and curl ResourceError.h:

    Field Offset
    domain 0
    failingURL 8
    localizedDescription 48
    errorCode 56
    type 60
    isSanitized 61
    tlsVerificationError 64
    tlsVerificationErrorDescription 72
  • ResourceError(Type) leaves every other member at its default. The empty failingURL is the all-zero state that URL::URL() sets through URL::invalidate.

  • The debt fragment removes the eight inventory rows and adds a Functional entry.

tools/pr_overlap.py --names lists no open PR for any of the eight. --branch failed closed on 32 PRs that conflict with main and share Export.cpp/InventoryExports.hpp. I grepped each one's diff from its merge base: none changes these eight functions or adds a ResourceError layout. No PR closed by the open-PR limit touches them either.

Tested

Windows 10 22H2, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, on main b40a0d6dc7 plus this commit.

  • ctest -R "^(nkwebkit_|guest_nkwebkit)": 154 of 154 pass, including the new nkwebkit_emptyloadererrors.
  • The new test:
    • checks the Type enum values;
    • calls each factory with and without client and argument pointers, into a result buffer pre-filled with 0xa5;
    • checks every byte except the padding: only type is nonzero, and it is Cancellation for cancelledError.
  • tools/progress.py now counts all eight as implemented.
  • tools/check_conventions.py --base origin/main, tools/debt_fold.py --check and tools/env_reference.py --check pass.

No title run: no title on hand reaches these factories.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt and the licence notice of code adapted from upstream (see AGENTS.md)
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5397383837 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23737). Originally posted by [Dark3581](https://github.com/Dark3581) on 2026-11-19T15:03:43Z. --- ### What Implements the eight `WebCore::EmptyFrameLoaderClient` error factories in libSceNKWebKit. All were throwing stubs in `Export.cpp`. - Each returns the empty `ResourceError` of the pinned [PS5 WebKit 11.x EmptyClients.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/loader/EmptyClients.cpp#L867-L919): type `Cancellation` for `cancelledError`, `Null` for the other seven. - The seven `Null` factories are `blockedError`, `blockedByContentBlockerError`, `cannotShowURLError`, `interruptedForPolicyChangeError`, `cannotShowMIMETypeError`, `fileDoesNotExistError` and `pluginWillHandleLoadError`. - Each export's signature matches the source exactly. The arguments are ignored, as in WebKit. - New `src/ResourceErrorAbi.hpp` is the 80-byte release layout of the pinned [ResourceErrorBase.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceErrorBase.h) and curl [ResourceError.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/curl/ResourceError.h): | Field | Offset | |---|---| | `domain` | 0 | | `failingURL` | 8 | | `localizedDescription` | 48 | | `errorCode` | 56 | | `type` | 60 | | `isSanitized` | 61 | | `tlsVerificationError` | 64 | | `tlsVerificationErrorDescription` | 72 | - `ResourceError(Type)` leaves every other member at its default. The empty `failingURL` is the all-zero state that `URL::URL()` sets through `URL::invalidate`. - The debt fragment removes the eight inventory rows and adds a Functional entry. `tools/pr_overlap.py --names` lists no open PR for any of the eight. `--branch` failed closed on 32 PRs that conflict with `main` and share `Export.cpp`/`InventoryExports.hpp`. I grepped each one's diff from its merge base: none changes these eight functions or adds a `ResourceError` layout. No PR closed by the open-PR limit touches them either. ### Tested Windows 10 22H2, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release, on `main` b40a0d6dc7 plus this commit. - `ctest -R "^(nkwebkit_|guest_nkwebkit)"`: 154 of 154 pass, including the new `nkwebkit_emptyloadererrors`. - The new test: - checks the `Type` enum values; - calls each factory with and without client and argument pointers, into a result buffer pre-filled with 0xa5; - checks every byte except the padding: only `type` is nonzero, and it is `Cancellation` for `cancelledError`. - `tools/progress.py` now counts all eight as implemented. - `tools/check_conventions.py --base origin/main`, `tools/debt_fold.py --check` and `tools/env_reference.py --check` pass. No title run: no title on hand reaches these factories. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) and the licence notice of code adapted from upstream (see AGENTS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
PrivacyOnion commented 2026-11-19 15:05:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T15:05:08Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 45d3e617d5:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_emptyloadererrors_tests built cleanly.
  • CTest (nkwebkit_emptyloadererrors):
    1/1 Test #4642: nkwebkit_emptyloadererrors .......   Passed    0.01 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/EmptyLoaderErrors.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified signature and calling convention (APS5_VABI / extern "C") for all 8 EmptyFrameLoaderClient error factory exports in core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp matching WebCore mangled symbols and upstream return types.
    • Verified ResourceError layout, member offsets, and size (80 bytes) against WebKit 11.x ResourceErrorBase / curl ResourceError in core/libs/prx/libSceNKWebKit/src/ResourceErrorAbi.hpp with static_asserts.
    • Verified upstream WebCore::EmptyFrameLoaderClient behavior: cancelledError returns ResourceErrorType::Cancellation and all other 7 error factories return ResourceErrorType::Null, ignoring request/response parameters as upstream EmptyClients.cpp does.
    • Verified AGENTS.md compliance: no unauthorized comments, debt fragment added at docs/dev/debt/changes/feat-nkwebkit-empty-loader-errors.md removing the 8 stubs, proper includes, and no memory leaks or undefined behavior.
    • Verified test coverage in core/libs/prx/libSceNKWebKit/tests/EmptyLoaderErrors.cpp ensuring all 8 factories return correctly initialized/zeroed structs with exact ResourceErrorType and handling null/non-null arguments without faults.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5977531179 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23737#pullrequestreview-5977531179). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T15:05:08Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `45d3e617d5`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_emptyloadererrors_tests` built cleanly. - **CTest** (`nkwebkit_emptyloadererrors`): ``` 1/1 Test #4642: nkwebkit_emptyloadererrors ....... Passed 0.01 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/EmptyLoaderErrors.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified signature and calling convention (APS5_VABI / extern "C") for all 8 EmptyFrameLoaderClient error factory exports in core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp matching WebCore mangled symbols and upstream return types. - Verified ResourceError layout, member offsets, and size (80 bytes) against WebKit 11.x ResourceErrorBase / curl ResourceError in core/libs/prx/libSceNKWebKit/src/ResourceErrorAbi.hpp with static_asserts. - Verified upstream WebCore::EmptyFrameLoaderClient behavior: cancelledError returns ResourceErrorType::Cancellation and all other 7 error factories return ResourceErrorType::Null, ignoring request/response parameters as upstream EmptyClients.cpp does. - Verified AGENTS.md compliance: no unauthorized comments, debt fragment added at docs/dev/debt/changes/feat-nkwebkit-empty-loader-errors.md removing the 8 stubs, proper includes, and no memory leaks or undefined behavior. - Verified test coverage in core/libs/prx/libSceNKWebKit/tests/EmptyLoaderErrors.cpp ensuring all 8 factories return correctly initialized/zeroed structs with exact ResourceErrorType and handling null/non-null arguments without faults. Looks Good To Me
PrivacyOnion commented 2026-11-19 17:04:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T17:04:55Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 6f7c4cfa91:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_emptyloadererrors_tests built cleanly.
  • CTest (nkwebkit_emptyloadererrors):
    1/1 Test #4648: nkwebkit_emptyloadererrors .......   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/libSceNKWebKit.hpp, core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • core/libs/prx/libSceNKWebKit/src/ResourceErrorAbi.hpp: verified 80-byte size, 8-byte alignment, exact member offsets, and static_asserts against WebKit 11.x ResourceErrorBase.h and curl/ResourceError.h
    • core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp: verified return type ResourceError and calling convention APS5_VABI on all 8 functions match WebCore::EmptyFrameLoaderClient mangling
    • core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp: confirmed cancelledError returns ResourceErrorType::Cancellation (value 3) and remaining 7 factories return ResourceErrorType::Null (value 0), ignoring parameters matching upstream WebKit EmptyClients.cpp
    • docs/dev/debt/changes/feat-nkwebkit-empty-loader-errors.md: verified debt fragment properly documents the functional addition and removes all 8 stub entries with exact NIDs
    • core/libs/prx/libSceNKWebKit/tests/EmptyLoaderErrors.cpp: verified test suite exercises all 8 functions with both dummy non-null pointers and null pointers, asserting exact type enum values and zero-initialization of remaining ABI struct bytes

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5979669413 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23737#pullrequestreview-5979669413). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T17:04:55Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `6f7c4cfa91`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_emptyloadererrors_tests` built cleanly. - **CTest** (`nkwebkit_emptyloadererrors`): ``` 1/1 Test #4648: nkwebkit_emptyloadererrors ....... 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/libSceNKWebKit.hpp`, `core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - core/libs/prx/libSceNKWebKit/src/ResourceErrorAbi.hpp: verified 80-byte size, 8-byte alignment, exact member offsets, and static_asserts against WebKit 11.x ResourceErrorBase.h and curl/ResourceError.h - core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp: verified return type ResourceError and calling convention APS5_VABI on all 8 functions match WebCore::EmptyFrameLoaderClient mangling - core/libs/prx/libSceNKWebKit/src/EmptyLoaderErrors.cpp: confirmed cancelledError returns ResourceErrorType::Cancellation (value 3) and remaining 7 factories return ResourceErrorType::Null (value 0), ignoring parameters matching upstream WebKit EmptyClients.cpp - docs/dev/debt/changes/feat-nkwebkit-empty-loader-errors.md: verified debt fragment properly documents the functional addition and removes all 8 stub entries with exact NIDs - core/libs/prx/libSceNKWebKit/tests/EmptyLoaderErrors.cpp: verified test suite exercises all 8 functions with both dummy non-null pointers and null pointers, asserting exact type enum values and zero-initialization of remaining ABI struct bytes Looks Good To Me
MarcZX10 commented 2026-11-19 17:21:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-19T17:21:17Z.

Review: APPROVED


Reviewed — looks good

Nothing in the inspected changes blocks merging; the ABI return layout remains an acknowledged limitation because it was not compared with a console module.

What I ran

Reviewed head 6f7c4cfa91de38fdd9cd4651791e53f855655d98. No commands or tests were run; repo_read.py was used to inspect the prepared review bundle and targeted source ranges.

Results

Check Result Note
Source review passed Factories and ABI declarations inspected
Tests not run Windows test results are author-reported
Console ABI comparison not run Limitation recorded in the debt entry

Findings

Blocking

None.

Non-blocking

None.

Not verified

The runtime ABI layout and return-in-memory behavior were not compared with a console module. Tests cited in the description were not run during this review. Read: description.md, commits.md, manifest.json, diff.patch, EmptyLoaderErrors.cpp, ResourceErrorAbi.hpp, EmptyLoaderErrors.cpp (tests), EmptyLoaderErrorExports.hpp, libSceNKWebKit.hpp, feat-nkwebkit-empty-loader-errors.md, and relevant ranges of Export.cpp, InventoryExports.hpp, and WtfStringAbi.hpp. Excluded by bundle rule: full Export.cpp and InventoryExports.hpp; only targeted ranges were read. files.json was unavailable; the bundle listing confirmed the changed-file inclusion status.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5979934934 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/23737#pullrequestreview-5979934934). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-19T17:21:17Z. **Review:** APPROVED --- # Reviewed — looks good Nothing in the inspected changes blocks merging; the ABI return layout remains an acknowledged limitation because it was not compared with a console module. ## What I ran Reviewed head `6f7c4cfa91de38fdd9cd4651791e53f855655d98`. No commands or tests were run; `repo_read.py` was used to inspect the prepared review bundle and targeted source ranges. ## Results | Check | Result | Note | |---|---|---| | Source review | passed | Factories and ABI declarations inspected | | Tests | not run | Windows test results are author-reported | | Console ABI comparison | not run | Limitation recorded in the debt entry | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The runtime ABI layout and return-in-memory behavior were not compared with a console module. Tests cited in the description were not run during this review. Read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`, `EmptyLoaderErrors.cpp`, `ResourceErrorAbi.hpp`, `EmptyLoaderErrors.cpp` (tests), `EmptyLoaderErrorExports.hpp`, `libSceNKWebKit.hpp`, `feat-nkwebkit-empty-loader-errors.md`, and relevant ranges of `Export.cpp`, `InventoryExports.hpp`, and `WtfStringAbi.hpp`. Excluded by bundle rule: full `Export.cpp` and `InventoryExports.hpp`; only targeted ranges were read. `files.json` was unavailable; the bundle listing confirmed the changed-file inclusion status. ## To get this to a good state Nothing is required.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!23737
No description provided.