feat(libSceNKWebKit): implement 54 Inspector frontend dispatcher events #22689
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22689"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by RiverWhy on 2026-11-18T02:38:32Z.
What
Stacked on #22678 (its two commits come first): it reuses the shortest-double formatter that #22678 adds to
WtfNumberFormat.cpp.Implements 54 11.x Inspector frontend dispatcher events, every event export still throwing on
mainexcept the twoConsoleMessageones and the 3.20Heap.trackingStart. By domain: DOM 13, Page 6, Canvas 5, Animation 4, Debugger 4, Network 4, CSS 3, Target 3, Timeline 3, Worker 3, ApplicationCache 2, Heap 2, Inspector 1, LayerTree 1 and ScriptProfiler 1.Each event builds
{"method":"Domain.event","params":{...}}and passes it to the existingFrontendRouter::sendEvent, as the 11.x generatedInspectorFrontendDispatchers.cppdoes. The parameters are strings, integers, doubles, booleans and two enums (DOM.CustomElementStateandRecording.Initiator).Source: the pinned protocol as expanded by the frontend dispatcher generator, plus the JSON writer in JSONValues.cpp and StringBuilderJSON.cpp (PS5 11.x).
Details:
paramsobject.appendQuotedJSONStringdoes:\b \t \n \f \r \" \\, other characters below 0x20 as\u00xx, and unpaired surrogates as lowercase\uxxxx. Valid pairs are copied unchanged. A nullStringwrites"".null.StringBuilderdoes.enum_constant_valuestable:CustomElementStateis 112–115 andInitiatoris 222–224. That table has no#ifentries, so its indices are the same in every port.std::out_of_range, where WebKit reads past the table. A null dispatcher or string pointer throws.Debt: a fragment,
docs/dev/debt/changes/feat-nkwebkit-inspector-frontend-events.md, adds the entry and removes the 54 inventory rows.Overlap:
pr_overlap.py --namesfinds no open PR with these exports.Tested
Linux Mint 22.3. The pinned 11.x tree built as JSCOnly compiles the generated frontend dispatchers for every domain into
libJavaScriptCore.so. A shared driver calls random events on both sides with:INT_MIN/INT_MAX;On one side it calls the real generated methods through a real
FrontendRouterwith a capturingFrontendChannel. On the other it calls these exports throughmain'sFrontendRouterand a fake channel. It hashes each captured message's bitness and characters.nkwebkit_inspectorfrontendeventstest: 16 sequences of 1,000 events match. As a one-off, 200 sequences of 10,000 also matched.nullfor infinity, and a 16-bit message with an unpaired surrogate;\u007ffails the transcript check.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Summary by CodeRabbit
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-18T02:40:06Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
eb117c5bb6:tools/check_conventions.pypassed.nkwebkit_inspectorfrontendevents_tests,nkwebkit_wtfatomstring_testsbuilt cleanly.nkwebkit_inspectorfrontendevents,nkwebkit_wtfatomstring):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/WtfNumberFormat.cpp,core/libs/prx/libSceNKWebKit/src/WtfString.cpp,core/libs/prx/libSceNKWebKit/src/WtfStringAbi.hpp,core/libs/prx/libSceNKWebKit/src/WtfTextAbi.hpp,core/libs/prx/libSceNKWebKit/src/InspectorFrontendEvents.cpp,core/libs/prx/libSceNKWebKit/src/WtfAtomString.cppreverted tomainand the new tests kept, the suite fails: Restoring the change makes it pass again.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-30T03:52:47Z.
Review: COMMENTED
Architecture findings (2)
Advisory architecture findings (2)
e1bd3c2a-34c3-4d77-bc5f-14153c6a1805Reviewing files that changed from the base of the PR and between
aecfbf79b1and553fb122c8.core/libs/prx/libSceNKWebKit/CMakeLists.txtcore/libs/prx/libSceNKWebKit/Export.cppcore/libs/prx/libSceNKWebKit/include/InspectorFrontendEventExports.hppcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppcore/libs/prx/libSceNKWebKit/include/WtfAtomStringExports.hppcore/libs/prx/libSceNKWebKit/libSceNKWebKit.hppcore/libs/prx/libSceNKWebKit/src/InspectorFrontendEvents.cppcore/libs/prx/libSceNKWebKit/src/WtfAtomString.cppcore/libs/prx/libSceNKWebKit/src/WtfString.cppcore/libs/prx/libSceNKWebKit/src/WtfStringAbi.hppcore/libs/prx/libSceNKWebKit/tests/InspectorFrontendEvents.cppcore/libs/prx/libSceNKWebKit/tests/WtfAtomString.cppdocs/dev/debt/changes/feat-nkwebkit-atom-string-table.mddocs/dev/debt/changes/feat-nkwebkit-inspector-frontend-events.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-30T13:10:47Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation matches the stated event serialization and atom string goals; this review is incomplete because several changed files and runtime checks were not verified.
What I ran
Reviewed head
553fb122c8cdbfdf92bb4f2b90f6d7586da7c723usingrepo_read.pyto inspect the prepared review packet and selected files at the pinned head. No build or tests were run.Results
Findings
Blocking
None identified in the inspected code.
Non-blocking
None.
Not verified
Export.cpp, the fullInventoryExports.hpp, the full test files, and the debt documentation were not fully reviewed. The implementation was not built or tested during this review. The reported Linux Mint build, randomized transcript comparisons, and 133 passing tests are author-reported, not independently verified.Files read at the pinned head:
CMakeLists.txt,InspectorFrontendEventExports.hpp,WtfAtomStringExports.hpp,libSceNKWebKit.hpp,InspectorFrontendEvents.cpp,WtfAtomString.cpp,WtfString.cpp,tests/InspectorFrontendEvents.cpp, andtests/WtfAtomString.cpp(selected ranges). Also inspectedInventoryExports.hpp(lines 1–5). The prepareddescription.md,commits.md,manifest.json, and selected ranges ofdiff.patchwere read. Other changed lines and file contents remain unverified.To get this to a good state
Nothing is required. Optional: complete the review of the unverified changed files and run the build and tests on this head.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:52:43Z.
Review: COMMENTED
Built the branch’s changed sources and ran InspectorFrontendEvents and WtfAtomString on Linux against the existing runtime libraries. The test run passed and covered the Inspector event payloads and the existing atom-string checks.
AI-assisted: yes.
Pull request closed