feat(libSceNKWebKit): implement WKContextGetGeolocationManager and WKGeolocationManager functions #19486

Merged
adriaespii merged 5 commits from upstream-pr/19486 into main 2026-11-30 04:51:29 +00:00
adriaespii commented 2026-11-13 12:12:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriaespii on 2026-11-13T12:12:26Z.


What

Implement WKContextGetGeolocationManager alongside WKGeolocationManagerSetProvider, WKGeolocationManagerProviderDidChangePosition, WKGeolocationManagerProviderDidFailToDeterminePosition, and WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage.

WKContextGetGeolocationManager returns the context's host WKGeolocationManager instance (created lazily on the host ProcessPool), making the manager reachable by guest titles from a WKContextRef.

Tested

  • Windows 11 Enterprise, MinGW-w64 GCC 15.2 UCRT, Release build.
  • ools/check_conventions.py --base main passes without errors.
  • Unit tests in core/libs/prx/libSceNKWebKit/tests/GeolocationManager.cpp verify:
    • Context retrieval via WKContextGetGeolocationManager
    • Setting provider callbacks
    • Position changes and error notifications
    • Exception and invalid argument 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:5295252453 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19486). Originally posted by [adriaespii](https://github.com/adriaespii) on 2026-11-13T12:12:26Z. --- ### What Implement WKContextGetGeolocationManager alongside WKGeolocationManagerSetProvider, WKGeolocationManagerProviderDidChangePosition, WKGeolocationManagerProviderDidFailToDeterminePosition, and WKGeolocationManagerProviderDidFailToDeterminePositionWithErrorMessage. WKContextGetGeolocationManager returns the context\'s host WKGeolocationManager instance (created lazily on the host ProcessPool), making the manager reachable by guest titles from a WKContextRef. ### Tested - Windows 11 Enterprise, MinGW-w64 GCC 15.2 UCRT, Release build. - ools/check_conventions.py --base main passes without errors. - Unit tests in core/libs/prx/libSceNKWebKit/tests/GeolocationManager.cpp verify: - Context retrieval via WKContextGetGeolocationManager - Setting provider callbacks - Position changes and error notifications - Exception and invalid argument handling ### 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-21 04:19:17 +00:00 (Migrated from github.com)

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

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head e466f1acf64550c0e9f73c17294603e49920ebeb using the prepared diff and repo_read.py. No build or tests were run; the Windows build and unit tests are author-reported.

Results

Check Result Note
Diff and changed code review passed All six files listed as included in the manifest were read.
Build and unit tests not run Results in the description are author-reported.
Export routing not verified Full export files were excluded from the review folder.

Findings

Blocking

None.

Non-blocking

  • WKGeolocationManagerProviderDidChangePosition ignores a null position reference and leaves the prior position intact (core/libs/prx/libSceNKWebKit/src/GeolocationManager.cpp:28-30). Please confirm that this matches the intended provider API behavior; the current test only checks that the call does not throw.
  • The provider state is copied and recorded but its callbacks are not invoked, and WebKit geolocation service integration is not modeled, as recorded in the debt entry (docs/dev/debt/changes/nkwebkit-context-geolocation-manager.md:5). This limits the implementation to manager access and state bookkeeping.

Not verified

  • The full text of core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp was excluded because each is too large for the review folder. The diff shows the old stubs removed, and repository searches did not find the new provider names in Export.cpp; export routing and ABI registration therefore remain unverified.
  • Build, unit tests, and hardware or console behavior were not run or confirmed.
  • Read: core/libs/prx/libSceNKWebKit/include/WebKitValueExports.hpp, core/libs/prx/libSceNKWebKit/src/Configuration.hpp, core/libs/prx/libSceNKWebKit/src/GeolocationManager.cpp, core/libs/prx/libSceNKWebKit/src/Types.hpp, core/libs/prx/libSceNKWebKit/tests/GeolocationManager.cpp, docs/dev/debt/changes/nkwebkit-context-geolocation-manager.md, and targeted ranges in core/libs/prx/libSceNKWebKit/src/Object.hpp, core/libs/prx/libSceNKWebKit/src/Context.cpp, core/libs/prx/libSceNKWebKit/src/TypeIds.cpp, and core/libs/prx/libSceNKWebKit/CMakeLists.txt.
  • Excluded from full-text review: core/libs/prx/libSceNKWebKit/Export.cpp and core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp.

To get this to a good state

Nothing is required. Optional: confirm the null-position behavior and clarify the limits of provider callback and service integration in the PR description.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6002777649 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19486#pullrequestreview-6002777649). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-21T04:19:17Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `e466f1acf64550c0e9f73c17294603e49920ebeb` using the prepared diff and `repo_read.py`. No build or tests were run; the Windows build and unit tests are author-reported. ## Results | Check | Result | Note | |---|---|---| | Diff and changed code review | passed | All six files listed as included in the manifest were read. | | Build and unit tests | not run | Results in the description are author-reported. | | Export routing | not verified | Full export files were excluded from the review folder. | ## Findings ### Blocking None. ### Non-blocking - `WKGeolocationManagerProviderDidChangePosition` ignores a null position reference and leaves the prior position intact (`core/libs/prx/libSceNKWebKit/src/GeolocationManager.cpp:28-30`). Please confirm that this matches the intended provider API behavior; the current test only checks that the call does not throw. - The provider state is copied and recorded but its callbacks are not invoked, and WebKit geolocation service integration is not modeled, as recorded in the debt entry (`docs/dev/debt/changes/nkwebkit-context-geolocation-manager.md:5`). This limits the implementation to manager access and state bookkeeping. ## Not verified - The full text of `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp` was excluded because each is too large for the review folder. The diff shows the old stubs removed, and repository searches did not find the new provider names in `Export.cpp`; export routing and ABI registration therefore remain unverified. - Build, unit tests, and hardware or console behavior were not run or confirmed. - Read: `core/libs/prx/libSceNKWebKit/include/WebKitValueExports.hpp`, `core/libs/prx/libSceNKWebKit/src/Configuration.hpp`, `core/libs/prx/libSceNKWebKit/src/GeolocationManager.cpp`, `core/libs/prx/libSceNKWebKit/src/Types.hpp`, `core/libs/prx/libSceNKWebKit/tests/GeolocationManager.cpp`, `docs/dev/debt/changes/nkwebkit-context-geolocation-manager.md`, and targeted ranges in `core/libs/prx/libSceNKWebKit/src/Object.hpp`, `core/libs/prx/libSceNKWebKit/src/Context.cpp`, `core/libs/prx/libSceNKWebKit/src/TypeIds.cpp`, and `core/libs/prx/libSceNKWebKit/CMakeLists.txt`. - Excluded from full-text review: `core/libs/prx/libSceNKWebKit/Export.cpp` and `core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp`. ## To get this to a good state Nothing is required. Optional: confirm the null-position behavior and clarify the limits of provider callback and service integration in the PR description.
malekaifa commented 2026-11-23 18:02:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-23T18:02:36Z.

Review: CHANGES_REQUESTED


Exact-head blocker on e466f1acf64550c0e9f73c17294603e49920ebeb: WKGeolocationManagerProviderDidChangePosition silently returns when positionRef == nullptr. The pinned WebKit C API (WKGeolocationManager.cpp at 80f77e94c63ee7202eec3d4b5b1a021dd89011ba) passes toImpl(positionRef) directly to WebGeolocationManagerProxy::providerDidChangePosition, and that function immediately dereferences position->corePosition(). So null is not a successful no-op in the cited source. In this project, the non-null path already goes through NKWebKit::Cast, which is the appropriate place to preserve invalid-reference handling. Please remove the silent null return (or provide console evidence that the PS5 module intentionally diverges) and add a null-position regression that proves the chosen behavior while leaving prior state unchanged on failure. AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6026842764 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19486#pullrequestreview-6026842764). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-11-23T18:02:36Z. **Review:** CHANGES_REQUESTED --- Exact-head blocker on `e466f1acf64550c0e9f73c17294603e49920ebeb`: `WKGeolocationManagerProviderDidChangePosition` silently returns when `positionRef == nullptr`. The pinned WebKit C API (`WKGeolocationManager.cpp` at `80f77e94c63ee7202eec3d4b5b1a021dd89011ba`) passes `toImpl(positionRef)` directly to `WebGeolocationManagerProxy::providerDidChangePosition`, and that function immediately dereferences `position->corePosition()`. So null is not a successful no-op in the cited source. In this project, the non-null path already goes through `NKWebKit::Cast`, which is the appropriate place to preserve invalid-reference handling. Please remove the silent null return (or provide console evidence that the PS5 module intentionally diverges) and add a null-position regression that proves the chosen behavior while leaving prior state unchanged on failure. AI-assisted: yes
MarcZX10 commented 2026-11-26 09:18:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T09:18:05Z.

Review: COMMENTED


Reviewed — no blocking findings

Nothing blocks this change; the points below are optional.

What I ran

Reviewed head 59fc913f98d6214a44b37297fd83151ce7049d32 against main. No build or tests were run. Read the prepared description, commits, manifest, diff, and the full text of all changed files except Export.cpp; inspected its relevant diff hunk. The reader reported Export.cpp as too large to include.

Results

Check Result Note
Code review passed Read changed implementation and tests
Build and tests not run No local execution available
Export.cpp not run Full file excluded by size

Findings

Blocking

None.

Non-blocking

  • WKGeolocationManagerSetProvider stores the provider base, but does not invoke provider callbacks, and the manager is not integrated with a WebKit geolocation service. The debt entry documents these limits. If this PR is meant to enable title geolocation end to end, that behavior remains to be implemented. (GeolocationManager.cpp, debt entry)

Not verified

The author reports a Windows 11 Release build, convention check, and unit tests; these were not run in this review. The full Export.cpp text was not read. All other changed files listed in the manifest were read.

To get this to a good state

Nothing is required. Optional: follow up with callback invocation and WebKit geolocation service integration if end-to-end geolocation is in scope.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6071388565 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19486#pullrequestreview-6071388565). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-26T09:18:05Z. **Review:** COMMENTED --- # Reviewed — no blocking findings Nothing blocks this change; the points below are optional. ## What I ran Reviewed head `59fc913f98d6214a44b37297fd83151ce7049d32` against `main`. No build or tests were run. Read the prepared description, commits, manifest, diff, and the full text of all changed files except `Export.cpp`; inspected its relevant diff hunk. The reader reported `Export.cpp` as too large to include. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | Read changed implementation and tests | | Build and tests | not run | No local execution available | | Export.cpp | not run | Full file excluded by size | ## Findings ### Blocking None. ### Non-blocking - `WKGeolocationManagerSetProvider` stores the provider base, but does not invoke provider callbacks, and the manager is not integrated with a WebKit geolocation service. The debt entry documents these limits. If this PR is meant to enable title geolocation end to end, that behavior remains to be implemented. ([GeolocationManager.cpp](https://github.com/boykopovar/AnyPS5/blob/59fc913f98d6214a44b37297fd83151ce7049d32/core/libs/prx/libSceNKWebKit/src/GeolocationManager.cpp), [debt entry](https://github.com/boykopovar/AnyPS5/blob/59fc913f98d6214a44b37297fd83151ce7049d32/docs/dev/debt/changes/nkwebkit-context-geolocation-manager.md)) ## Not verified The author reports a Windows 11 Release build, convention check, and unit tests; these were not run in this review. The full `Export.cpp` text was not read. All other changed files listed in the manifest were read. ## To get this to a good state Nothing is required. Optional: follow up with callback invocation and WebKit geolocation service integration if end-to-end geolocation is in scope.
malekaifa commented 2026-11-30 00:37:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by malekaifa on 2026-11-30T00:37:48Z.

Review: APPROVED


Re-reviewed exact head 59fc913f98. The earlier null-position blocker is fixed: WKGeolocationManagerProviderDidChangePosition now routes the reference through NKWebKit::Cast, and the regression test asserts the null case throws without mutating stored position/error state. I reviewed the current implementation, export routing changes, tests, and debt fragment; I found no new blocking source issue. Exact-head hosted checks are terminal with no failures (Windows, eligibility, report, library-portability, conventions, labels, and PR checks succeeded; targeted jobs are skipped as expected). Integration note: this head is currently 2,681 commits behind main, although GitHub still reports it mergeable/clean, so refresh policy is a separate merge-queue decision.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6105675777 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/19486#pullrequestreview-6105675777). Originally posted by [malekaifa](https://github.com/malekaifa) on 2026-11-30T00:37:48Z. **Review:** APPROVED --- Re-reviewed exact head 59fc913f98d6214a44b37297fd83151ce7049d32. The earlier null-position blocker is fixed: WKGeolocationManagerProviderDidChangePosition now routes the reference through NKWebKit::Cast, and the regression test asserts the null case throws without mutating stored position/error state. I reviewed the current implementation, export routing changes, tests, and debt fragment; I found no new blocking source issue. Exact-head hosted checks are terminal with no failures (Windows, eligibility, report, library-portability, conventions, labels, and PR checks succeeded; targeted jobs are skipped as expected). Integration note: this head is currently 2,681 commits behind main, although GitHub still reports it mergeable/clean, so refresh policy is a separate merge-queue decision.
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!19486
No description provided.