feat(libSceNKWebKit): implement Inspector::FrontendRouter and AgentRegistry #16383
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/16383"
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 gslashm on 2026-11-06T13:59:07Z.
What
Implements 19
libSceNKWebKitexports fromSource/JavaScriptCore/inspector/InspectorFrontendRouter.cppandInspectorAgentRegistry.cppat80f77e94c6.FrontendRouter:create, constructors (C1,C2), destructors (D1,D2),connectFrontend,disconnectFrontend,disconnectAllFrontends,hasFrontends,hasLocalFrontend,hasRemoteFrontend,sendEventandsendResponse.AgentRegistry: constructor (C2), destructors (D1,D2),didCreateFrontendAndBackend,willDestroyFrontendAndBackendanddiscardValues.FrontendRouter::frontendCountis already implemented onmain(FieldGetters.cpp,+0x14) and is not redefined here.Placement: both files are hand-written ports in
core/libs/prx/libSceNKWebKit/src/, with the upstream Apple licence notices kept verbatim, as the other NKWebKit ports do. The guest layouts are pinned insrc/InspectorFrontendRouterAbi.hppand the tests are intests/. There is no submodule and no new build target; this follows the review decision against a WebKit submodule.FrontendRouteris 40 bytes (refcount at 0,Vector<FrontendChannel*, 2>at 8, inline buffer at 24) andAgentRegistryis 16 bytes (Vectorat 0), all pinned withstatic_assertand checked by the tests.create()returnsRef<FrontendRouter>, so it comes back through the hidden pointer as the 8-byte, non-trivially-destructibleFrontendRouterRef. The guestFrontendChannelandInspectorAgentBasevtables are called with the console's SysV ABI from the port (connectionTypeslot 2,sendMessageToFrontend3; agentdidCreate2,willDestroy3,discardValues4,discardAgent5, deleting destructor 1), because host virtual calls use the Windows calling convention.disconnectAllFrontendsuses upstreamVector::clear()(Vector.h:837), which callsshrinkCapacity(0): it frees the heap buffer and returns to the inline buffer with capacity 2. The reference count is a relaxed atomic in the same 4 bytes at offset 0; the pinnedRefCountedis non-atomic, so the port is stricter but layout-compatible. A null object, channel or agent entry throws before any call. No title and no console module were used.Tested
Windows 11 Pro, WinLibs GCC 15.2.0. Full build exit 0.
ctest -R nkwebkit: 64 of 64.tools/check_conventions.py --base origin/main: no findings.tools/progress.py: libraries 2784 of 11258, 19 more thanmain's 2765 of 11258; debt 5975.git diff --checkclean. No title or console module.ctest -R public_headerscurrently fails onmain'slibSceXmlduplicate declarations inApi.hppandInventoryExports.hpp; this PR does not touch that library.Based on
maine70363f52c, with the reviewer'sfb858878d9link fix anda6d087591eduplicate-count-line fix included. #16261 adds noFrontendRouterorAgentRegistryexport. The debt count line is 5994 onmainand 5975 here.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)core/with its upstream licence notice kept verbatim, as the other NKWebKit files do; no new submodule, per review