feat(libSceNKWebKit): implement WKFramePolicyListener decision calls #15178

Closed
adriaespii wants to merge 1 commit from upstream-pr/15178 into main
adriaespii commented 2026-11-02 20:07:19 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-11-02T20:07:19Z.


What

Implement WKFramePolicyListener decision calls in libSceNKWebKit:

  • WKFramePolicyListenerUse: records Use policy decision.
  • WKFramePolicyListenerDownload: records Download policy decision.
  • WKFramePolicyListenerIgnore: records Ignore policy decision.
  • WKFramePolicyListenerUseInNewProcess: records UseInNewProcess policy decision.
  • WKFramePolicyListenerUseWithPolicies: records UseWithPolicies policy decision with custom WKWebsitePolicies.
  • WKFramePolicyListenerUseInNewProcessWithPolicies: records UseInNewProcessWithPolicies decision with policies.

The FramePolicyListener host object tracks the chosen action and attached website policies; null or wrong-type references throw std::invalid_argument via NKWebKit::Cast.

Tested

check_conventions.py --base origin/main passed. Added test coverage in Base.cpp covering each policy decision action, website policy attachment, and null reference exception handling.

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:5126664456 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15178). Originally posted by [adriaespii](https://github.com/adriaespii) on 2026-11-02T20:07:19Z. --- ### What Implement `WKFramePolicyListener` decision calls in `libSceNKWebKit`: - `WKFramePolicyListenerUse`: records `Use` policy decision. - `WKFramePolicyListenerDownload`: records `Download` policy decision. - `WKFramePolicyListenerIgnore`: records `Ignore` policy decision. - `WKFramePolicyListenerUseInNewProcess`: records `UseInNewProcess` policy decision. - `WKFramePolicyListenerUseWithPolicies`: records `UseWithPolicies` policy decision with custom `WKWebsitePolicies`. - `WKFramePolicyListenerUseInNewProcessWithPolicies`: records `UseInNewProcessWithPolicies` decision with policies. The `FramePolicyListener` host object tracks the chosen action and attached website policies; null or wrong-type references throw `std::invalid_argument` via `NKWebKit::Cast`. ### Tested `check_conventions.py --base origin/main` passed. Added test coverage in `Base.cpp` covering each policy decision action, website policy attachment, and null reference exception handling. ### Checklist - [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-02 20:22:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T20:22:21Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

These exports only record decisions in unread fields, so they do not resolve WebKit policy callbacks; pairwise previews also conflict with three open WebKit PRs while this PR declares no dependency.

What I ran

Reviewed PR #15178 at head e237c24e599a15328e269d1fcc90370471a3fed2 against base/current main 096c45570f516de76a43bbe1b97781381c84f55f; its individual merge preview is clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. No local C++ build or CTest was run.

git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...e237c24e599a15328e269d1fcc90370471a3fed2
python3 tools/check_conventions.py --base 096c45570f516de76a43bbe1b97781381c84f55f --head e237c24e599a15328e269d1fcc90370471a3fed2 --title "feat(libSceNKWebKit): implement WKFramePolicyListener decision calls" --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15178-e237c24e599a/pr-body.md
python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 096c45570f516de76a43bbe1b97781381c84f55f --head e237c24e599a15328e269d1fcc90370471a3fed2 --json
python3 tools/pr_stack_check.py 15178 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15178-e237c24e599a/stack
git merge-tree --write-tree e237c24e599a15328e269d1fcc90370471a3fed2 39817b04a53c24dc3402970c6a458e64e0122f43
git merge-tree --write-tree e237c24e599a15328e269d1fcc90370471a3fed2 183bb08cd12e6d6ccf6c56a0db36bcd8d29e4a9c
git merge-tree --write-tree e237c24e599a15328e269d1fcc90370471a3fed2 3ae71a60432f41d5d1370727a7e9e4fcf9741deb
git grep -n 'FramePolicyListener::Action\|\.action\|->action\|\.policies\|->policies\|Make<NKWebKit::FramePolicyListener>' e237c24e599a15328e269d1fcc90370471a3fed2 -- core/libs/prx/libSceNKWebKit
gh pr checks 15178 --repo boykopovar/AnyPS5

Results

Check Result Note
Diff and conventions passed Clean diff; conventions passed.
ABI lexical audit passed No findings; this does not certify binary ABI correctness.
Individual base merge preview passed Clean against current base.
Production decision consumer failed Fields are only written by the exports and read by tests.
Pairwise integration previews failed Content conflicts with #15176, #15177 and #15175.
C++ tests not run Exact-head binaries require a build.
Hosted policy checks not run Six required checks remain queued.
Negative control not run No exact-head test binary was built.
Precheck results and raw outputs
Check Status Command / reason
build_and_compile not_applicable The precheck deliberately does not configure, build, or compile AnyPS5.
diff_check passed git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...e237c24e599a15328e269d1fcc90370471a3fed2
conventions_and_pr_template passed Exact-head convention and PR-template check.
changed_export_abi_audit failed Helper absent from isolated PR snapshot; the same lexical audit passed from the reviewer workspace.
python_syntax not_applicable No changed Python implementation files.
related_python_unit_tests not_applicable No changed tools module.
python_test_registration not_applicable No changed Python tests.
live_dependency_and_mergeability_check passed Current base preview is clean; PR declares no dependencies.
build_dependent_cpp_tests not_applicable C++ tests require exact-head binaries; no build was run.
test_quality_heuristics failed Optional helper absent from the isolated PR snapshot.
negative_controls not_applicable No changed Python test module for a no-build base control.

Raw convention output:

All conventions checks passed.

Raw workspace ABI audit summary:

status: passed
findings: []

Raw pairwise conflict output:

#15176
CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/src/Configuration.hpp
CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/tests/Base.cpp
CONFLICT (content): Merge conflict in docs/dev/debt/libSceNKWebKit.md

#15177
CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/src/Configuration.hpp
CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/tests/Base.cpp
CONFLICT (content): Merge conflict in docs/dev/debt/libSceNKWebKit.md

#15175
CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/tests/Base.cpp
CONFLICT (content): Merge conflict in docs/dev/debt/libSceNKWebKit.md

The precheck’s ABI/test-quality helper failures are snapshot availability failures, not findings from those analyzers.

Negative control

Not run; the added C++ tests require an exact-head build. The source-level consumer search below is independent evidence and is not a test.

Findings

Blocking

  • The decision calls have no observable decision effect. The six implementations only assign FramePolicyListener::action and optionally policies; exact-head search found no production constructor or reader for those fields, while the tests inspect the fields directly. Thus a call records an enum in an object but does not resolve the navigation policy. The corresponding WebKit C API forwards these operations to the listener’s use, download or ignore methods, which deliver the result through its completion callback. Please connect the object to a one-shot policy completion callback and test that each API call resolves it with the expected action and policies; otherwise leave these exports unimplemented until that path exists.
  • The PRs have unresolved integration conflicts. Pairwise merge-tree previews against open #15176 and #15177 conflict in Configuration.hpp, Base.cpp and the WebKit debt file; previews against #15175 conflict in Base.cpp and the debt file. This PR says Depends on: none. Please coordinate the landing order, declare the required dependency or dependencies, and resolve the resulting conflicts in the appropriate follow-up head.

Non-blocking

None.

Sources

Not verified

I did not run a local build, CTest, Linux or console tests, or a negative control. The six hosted jobs are still queued. The external WebKit source is a behavior reference, not proof of PS5-specific behavior.

To get this to a good state

Implement or defer the actual decision callback path, coordinate the conflicting WebKit PR series and update its dependency declaration, then push a new head. I’ll rerun the same no-build checks and review the exact new head; C++ tests and required hosted checks will also need to complete before approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5742808695 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15178#pullrequestreview-5742808695). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T20:22:21Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested These exports only record decisions in unread fields, so they do not resolve WebKit policy callbacks; pairwise previews also conflict with three open WebKit PRs while this PR declares no dependency. ## What I ran Reviewed PR #15178 at head `e237c24e599a15328e269d1fcc90370471a3fed2` against base/current `main` `096c45570f516de76a43bbe1b97781381c84f55f`; its individual merge preview is clean. Environment: Debian Linux x86_64, Python 3.11.2, GCC 12.2.0. No local C++ build or CTest was run. ```sh git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...e237c24e599a15328e269d1fcc90370471a3fed2 python3 tools/check_conventions.py --base 096c45570f516de76a43bbe1b97781381c84f55f --head e237c24e599a15328e269d1fcc90370471a3fed2 --title "feat(libSceNKWebKit): implement WKFramePolicyListener decision calls" --body /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15178-e237c24e599a/pr-body.md python3 tools/pr_abi_audit.py --repo /marc/AnyPS5 --base 096c45570f516de76a43bbe1b97781381c84f55f --head e237c24e599a15328e269d1fcc90370471a3fed2 --json python3 tools/pr_stack_check.py 15178 --repo boykopovar/AnyPS5 --output-dir /tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-15178-e237c24e599a/stack git merge-tree --write-tree e237c24e599a15328e269d1fcc90370471a3fed2 39817b04a53c24dc3402970c6a458e64e0122f43 git merge-tree --write-tree e237c24e599a15328e269d1fcc90370471a3fed2 183bb08cd12e6d6ccf6c56a0db36bcd8d29e4a9c git merge-tree --write-tree e237c24e599a15328e269d1fcc90370471a3fed2 3ae71a60432f41d5d1370727a7e9e4fcf9741deb git grep -n 'FramePolicyListener::Action\|\.action\|->action\|\.policies\|->policies\|Make<NKWebKit::FramePolicyListener>' e237c24e599a15328e269d1fcc90370471a3fed2 -- core/libs/prx/libSceNKWebKit gh pr checks 15178 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | Note | |---|---|---| | Diff and conventions | passed | Clean diff; conventions passed. | | ABI lexical audit | passed | No findings; this does not certify binary ABI correctness. | | Individual base merge preview | passed | Clean against current base. | | Production decision consumer | failed | Fields are only written by the exports and read by tests. | | Pairwise integration previews | failed | Content conflicts with #15176, #15177 and #15175. | | C++ tests | not run | Exact-head binaries require a build. | | Hosted policy checks | not run | Six required checks remain queued. | | Negative control | not run | No exact-head test binary was built. | <details><summary>Precheck results and raw outputs</summary> | Check | Status | Command / reason | |---|---|---| | build_and_compile | not_applicable | The precheck deliberately does not configure, build, or compile AnyPS5. | | diff_check | passed | `git diff --check 096c45570f516de76a43bbe1b97781381c84f55f...e237c24e599a15328e269d1fcc90370471a3fed2` | | conventions_and_pr_template | passed | Exact-head convention and PR-template check. | | changed_export_abi_audit | failed | Helper absent from isolated PR snapshot; the same lexical audit passed from the reviewer workspace. | | python_syntax | not_applicable | No changed Python implementation files. | | related_python_unit_tests | not_applicable | No changed tools module. | | python_test_registration | not_applicable | No changed Python tests. | | live_dependency_and_mergeability_check | passed | Current base preview is clean; PR declares no dependencies. | | build_dependent_cpp_tests | not_applicable | C++ tests require exact-head binaries; no build was run. | | test_quality_heuristics | failed | Optional helper absent from the isolated PR snapshot. | | negative_controls | not_applicable | No changed Python test module for a no-build base control. | Raw convention output: ```text All conventions checks passed. ``` Raw workspace ABI audit summary: ```text status: passed findings: [] ``` Raw pairwise conflict output: ```text #15176 CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/src/Configuration.hpp CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/tests/Base.cpp CONFLICT (content): Merge conflict in docs/dev/debt/libSceNKWebKit.md #15177 CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/src/Configuration.hpp CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/tests/Base.cpp CONFLICT (content): Merge conflict in docs/dev/debt/libSceNKWebKit.md #15175 CONFLICT (content): Merge conflict in core/libs/prx/libSceNKWebKit/tests/Base.cpp CONFLICT (content): Merge conflict in docs/dev/debt/libSceNKWebKit.md ``` The precheck’s ABI/test-quality helper failures are snapshot availability failures, not findings from those analyzers. </details> ## Negative control Not run; the added C++ tests require an exact-head build. The source-level consumer search below is independent evidence and is not a test. ## Findings ### Blocking - **The decision calls have no observable decision effect.** The six implementations only assign `FramePolicyListener::action` and optionally `policies`; exact-head search found no production constructor or reader for those fields, while the tests inspect the fields directly. Thus a call records an enum in an object but does not resolve the navigation policy. The corresponding WebKit C API forwards these operations to the listener’s `use`, `download` or `ignore` methods, which deliver the result through its completion callback. Please connect the object to a one-shot policy completion callback and test that each API call resolves it with the expected action and policies; otherwise leave these exports unimplemented until that path exists. - **The PRs have unresolved integration conflicts.** Pairwise merge-tree previews against open #15176 and #15177 conflict in `Configuration.hpp`, `Base.cpp` and the WebKit debt file; previews against #15175 conflict in `Base.cpp` and the debt file. This PR says `Depends on: none`. Please coordinate the landing order, declare the required dependency or dependencies, and resolve the resulting conflicts in the appropriate follow-up head. ### Non-blocking None. ## Sources - [Decision exports only store action and policy fields at this head](https://github.com/boykopovar/AnyPS5/blob/e237c24e599a15328e269d1fcc90370471a3fed2/core/libs/prx/libSceNKWebKit/src/FramePolicyListener.cpp#L6-L41) - [Tests assert stored fields rather than a resolved decision](https://github.com/boykopovar/AnyPS5/blob/e237c24e599a15328e269d1fcc90370471a3fed2/core/libs/prx/libSceNKWebKit/tests/Base.cpp#L354-L386) - [WebKit C API forwards calls to listener methods](https://github.com/WebKit/WebKit/blob/131c95e85e08d2fa2684b193f536a59c3544265d/Source/WebKit/UIProcess/API/C/WKFramePolicyListener.cpp#L42-L76) - [WebKit listener methods deliver actions to the completion callback](https://github.com/WebKit/WebKit/blob/131c95e85e08d2fa2684b193f536a59c3544265d/Source/WebKit/UIProcess/WebFramePolicyListenerProxy.cpp#L119-L138) - [Repository rule for agreeing on overlap order and declaring `Depends on`](https://github.com/boykopovar/AnyPS5/blob/096c45570f516de76a43bbe1b97781381c84f55f/CONTRIBUTING.md#L71) ## Not verified I did not run a local build, CTest, Linux or console tests, or a negative control. The six hosted jobs are still queued. The external WebKit source is a behavior reference, not proof of PS5-specific behavior. ## To get this to a good state Implement or defer the actual decision callback path, coordinate the conflicting WebKit PR series and update its dependency declaration, then push a new head. I’ll rerun the same no-build checks and review the exact new head; C++ tests and required hosted checks will also need to complete before approval.
adriadam10 commented 2026-11-07 03:08:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-11-07T03:08:46Z.

Review: CHANGES_REQUESTED


Checked the diff, the new FramePolicyListener type and TestFramePolicyListener; the test fails without the change (the symbols don't exist). Findings:

  • Nothing outside tests/Base.cpp constructs a FramePolicyListener (no policy-client export creates one or passes it to a guest callback), so a guest can never hold a valid WKFramePolicyListenerRef and these six exports are unreachable; the completion handler is wired to nothing. Please add the producer that creates the listener and delivers the decision (or hold this until that export exists), with a test that goes through it.
  • docs/dev/debt/libSceNKWebKit.md:26: the new line is inserted between existing entries with no blank line after it, and it doesn't state what is unverified (signatures, WKFramePolicyListener semantics when no handler is set, console behaviour). Keep a blank line between entries and list those gaps.
  • The branch conflicts with main (Export.cpp, InventoryExports.hpp, the debt file) and overlaps #13515 and #14138 on the same files; please rebase and list the PRs under Depends on if they conflict semantically.

Welcome to push the update.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5809697932 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/15178#pullrequestreview-5809697932). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-11-07T03:08:46Z. **Review:** CHANGES_REQUESTED --- Checked the diff, the new `FramePolicyListener` type and `TestFramePolicyListener`; the test fails without the change (the symbols don't exist). Findings: - Nothing outside `tests/Base.cpp` constructs a `FramePolicyListener` (no policy-client export creates one or passes it to a guest callback), so a guest can never hold a valid `WKFramePolicyListenerRef` and these six exports are unreachable; the completion handler is wired to nothing. Please add the producer that creates the listener and delivers the decision (or hold this until that export exists), with a test that goes through it. - `docs/dev/debt/libSceNKWebKit.md:26`: the new line is inserted between existing entries with no blank line after it, and it doesn't state what is unverified (signatures, `WKFramePolicyListener` semantics when no handler is set, console behaviour). Keep a blank line between entries and list those gaps. - The branch conflicts with `main` (`Export.cpp`, `InventoryExports.hpp`, the debt file) and overlaps #13515 and #14138 on the same files; please rebase and list the PRs under `Depends on` if they conflict semantically. Welcome to push the update.

Pull request closed

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!15178
No description provided.