feat(libSceNKWebKit): implement WebCore::ProtectionSpaceBase predicates #16066

Merged
gslashm merged 5 commits from upstream-pr/16066 into main 2026-11-17 12:40:56 +00:00
gslashm commented 2026-11-05 14:14:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gslashm on 2026-11-05T14:14:19Z.


What

Implements three WebCore::ProtectionSpaceBase predicates for libSceNKWebKit:

  • WebCore::ProtectionSpaceBase::isProxy (_ZNK7WebCore19ProtectionSpaceBase7isProxyEv, NID tHkyOSFwdIc), from Source/WebCore/platform/network/ProtectionSpaceBase.cpp:43-49.
  • WebCore::ProtectionSpaceBase::receivesCredentialSecurely (_ZNK7WebCore19ProtectionSpaceBase26receivesCredentialSecurelyEv, NID r5QyX8BvB2c), from ProtectionSpaceBase.cpp:51-57.
  • WebCore::ProtectionSpaceBase::isPasswordBased (_ZNK7WebCore19ProtectionSpaceBase15isPasswordBasedEv, NID 14QqltFJ+xk), from ProtectionSpaceBase.cpp:59-80.

Paths and lines are at 80f77e94c63ee7202eec3d4b5b1a021dd89011ba.

ABI: ProtectionSpaceBase has no virtual functions (ProtectionSpaceBase.h:35), so this is the object. src/WebCoreTypes.hpp pins the layout from ProtectionSpaceBase.h:92-98 with static_asserts: m_host at 0, m_realm at 8, m_port at 16, m_serverType at 20, m_authenticationScheme at 21, m_isHashTableDeletedValue at 22, size 24. Both enums have a uint8_t underlying type (ProtectionSpaceBase.h:37-62) and are read as std::uint8_t, so a byte outside the enum is not undefined behaviour. Each predicate returns bool.

Behaviour that differs from upstream, and why:

  • A null self throws std::invalid_argument instead of dereferencing null.

isPasswordBased has no AuthenticationScheme::ClientCertificatePINRequested case (value 10). This matches what upstream compiles on PlayStation: the enumerator exists only under USE(GLIB) (ProtectionSpaceBase.h:58-60), and USE_GLIB is defined only for GTK and WPE (Source/WTF/wtf/PlatformUse.h:69-70). A byte of 10 returns true through the trailing return true at ProtectionSpaceBase.cpp:79.

ProtectionSpaceBase::compare (ProtectionSpaceBase.cpp:82-97) remains a throwing stub. On PlayStation USE_CURL is on (Source/cmake/OptionsPlayStation.cmake:325), so platformCompare compares m_certificateInfo (curl/ProtectionSpaceCurl.h), and the size and layout of the PS5 CertificateInfo are unknown, as the debt file already records for ResourceResponseBase. A partial compare would answer true for fields it never compared.

The two upstream notices (.cpp and .h) are kept byte for byte in the new file, including the trailing space on line 23 of each, so git diff --check reports those two lines.

Not compared with a console module.

tools/pr_overlap.py lists #13486 under the same exports. That PR is a relinker draft whose head is unchanged at 0bde10d243 and whose merge base predates the 8703 stubs, so its diff re-adds all three as NotImplemented_nid_no_patch stubs; it implements none of them. No open PR adds the same files. The 44 PRs the tool could not merge with main were compared separately: none defines one of the three names, and only #15151 adds a ProtectionSpace file, src/ProtectionSpace.cpp and src/ProtectionSpace.hpp for the WKProtectionSpace* C API, which shares no export with this PR. Line conflicts are the debt count line (docs/dev/debt/libSceNKWebKit.md:39, 18 PRs), the lines the new debt entry occupies (:14 with #16041 and #16055, :14-15 with #16016), and the neighbouring stubs (Export.cpp:39037-39052, InventoryExports.hpp:6764-6767 and the deleted table rows :6679-6682) with #15214. #15125 and #15213 also edit src/WebCoreTypes.hpp; whichever merges later keeps both sides.

Tested

Windows 11 Pro, WinLibs GCC 15.2.0. No title and no console module.

tests/WebCoreProtectionSpaceBase.cpp (nkwebkit_webcoreprotectionspacebase) pins the three signatures with static_assert, then checks: the two enum bytes at offsets 20 and 21 in a raw alignas(8) unsigned char[24]; isProxy for server types 1-8 plus 0, 9 and 255; receivesCredentialSecurely with HTTP basic for types 1-8 and with digest for every type; isPasswordBased for every scheme byte 0-255, false only at 7, 8 and 100; that host, realm, port and the deleted-value flag never change a result; and that a null self throws for all three.

  • ctest -R nkwebkit: 14 of 14 pass (13 on main; this test is new).
  • ctest -R public_headers: 65 of 65 pass.
  • python tools/progress.py --module libSceNKWebKit: 1324/11248, 3 more than main's 1321.
  • Whole suite not run.

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
  • 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:5173001083 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16066). Originally posted by [gslashm](https://github.com/gslashm) on 2026-11-05T14:14:19Z. --- ### What Implements three `WebCore::ProtectionSpaceBase` predicates for `libSceNKWebKit`: - `WebCore::ProtectionSpaceBase::isProxy` (`_ZNK7WebCore19ProtectionSpaceBase7isProxyEv`, NID `tHkyOSFwdIc`), from `Source/WebCore/platform/network/ProtectionSpaceBase.cpp:43-49`. - `WebCore::ProtectionSpaceBase::receivesCredentialSecurely` (`_ZNK7WebCore19ProtectionSpaceBase26receivesCredentialSecurelyEv`, NID `r5QyX8BvB2c`), from `ProtectionSpaceBase.cpp:51-57`. - `WebCore::ProtectionSpaceBase::isPasswordBased` (`_ZNK7WebCore19ProtectionSpaceBase15isPasswordBasedEv`, NID `14QqltFJ+xk`), from `ProtectionSpaceBase.cpp:59-80`. Paths and lines are at `80f77e94c63ee7202eec3d4b5b1a021dd89011ba`. ABI: `ProtectionSpaceBase` has no virtual functions (`ProtectionSpaceBase.h:35`), so `this` is the object. `src/WebCoreTypes.hpp` pins the layout from `ProtectionSpaceBase.h:92-98` with `static_assert`s: `m_host` at 0, `m_realm` at 8, `m_port` at 16, `m_serverType` at 20, `m_authenticationScheme` at 21, `m_isHashTableDeletedValue` at 22, size 24. Both enums have a `uint8_t` underlying type (`ProtectionSpaceBase.h:37-62`) and are read as `std::uint8_t`, so a byte outside the enum is not undefined behaviour. Each predicate returns `bool`. Behaviour that differs from upstream, and why: - A null `self` throws `std::invalid_argument` instead of dereferencing null. `isPasswordBased` has no `AuthenticationScheme::ClientCertificatePINRequested` case (value 10). This matches what upstream compiles on PlayStation: the enumerator exists only under `USE(GLIB)` (`ProtectionSpaceBase.h:58-60`), and `USE_GLIB` is defined only for GTK and WPE (`Source/WTF/wtf/PlatformUse.h:69-70`). A byte of 10 returns true through the trailing `return true` at `ProtectionSpaceBase.cpp:79`. `ProtectionSpaceBase::compare` (`ProtectionSpaceBase.cpp:82-97`) remains a throwing stub. On PlayStation `USE_CURL` is on (`Source/cmake/OptionsPlayStation.cmake:325`), so `platformCompare` compares `m_certificateInfo` (`curl/ProtectionSpaceCurl.h`), and the size and layout of the PS5 `CertificateInfo` are unknown, as the debt file already records for `ResourceResponseBase`. A partial `compare` would answer true for fields it never compared. The two upstream notices (`.cpp` and `.h`) are kept byte for byte in the new file, including the trailing space on line 23 of each, so `git diff --check` reports those two lines. Not compared with a console module. `tools/pr_overlap.py` lists #13486 under the same exports. That PR is a relinker draft whose head is unchanged at `0bde10d243` and whose merge base predates the 8703 stubs, so its diff re-adds all three as `NotImplemented_nid_no_patch` stubs; it implements none of them. No open PR adds the same files. The 44 PRs the tool could not merge with `main` were compared separately: none defines one of the three names, and only #15151 adds a `ProtectionSpace` file, `src/ProtectionSpace.cpp` and `src/ProtectionSpace.hpp` for the `WKProtectionSpace*` C API, which shares no export with this PR. Line conflicts are the debt count line (`docs/dev/debt/libSceNKWebKit.md:39`, 18 PRs), the lines the new debt entry occupies (`:14` with #16041 and #16055, `:14-15` with #16016), and the neighbouring stubs (`Export.cpp:39037-39052`, `InventoryExports.hpp:6764-6767` and the deleted table rows `:6679-6682`) with #15214. #15125 and #15213 also edit `src/WebCoreTypes.hpp`; whichever merges later keeps both sides. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 Pro, WinLibs GCC 15.2.0. No title and no console module. `tests/WebCoreProtectionSpaceBase.cpp` (`nkwebkit_webcoreprotectionspacebase`) pins the three signatures with `static_assert`, then checks: the two enum bytes at offsets 20 and 21 in a raw `alignas(8) unsigned char[24]`; `isProxy` for server types 1-8 plus 0, 9 and 255; `receivesCredentialSecurely` with HTTP basic for types 1-8 and with digest for every type; `isPasswordBased` for every scheme byte 0-255, false only at 7, 8 and 100; that host, realm, port and the deleted-value flag never change a result; and that a null `self` throws for all three. - `ctest -R nkwebkit`: 14 of 14 pass (13 on `main`; this test is new). - `ctest -R public_headers`: 65 of 65 pass. - `python tools/progress.py --module libSceNKWebKit`: `1324/11248`, 3 more than `main`'s 1321. - Whole suite not run. ### 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) - [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
MarcZX10 commented 2026-11-16 14:26:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T14:26:57Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the implementation follows the described predicates and repository source wiring includes the new implementation file.

What I ran

Reviewed head 29f9577320ad58005ae606002998f134b2ffd729. No commands or tests were run; repo_read.py was used to inspect the prepared diff and targeted source context. The PR description reports Windows 11 and GCC test runs, which I did not independently run.

Results

Check Result Note
Predicate logic and ABI declarations passed Source and layout assertions inspected
Source and test registration passed CMake source glob and test glob inspected
Test execution not run Author-reported results only
Console behavior not run No console module comparison

Findings

Blocking

None.

Non-blocking

None.

Not verified

No programmatic checks were run, and console behavior was not compared. Reviewed files: WebCoreExports.hpp, WebCoreProtectionSpaceBase.cpp, WebCoreTypes.hpp, tests/WebCoreProtectionSpaceBase.cpp, CMakeLists.txt, Export.cpp, InventoryExports.hpp, and docs/dev/debt/libSceNKWebKit.md changed hunks. The complete Export.cpp, InventoryExports.hpp, and debt document were excluded from the prepared review files; only targeted ranges or diff hunks were inspected. The other files in files.json were not read in full.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5921615801 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16066#pullrequestreview-5921615801). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T14:26:57Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the implementation follows the described predicates and repository source wiring includes the new implementation file. ## What I ran Reviewed head `29f9577320ad58005ae606002998f134b2ffd729`. No commands or tests were run; `repo_read.py` was used to inspect the prepared diff and targeted source context. The PR description reports Windows 11 and GCC test runs, which I did not independently run. ## Results | Check | Result | Note | |---|---|---| | Predicate logic and ABI declarations | passed | Source and layout assertions inspected | | Source and test registration | passed | CMake source glob and test glob inspected | | Test execution | not run | Author-reported results only | | Console behavior | not run | No console module comparison | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No programmatic checks were run, and console behavior was not compared. Reviewed files: `WebCoreExports.hpp`, `WebCoreProtectionSpaceBase.cpp`, `WebCoreTypes.hpp`, `tests/WebCoreProtectionSpaceBase.cpp`, `CMakeLists.txt`, `Export.cpp`, `InventoryExports.hpp`, and `docs/dev/debt/libSceNKWebKit.md` changed hunks. The complete `Export.cpp`, `InventoryExports.hpp`, and debt document were excluded from the prepared review files; only targeted ranges or diff hunks were inspected. The other files in `files.json` were not read in full. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-16 22:30:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-16T22:30:34Z.

Review: APPROVED


Reviewed — looks good

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head b0f829e0e537829e0ed4e974e6f193afa9e3a515 using repo_read.py for the prepared diff and targeted repository source. No commands or tests were run.

Results

Check Result Note
Diff and targeted source review passed Three predicates, ABI declarations, and tests inspected
Automated checks not run Author reports targeted tests passed; not independently verified
Console comparison not run Description says no console module was used

Findings

Blocking

None.

Non-blocking

  • The description says the source and header notices were preserved byte for byte, but the new source contains two additional Derived from lines before those notices (WebCoreProtectionSpaceBase.cpp:1, WebCoreProtectionSpaceBase.cpp:27). The notices themselves appear intact; adjust the description if byte-for-byte preservation includes the surrounding lines.

Not verified

  • No build, test, console module comparison, or test negative control was run. The reported Windows/GCC test results are author-provided.
  • Read: description.md, commits.md, manifest.json, diff.patch; changed source WebCoreProtectionSpaceBase.cpp, WebCoreTypes.hpp, WebCoreExports.hpp, and test WebCoreProtectionSpaceBase.cpp; context CMakeLists.txt, LegacyProtectionSpaceBaseAbi.hpp, LegacyProtectionSpaceBase.cpp, and CMakeLists.txt at repository root. Excluded from full-text reading because too large: Export.cpp, InventoryExports.hpp, and docs/dev/debt/libSceNKWebKit.md. files.json was not available through the reader.

To get this to a good state

Nothing is required. Optionally, align the description’s byte-for-byte statement with the added provenance lines.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5928989026 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16066#pullrequestreview-5928989026). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-16T22:30:34Z. **Review:** APPROVED --- # Reviewed — looks good Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `b0f829e0e537829e0ed4e974e6f193afa9e3a515` using `repo_read.py` for the prepared diff and targeted repository source. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | Three predicates, ABI declarations, and tests inspected | | Automated checks | not run | Author reports targeted tests passed; not independently verified | | Console comparison | not run | Description says no console module was used | ## Findings ### Blocking None. ### Non-blocking - The description says the source and header notices were preserved byte for byte, but the new source contains two additional `Derived from` lines before those notices (`WebCoreProtectionSpaceBase.cpp:1`, `WebCoreProtectionSpaceBase.cpp:27`). The notices themselves appear intact; adjust the description if byte-for-byte preservation includes the surrounding lines. ## Not verified - No build, test, console module comparison, or test negative control was run. The reported Windows/GCC test results are author-provided. - Read: `description.md`, `commits.md`, `manifest.json`, `diff.patch`; changed source `WebCoreProtectionSpaceBase.cpp`, `WebCoreTypes.hpp`, `WebCoreExports.hpp`, and test `WebCoreProtectionSpaceBase.cpp`; context `CMakeLists.txt`, `LegacyProtectionSpaceBaseAbi.hpp`, `LegacyProtectionSpaceBase.cpp`, and `CMakeLists.txt` at repository root. Excluded from full-text reading because too large: `Export.cpp`, `InventoryExports.hpp`, and `docs/dev/debt/libSceNKWebKit.md`. `files.json` was not available through the reader. ## To get this to a good state Nothing is required. Optionally, align the description’s byte-for-byte statement with the added provenance lines.
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!16066
No description provided.