feat(libSceNKWebKit): implement PAL::SleepDisabler and WebCore::sleepDisablerClient #22450
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/22450"
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-17T16:41:05Z.
What
Implements
PAL::SleepDisablerandWebCore::sleepDisablerClient: 4 exports that all throw onmaintoday. These are the twoPAL::SleepDisabler(const char*, Type)constructors (C1,C2), the deleting destructorD0andsleepDisablerClient().PAL::SleepDisabler'sD1andD2are already empty onmain.Source: SleepDisabler.cpp and SleepDisablerClient.cpp at
e12a212a531a. The exportedconst char*constructor matches this revision; the PS5 11.x source takesconst String&.Typeat byte 8. The vtable is[D1, D0]. Both were measured by compiling these class definitions (offsetof,-fdump-lang-class).[D1, D0], because the module's own vtable is not available.D0frees the object with the guestoperator delete.PAL::SleepDisableris not fast-allocated, so it comes from the globalnew.D0works for both firmware versions.sleepDisablerClient()returns the address of one zero-initializedunique_ptr<SleepDisablerClient>slot, which never moves. This is the source'sNeverDestroyedstatic.Not included: the
WebCore::SleepDisablerconstructors and destructors still throw.D1/D2would have to serve two layouts and two client vtables.Debt: a fragment,
docs/dev/debt/changes/feat-nkwebkit-sleep-disabler.md, adds the entry under Functional and removes theD0inventory row. The other three are 3.20 exports with no inventory row.Overlap:
pr_overlap.pyfinds no open PR with these exports.libSceNKWebKit.hpp, which is a line conflict only.Tested
Linux Mint 22.3:
nkwebkit_palsleepdisablertest:C1andC2with both types, on memory from the guestoperator newfilled with0xa5: the type is at byte 8;D1through the vtable keeps the allocation;D0through the vtable, and called directly, frees it, and no guest allocation is left;sleepDisablerClient()returns the same slot each time, null at first, and keeps a stored pointer;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-17T16:44:55Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
2fb83e2fd0:tools/check_conventions.pypassed.nkwebkit_palsleepdisabler_testsbuilt cleanly.nkwebkit_palsleepdisabler):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/PalSleepDisabler.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 MarcZX10 on 2026-11-21T11:47:15Z.
Review: COMMENTED
Reviewed — no blocking findings
The reviewed change at head
863b79418bb8afdb56803263deb892164fe3a993adds PAL sleep disabler constructors, a deleting destructor, and the WebCore client slot; I found no verified blocking defects, but I did not run the tests.What I ran
Read the prepared description, commits, diff, manifest, and changed source files through
repo_read.py. No build or test commands were run.Results
Findings
Blocking
None verified.
Non-blocking
None.
Not verified
Did not read every line of
Export.cpporInventoryExports.hpp; inspected their relevant symbols and declarations through targeted searches and ranges. Did not run the new test, build, or verify behavior on a PS5 console. Other changed-file text was read:LegacyExports.hpp,PalSleepDisablerExports.hpp,libSceNKWebKit.hpp,PalSleepDisabler.cpp,tests/PalSleepDisabler.cpp, and the debt fragment. No source files were excluded by the review artifact rules.To get this to a good state
Nothing is required. The new test and build remain unrun.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T11:50:10Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
0094519b509a048561839d50965f67f95b16c04a. I read the prepared diff and targeted source context withrepo_read.py; no build or tests were run. The author reports Linux Mint 22.3 test results in the PR description; I did not run those tests.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
I read
Export.cpponly at its include lines and inspected the changed portions indiff.patch; its full text is excluded because it is too large. I did not read the full text ofInventoryExports.hpporLegacyExports.hpp; their changed lines only remove declarations shown in the diff. The included changed filesPalSleepDisablerExports.hpp,libSceNKWebKit.hpp,PalSleepDisabler.cpp,tests/PalSleepDisabler.cpp, and the debt fragment were inspected through the prepared files or targeted reader calls. I did not run the reported test, compile the change, or verify behavior on console hardware.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-28T09:58:55Z.
Review: COMMENTED
Reviewed — no blocking findings
No verified blocking defect was found in the implementation; the changed source and header were read, but
Export.cppwas excluded from the review bundle and tests were not run.What I ran
28caf0f7fc9e1ac5764fcc24b5b16ff8d74c927using the pinnedrepo_read.pyreader.description.md,commits.md,manifest.json,diff.patch,PalSleepDisabler.cpp,PalSleepDisablerExports.hpp,CMakeLists.txt, and the relevant no-op destructor declarations/definitions andExport.cppranges.files.jsonwas not available;manifest.jsonidentifiesExport.cppas excluded because it is too large. Other changed files listed there were included, but their full text was not all read.Results
Export.cppwas excluded from the bundleFindings
Blocking
None verified.
Non-blocking
None.
Not verified
Export.cppwas excluded from the review bundle; its targeted ranges were readable through the pinned reader, but its full text was not inspected.InventoryExports.hppandLegacyExports.hpp, and the full added test and debt files, were not read.To get this to a good state
Nothing is required. Optional: run the new test and verify the ABI against a console module, as recorded in the added debt entry.
Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T12:59:20Z.
Review: COMMENTED
Built the branch’s changed sources and ran PalSleepDisabler on Linux against the existing runtime libraries. The test run passed and covered the sleep disabler and client lifecycle cases.
AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T22:43:07Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
fd7559a16b668efa312b942f9f013affb5cad409using the prepared diff and the pinnedrepo_read.pyreader. No tests or build checks were run.Results
Findings
Blocking
None.
Non-blocking
docs/dev/debt/changes/feat-nkwebkit-sleep-disabler.md:7).Not verified
No tests, build, or console checks were run. Reviewed the changed hunks for all eight files listed under
files.json→reviewed. Read the full new implementation, test, export header, and debt entry; inspected the relevant changed ranges inExport.cpp.Export.cppfull text was omitted from the review folder due to size;InventoryExports.hppandLegacyExports.hppwere reviewed at their changed hunks, not in full.files.jsonlists no rule-excluded files.To get this to a good state
Nothing is required.
Pull request closed