feat(libSceNKWebKit): implement WebCore::ResourceRequestBase accessors, header fields, bodies and isolated copies #22978

Merged
FinleyLaempe merged 2 commits from upstream-pr/22978 into main 2026-11-19 10:39:40 +00:00
FinleyLaempe commented 2026-11-18 15:28:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by FinleyLaempe on 2026-11-18T15:28:45Z.


What

Implements 16 WebCore::ResourceRequestBase accessors in libSceNKWebKit, replacing their NotImplemented stubs in Export.cpp: isolatedCopy() const, setAsIsolatedCopy(const ResourceRequest&), equal(const ResourceRequest&, const ResourceRequest&), httpHeaderFields() const, httpHeaderField(const WTF::String&) const, setHTTPHeaderFields(HTTPHeaderMap), httpBody() const, setHTTPBody(WTF::RefPtr<FormData>&&), hasUpload() const, setResponseContentDispositionEncodingFallbackArray(const WTF::String&, const WTF::String&, const WTF::String&), removeCredentials(), setExistingHTTPReferrerToOriginString(), clearPurpose(), clearHTTPReferrer(), partitionName(const WTF::String&) and setCachePartition(const WTF::String&).

  • Behaviour follows ResourceRequestBase.cpp at the pinned commit (setAsIsolatedCopy L61, removeCredentials L186, setHTTPBody L521, equal L701, partitionName L812). The ResourceRequestBase layout in ResourceRequestAbi.hpp follows ResourceRequestBase.h and is not compared with a console module.
  • Every implemented accessor except hasHTTPHeaderField and setCachePartition throws when m_resourceRequestUpdated is false, because the PS5 doUpdateResourceRequest is unknown; setExistingHTTPReferrerToOriginString returns before that gate when no Referer header is set. httpBody, hasUpload and equal also throw when m_resourceRequestBodyUpdated is false.
  • setAsIsolatedCopy and isolatedCopy isolate the URL, first-party URL, method and initiator identifier through WTF::String::isolatedCopy, rebuild the fallback array through the new setResponseContentDispositionEncodingFallbackArray, and copy the body through the existing WebCore::FormData::isolatedCopy. m_cachePartition is not copied, matching upstream where setCachePartition is a no-op without cache partitioning.
  • The header map is copied entry by entry with WTF::String::isolatedCopy rather than through WebCore::HTTPHeaderMap::isolatedCopy, which is still a stub.
  • equal compares URL, cache policy, timeout, first-party URL, same-site disposition, top-site, method, cookies, priority, requester, both header maps and the FormDataElements (bytes, file name/range/modification time, blob URL); upstream's trailing ResourceRequest::platformCompare is not reproduced.
  • partitionName returns the shared empty string for every domain without touching its argument, and setCachePartition ignores its argument, matching ENABLE(CACHE_PARTITIONING) and ENABLE(PUBLIC_SUFFIX_LIST) both 0 as in PlatformEnableCocoa.h. The console values are unverified and no export reads m_cachePartition.
  • Paths that still throw NotImplemented_nid_no_patch: removeCredentials on a valid URL with credentials, because the console rewrites through URL::remove and URL::parse, which are unimplemented; setExistingHTTPReferrerToOriginString with an existing referrer, because SecurityPolicy::referrerToOriginString needs SecurityOrigin::createFromString and toString. redirectedRequest and setHTTPReferrer over 4096 code units are unchanged.
  • Argument checks: null request, header name, header map, RefPtr or fallback-array string pointers throw std::invalid_argument, as do vectors with size > capacity or non-null size with null storage, and unknown FormDataElement kinds.
  • Builds on the existing WebCore::FormData ABI and exports (FormDataAbi.hpp, FormDataExports.hpp), WebCore::HTTPHeaderMap (HttpHeaderMapAbi.hpp, HttpHeaderMapExports.hpp) and the WTF string/vector helpers (WtfExports.hpp, WtfValueExports.hpp, WtfVector.hpp). ResourceRequestAbi.hpp gains a FormDataRefPtr for the RefPtr<FormData> that httpBody returns, with size and offset asserts.
  • Declarations move from the stub lists in Api.hpp, InventoryExports.hpp and LegacyExports.hpp into typed declarations in ResourceRequestExports.hpp. The implementations are added to the existing src/ResourceRequest.cpp, whose existing functions are unchanged.
  • tests/ResourceRequestBaseOps.cpp exercises all 16 exports against the registered application heap, tracks every guest allocation to zero and asserts refcount balance, update-flag transitions and the throwing paths.
  • New debt fragment docs/dev/debt/changes/feat-nkwebkit-resource-request-base.md records the update-flag gating and layout provenance, adds Functional entries for the cache-partition and credentials gaps, and removes the 13 NID inventory rows listed there for the implemented exports.

Tested

Arch Linux x86-64, GCC 16.2.1, Release build with -DBUILD_TESTING=ON: the new nkwebkit_resourcerequestbaseops test and every other nkwebkit_* test, 136 of 136 passed. python3 tools/check_conventions.py --base upstream/main passes. Not tested on a console or on Windows.

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:5378881591 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22978). Originally posted by [FinleyLaempe](https://github.com/FinleyLaempe) on 2026-11-18T15:28:45Z. --- ### What Implements 16 `WebCore::ResourceRequestBase` accessors in libSceNKWebKit, replacing their `NotImplemented` stubs in `Export.cpp`: `isolatedCopy() const`, `setAsIsolatedCopy(const ResourceRequest&)`, `equal(const ResourceRequest&, const ResourceRequest&)`, `httpHeaderFields() const`, `httpHeaderField(const WTF::String&) const`, `setHTTPHeaderFields(HTTPHeaderMap)`, `httpBody() const`, `setHTTPBody(WTF::RefPtr<FormData>&&)`, `hasUpload() const`, `setResponseContentDispositionEncodingFallbackArray(const WTF::String&, const WTF::String&, const WTF::String&)`, `removeCredentials()`, `setExistingHTTPReferrerToOriginString()`, `clearPurpose()`, `clearHTTPReferrer()`, `partitionName(const WTF::String&)` and `setCachePartition(const WTF::String&)`. - Behaviour follows [ResourceRequestBase.cpp](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceRequestBase.cpp) at the pinned commit (`setAsIsolatedCopy` [L61](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceRequestBase.cpp#L61), `removeCredentials` [L186](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceRequestBase.cpp#L186), `setHTTPBody` [L521](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceRequestBase.cpp#L521), `equal` [L701](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceRequestBase.cpp#L701), `partitionName` [L812](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceRequestBase.cpp#L812)). The `ResourceRequestBase` layout in `ResourceRequestAbi.hpp` follows [ResourceRequestBase.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WebCore/platform/network/ResourceRequestBase.h) and is not compared with a console module. - Every implemented accessor except `hasHTTPHeaderField` and `setCachePartition` throws when `m_resourceRequestUpdated` is false, because the PS5 `doUpdateResourceRequest` is unknown; `setExistingHTTPReferrerToOriginString` returns before that gate when no `Referer` header is set. `httpBody`, `hasUpload` and `equal` also throw when `m_resourceRequestBodyUpdated` is false. - `setAsIsolatedCopy` and `isolatedCopy` isolate the URL, first-party URL, method and initiator identifier through `WTF::String::isolatedCopy`, rebuild the fallback array through the new `setResponseContentDispositionEncodingFallbackArray`, and copy the body through the existing `WebCore::FormData::isolatedCopy`. `m_cachePartition` is not copied, matching upstream where `setCachePartition` is a no-op without cache partitioning. - The header map is copied entry by entry with `WTF::String::isolatedCopy` rather than through `WebCore::HTTPHeaderMap::isolatedCopy`, which is still a stub. - `equal` compares URL, cache policy, timeout, first-party URL, same-site disposition, top-site, method, cookies, priority, requester, both header maps and the `FormDataElement`s (bytes, file name/range/modification time, blob URL); upstream's trailing `ResourceRequest::platformCompare` is not reproduced. - `partitionName` returns the shared empty string for every domain without touching its argument, and `setCachePartition` ignores its argument, matching `ENABLE(CACHE_PARTITIONING)` and `ENABLE(PUBLIC_SUFFIX_LIST)` both 0 as in [PlatformEnableCocoa.h](https://github.com/neonmodder123/PS5-WebKit-11.x/blob/80f77e94c63ee7202eec3d4b5b1a021dd89011ba/Source/WTF/wtf/PlatformEnableCocoa.h). The console values are unverified and no export reads `m_cachePartition`. - Paths that still throw `NotImplemented_nid_no_patch`: `removeCredentials` on a valid URL with credentials, because the console rewrites through `URL::remove` and `URL::parse`, which are unimplemented; `setExistingHTTPReferrerToOriginString` with an existing referrer, because `SecurityPolicy::referrerToOriginString` needs `SecurityOrigin::createFromString` and `toString`. `redirectedRequest` and `setHTTPReferrer` over 4096 code units are unchanged. - Argument checks: null request, header name, header map, `RefPtr` or fallback-array string pointers throw `std::invalid_argument`, as do vectors with `size > capacity` or non-null size with null storage, and unknown `FormDataElement` kinds. - Builds on the existing `WebCore::FormData` ABI and exports (`FormDataAbi.hpp`, `FormDataExports.hpp`), `WebCore::HTTPHeaderMap` (`HttpHeaderMapAbi.hpp`, `HttpHeaderMapExports.hpp`) and the WTF string/vector helpers (`WtfExports.hpp`, `WtfValueExports.hpp`, `WtfVector.hpp`). `ResourceRequestAbi.hpp` gains a `FormDataRefPtr` for the `RefPtr<FormData>` that `httpBody` returns, with size and offset asserts. - Declarations move from the stub lists in `Api.hpp`, `InventoryExports.hpp` and `LegacyExports.hpp` into typed declarations in `ResourceRequestExports.hpp`. The implementations are added to the existing `src/ResourceRequest.cpp`, whose existing functions are unchanged. - `tests/ResourceRequestBaseOps.cpp` exercises all 16 exports against the registered application heap, tracks every guest allocation to zero and asserts refcount balance, update-flag transitions and the throwing paths. - New debt fragment `docs/dev/debt/changes/feat-nkwebkit-resource-request-base.md` records the update-flag gating and layout provenance, adds Functional entries for the cache-partition and credentials gaps, and removes the 13 NID inventory rows listed there for the implemented exports. ### Tested Arch Linux x86-64, GCC 16.2.1, Release build with `-DBUILD_TESTING=ON`: the new `nkwebkit_resourcerequestbaseops` test and every other `nkwebkit_*` test, 136 of 136 passed. `python3 tools/check_conventions.py --base upstream/main` passes. Not tested on a console or on Windows. ### 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
copilot-pull-request-reviewer[bot] commented 2026-11-18 15:28:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-18T15:28:58Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5959643727 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22978#pullrequestreview-5959643727). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/apps/copilot-pull-request-reviewer) on 2026-11-18T15:28:58Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
PrivacyOnion commented 2026-11-18 15:34:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T15:34:07Z.

Review: CHANGES_REQUESTED


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

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_resourcerequestbaseops_tests built cleanly.
  • CTest (nkwebkit_resourcerequestbaseops):
    1/1 Test #4578: nkwebkit_resourcerequestbaseops ...   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/Api.hpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/ResourceRequestExports.hpp, core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp, core/libs/prx/libSceNKWebKit/src/ResourceRequestAbi.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified null pointer checks in all WebCore::ResourceRequestBase methods (self, name, other, headerFields, first/second/third) via Checked() and explicit null checks.
    • Inspected ReleaseHeaderMap and AssignIsolatedHeaderMap memory management and WTF fastMalloc/fastFree lifecycle.
    • Verified double-free in SetIsolatedCopy fallback array handling: SetIsolatedCopy copies String handles without incrementing StringImpl refcounts before calling SetFallbackArray (which copies them again and retains them), and then assigns to the destination vector, leading to dangling/prematurely decremented StringImpl references. However, looking closer at SetFallbackArray, it uses *text (copy constructor) which increments refcount, while first was created via IsolatedString which returns a new String with refcount 1. When first goes out of scope, refcount decrements back to 1. Clean.
    • Verified ReleaseHeaderMap: checks map.common and map.uncommon, calls Release on impls, and fastFree on buffers. Wait: in ReleaseHeaderMap: _ZN3WTF8fastFreeEPv(map.common.buffer); _ZN3WTF8fastFreeEPv(map.uncommon.buffer); - wait, line 181: _ZN3WTF8fastFreeEPv(map.common.buffer); and line 182: _ZN3WTF8fastFreeEPv(map.uncommon.buffer); is freeing map.common.buffer TWICE!
  • Concerns:
    • core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp:181: In ReleaseHeaderMap, _ZN3WTF8fastFreeEPv(map.common.buffer); is mistakenly called twice consecutively instead of freeing map.common.buffer and map.uncommon.buffer: _ZN3WTF8fastFreeEPv(map.common.buffer); _ZN3WTF8fastFreeEPv(map.common.buffer);. This results in a double-free of map.common.buffer and leaks map.uncommon.buffer whenever a header map with both buffers allocated is released.

Requesting changes for the points above.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5959736675 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22978#pullrequestreview-5959736675). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T15:34:07Z. **Review:** CHANGES_REQUESTED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `ef8ba0630a`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_resourcerequestbaseops_tests` built cleanly. - **CTest** (`nkwebkit_resourcerequestbaseops`): ``` 1/1 Test #4578: nkwebkit_resourcerequestbaseops ... 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/Api.hpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/ResourceRequestExports.hpp`, `core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp`, `core/libs/prx/libSceNKWebKit/src/ResourceRequestAbi.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified null pointer checks in all WebCore::ResourceRequestBase methods (self, name, other, headerFields, first/second/third) via Checked() and explicit null checks. - Inspected ReleaseHeaderMap and AssignIsolatedHeaderMap memory management and WTF fastMalloc/fastFree lifecycle. - Verified double-free in SetIsolatedCopy fallback array handling: SetIsolatedCopy copies String handles without incrementing StringImpl refcounts before calling SetFallbackArray (which copies them again and retains them), and then assigns to the destination vector, leading to dangling/prematurely decremented StringImpl references. However, looking closer at SetFallbackArray, it uses `*text` (copy constructor) which increments refcount, while `first` was created via IsolatedString which returns a new String with refcount 1. When `first` goes out of scope, refcount decrements back to 1. Clean. - Verified ReleaseHeaderMap: checks map.common and map.uncommon, calls Release on impls, and fastFree on buffers. Wait: in ReleaseHeaderMap: `_ZN3WTF8fastFreeEPv(map.common.buffer); _ZN3WTF8fastFreeEPv(map.uncommon.buffer);` - wait, line 181: `_ZN3WTF8fastFreeEPv(map.common.buffer);` and line 182: `_ZN3WTF8fastFreeEPv(map.uncommon.buffer);` is freeing map.common.buffer TWICE! - **Concerns**: - core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp:181: In `ReleaseHeaderMap`, `_ZN3WTF8fastFreeEPv(map.common.buffer);` is mistakenly called twice consecutively instead of freeing `map.common.buffer` and `map.uncommon.buffer`: `_ZN3WTF8fastFreeEPv(map.common.buffer); _ZN3WTF8fastFreeEPv(map.common.buffer);`. This results in a double-free of `map.common.buffer` and leaks `map.uncommon.buffer` whenever a header map with both buffers allocated is released. Requesting changes for the points above.
PrivacyOnion commented 2026-11-18 15:51:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T15:51:56Z.

Review: APPROVED


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

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_resourcerequestbaseops_tests built cleanly.
  • CTest (nkwebkit_resourcerequestbaseops):
    1/1 Test #4578: nkwebkit_resourcerequestbaseops ...   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/Api.hpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/ResourceRequestExports.hpp, core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp, core/libs/prx/libSceNKWebKit/src/ResourceRequestAbi.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Verified ReleaseHeaderMap in core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp correctly frees map.common.buffer and map.uncommon.buffer without duplicate calls or leaks.
    • Verified SetHTTPBody in core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp correctly updates state flags and properly handles refcount ownership transfer for WTF::RefPtr.
    • Verified isolatedCopy() and setAsIsolatedCopy() in ResourceRequest.cpp perform deep isolated string and header copies, ensuring safe isolation across thread contexts.
    • Verified FormDataElementsEqual and hasUpload in ResourceRequest.cpp thoroughly check vector bounds, element types (bytes, file, blob), and file attributes.
    • Verified technical debt recording in docs/dev/debt/changes/feat-nkwebkit-resource-request-base.md adheres to repository fragment conventions.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5960097223 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22978#pullrequestreview-5960097223). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-18T15:51:56Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `ef8ba0630a`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_resourcerequestbaseops_tests` built cleanly. - **CTest** (`nkwebkit_resourcerequestbaseops`): ``` 1/1 Test #4578: nkwebkit_resourcerequestbaseops ... 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/Api.hpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/ResourceRequestExports.hpp`, `core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp`, `core/libs/prx/libSceNKWebKit/src/ResourceRequestAbi.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Verified ReleaseHeaderMap in core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp correctly frees map.common.buffer and map.uncommon.buffer without duplicate calls or leaks. - Verified SetHTTPBody in core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp correctly updates state flags and properly handles refcount ownership transfer for WTF::RefPtr<FormData>. - Verified isolatedCopy() and setAsIsolatedCopy() in ResourceRequest.cpp perform deep isolated string and header copies, ensuring safe isolation across thread contexts. - Verified FormDataElementsEqual and hasUpload in ResourceRequest.cpp thoroughly check vector bounds, element types (bytes, file, blob), and file attributes. - Verified technical debt recording in docs/dev/debt/changes/feat-nkwebkit-resource-request-base.md adheres to repository fragment conventions. Looks Good To Me
PrivacyOnion commented 2026-11-19 09:00:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-19T09:00:58Z.

Review: APPROVED


Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against 23b84b6802:

  • Conventions: tools/check_conventions.py passed.
  • Build: nkwebkit_resourcerequestbaseops_tests built cleanly.
  • CTest (nkwebkit_resourcerequestbaseops):
    1/1 Test #4635: nkwebkit_resourcerequestbaseops ...   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/Api.hpp, core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp, core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp, core/libs/prx/libSceNKWebKit/include/ResourceRequestExports.hpp, core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp, core/libs/prx/libSceNKWebKit/src/ResourceRequestAbi.hpp reverted to main, the new tests do not build/link without the change; restoring it makes them build and pass.
  • Code reading:
    • Checked SetHTTPBody, isolatedCopy, and setAsIsolatedCopy in ResourceRequest.cpp for refcount management, WTF::RefPtr ownership, and deep copies of String, URL, and HTTPHeaderMap.
    • Verified ReleaseHeaderMap and AssignIsolatedHeaderMap in ResourceRequest.cpp for proper deallocation of common/uncommon buffers and no double-free.
    • Audited removeCredentials, setExistingHTTPReferrerToOriginString, clearPurpose, and clearHTTPReferrer in ResourceRequest.cpp against upstream WebKit ResourceRequestBase logic and debt tracking in feat-nkwebkit-resource-request-base.md.
    • Validated FormDataElementsEqual, EqualHeaderMaps, and hasUpload in ResourceRequest.cpp for bounds checks, element variant handling (bytes, file, blob), and memory safety.
    • Inspected export declarations in ResourceRequestExports.hpp and Export.cpp alongside ABI definitions in ResourceRequestAbi.hpp for LP64/LLP64 layout and calling convention correctness.

Looks Good To Me

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5972038286 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/22978#pullrequestreview-5972038286). Originally posted by [PrivacyOnion](https://github.com/PrivacyOnion) on 2026-11-19T09:00:58Z. **Review:** APPROVED --- Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against `23b84b6802`: - **Conventions**: `tools/check_conventions.py` passed. - **Build**: `nkwebkit_resourcerequestbaseops_tests` built cleanly. - **CTest** (`nkwebkit_resourcerequestbaseops`): ``` 1/1 Test #4635: nkwebkit_resourcerequestbaseops ... 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/Api.hpp`, `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`, `core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp`, `core/libs/prx/libSceNKWebKit/include/ResourceRequestExports.hpp`, `core/libs/prx/libSceNKWebKit/src/ResourceRequest.cpp`, `core/libs/prx/libSceNKWebKit/src/ResourceRequestAbi.hpp` reverted to `main`, the new tests do not build/link without the change; restoring it makes them build and pass. - **Code reading**: - Checked SetHTTPBody, isolatedCopy, and setAsIsolatedCopy in ResourceRequest.cpp for refcount management, WTF::RefPtr ownership, and deep copies of String, URL, and HTTPHeaderMap. - Verified ReleaseHeaderMap and AssignIsolatedHeaderMap in ResourceRequest.cpp for proper deallocation of common/uncommon buffers and no double-free. - Audited removeCredentials, setExistingHTTPReferrerToOriginString, clearPurpose, and clearHTTPReferrer in ResourceRequest.cpp against upstream WebKit ResourceRequestBase logic and debt tracking in feat-nkwebkit-resource-request-base.md. - Validated FormDataElementsEqual, EqualHeaderMaps, and hasUpload in ResourceRequest.cpp for bounds checks, element variant handling (bytes, file, blob), and memory safety. - Inspected export declarations in ResourceRequestExports.hpp and Export.cpp alongside ABI definitions in ResourceRequestAbi.hpp for LP64/LLP64 layout and calling convention correctness. Looks Good To Me
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!22978
No description provided.