feat(libSceNKWebKit): call the changed hook from the six HistoryItem setters #16859

Merged
majnoon40 merged 3 commits from upstream-pr/16859 into main 2026-11-12 01:53:21 +00:00
majnoon40 commented 2026-11-07 18:54:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by majnoon40 on 2026-11-07T18:54:48Z.


What

The six WebCore::HistoryItem setters that in firmware tail-jump through the function pointer in
data export TL1XjYe1xLo — setURLString, setOriginalURLString, setReferrer, setTitle,
setAlternateTitle and setShouldRestoreScrollPosition — now call it, through the internal
historyItemChangedHook pointer that defaults to a no-op, as the console's does before its module
installs a handler (BunnyFl's disassembly of the 13.42 module, recorded on #15230). The item is
passed as the argument; the other five setters keep storing and returning. The console's installed
handler, the internal code that installs it and the control-flow-integrity check stay unmodelled,
recorded in docs/dev/debt/libSceNKWebKit.md.

Tested

nkwebkit_historyitem passes on Linux (g++ 14.2; direct harness compiling src/HistoryItem.cpp,
src/WtfString.cpp, src/Bmalloc.cpp and tests/HistoryItem.cpp), including the new hook cases:
the default no-op call, each of the six setters calling the hook with the item pointer, and the
five plain setters not calling it; removing any of the six calls fails the suite (mutation-checked).
python3 tools/check_conventions.py --base origin/main passes with no findings.

Checklist

  • Branch sits on the #15230 merge c38d0772c0; later main moves are audio-only and merge clean — a direct follow-up to #15230, replacing #16833 (auto-closed by the open-PR limit while my font PR #16645 still held my single slot); 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
  • 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:5204859192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16859). Originally posted by [majnoon40](https://github.com/majnoon40) on 2026-11-07T18:54:48Z. --- ### What The six `WebCore::HistoryItem` setters that in firmware tail-jump through the function pointer in data export `TL1XjYe1xLo` — `setURLString`, `setOriginalURLString`, `setReferrer`, `setTitle`, `setAlternateTitle` and `setShouldRestoreScrollPosition` — now call it, through the internal `historyItemChangedHook` pointer that defaults to a no-op, as the console's does before its module installs a handler (BunnyFl's disassembly of the 13.42 module, recorded on #15230). The item is passed as the argument; the other five setters keep storing and returning. The console's installed handler, the internal code that installs it and the control-flow-integrity check stay unmodelled, recorded in `docs/dev/debt/libSceNKWebKit.md`. ### Tested `nkwebkit_historyitem` passes on Linux (g++ 14.2; direct harness compiling `src/HistoryItem.cpp`, `src/WtfString.cpp`, `src/Bmalloc.cpp` and `tests/HistoryItem.cpp`), including the new hook cases: the default no-op call, each of the six setters calling the hook with the item pointer, and the five plain setters not calling it; removing any of the six calls fails the suite (mutation-checked). `python3 tools/check_conventions.py --base origin/main` passes with no findings. ### Checklist - [x] Branch sits on the #15230 merge `c38d0772c0`; later `main` moves are audio-only and merge clean — a direct follow-up to #15230, replacing #16833 (auto-closed by the open-PR limit while my font PR #16645 still held my single slot); 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 - [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
gabichuuuuu commented 2026-11-07 22:23:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gabichuuuuu on 2026-11-07T22:23:54Z.

Review: COMMENTED


Read 026edf5413 against main.

I checked the six setters against HistoryItem.cpp at the pinned PS5-WebKit 80f77e94. setAlternateTitle, setURLString, setOriginalURLString, setReferrer, setTitle and setShouldRestoreScrollPosition are exactly the ones that end in notifyChanged(), which calls the notifyHistoryItemChanged pointer whose default is an empty function; the other implemented setters don't notify upstream either. The hook runs after the store and gets the item pointer. The new test can't pass on main, and the existing refcount checks still balance because Clear goes back through the setters with the no-op restored. Nothing outside the test writes historyItemChangedHook yet, which the debt entry states.

Nit: docs/dev/debt/libSceNKWebKit.md:72 still says "notifyChanged is not reproduced", while the new entry says the setters call the hook. "the installed notifyChanged handler is not reproduced" would make them agree.

Not run here; this is from reading the code.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5815302397 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16859#pullrequestreview-5815302397). Originally posted by [gabichuuuuu](https://github.com/gabichuuuuu) on 2026-11-07T22:23:54Z. **Review:** COMMENTED --- Read `026edf5413` against `main`. I checked the six setters against `HistoryItem.cpp` at the pinned PS5-WebKit `80f77e94`. `setAlternateTitle`, `setURLString`, `setOriginalURLString`, `setReferrer`, `setTitle` and `setShouldRestoreScrollPosition` are exactly the ones that end in `notifyChanged()`, which calls the `notifyHistoryItemChanged` pointer whose default is an empty function; the other implemented setters don't notify upstream either. The hook runs after the store and gets the item pointer. The new test can't pass on `main`, and the existing refcount checks still balance because `Clear` goes back through the setters with the no-op restored. Nothing outside the test writes `historyItemChangedHook` yet, which the debt entry states. Nit: `docs/dev/debt/libSceNKWebKit.md:72` still says "`notifyChanged` is not reproduced", while the new entry says the setters call the hook. "the installed `notifyChanged` handler is not reproduced" would make them agree. Not run here; this is from reading the code. AI-assisted: yes.
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!16859
No description provided.