feat(libSceNKWebKit): implement WKWebsiteDataStore creation and cookie store accessors #15170
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15170"
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 adriaespii on 2026-11-02T19:47:35Z.
What
Implement
WKWebsiteDataStorecreation and HTTP cookie store accessors inlibSceNKWebKit:WKWebsiteDataStoreGetDefaultDataStore: returns a persistent shared default store.WKWebsiteDataStoreCreateNonPersistentDataStore: allocates an ephemeral data store with a default configuration.WKWebsiteDataStoreCreateWithConfiguration: allocates a data store wrapping a givenWebsiteDataStoreConfiguration.WKWebsiteDataStoreGetHTTPCookieStore: retrieves the associatedHTTPCookieStoreobject.The objects wrap
NKWebKit::WebsiteDataStoreandNKWebKit::HTTPCookieStorewith retain/release support; null references throwstd::invalid_argumentviaNKWebKit::Cast.Tested
check_conventions.py --base origin/mainpassed. Added test coverage inConfig.cpptesting default store singleton behavior, non-persistent and custom-configured stores, distinct cookie stores, and null argument error checks.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 XairRrR on 2026-11-03T11:18:13Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
The four
WKWebsiteDataStore*exports build,nkwebkit_configandpublic_headerspass, and the new test does not compile againstmain. The technical-debt entry needs fixing: it was added twice and it describes the implemented behaviour, not the gap.What I ran
Head
89ab2c0dd1fad0d879a4e51e50b50fcd992f6353, merged with--no-ffintomain4f41f4c375f5abb487dbd184fbc150f31994d762(merged tree0a23b91ec13f161187b89c78a13d2e18fc0ec68d). Debian 13 VM, GCC 14.2.0, Release, Ninja,BUILD_TESTING=ON.Results
git diff --checkcheck_conventions.pymain(unwrap_self_..._destination_directory_group), 0 new failuresnkwebkit_configpublic_headers+ 64public_headers_compile_*public_headerstook 63 s here; the AMD run reports 74 s for the same test onmain, so this is not caused by the PR)Negative control
I restored
Export.cpp,include/InventoryExports.hpp,include/WebKitConfigExports.hppandsrc/Configuration.hppfrommainand compiledtests/Config.cppagainst them. It fails to compile, becausemainstill declares the old no-argumentintstubs:compiler output (first lines)
I did not do a full relink of the module without
WebsiteDataStore.cpp. Moving the file aside makes theCONFIGURE_DEPENDSglob re-run CMake, and this sandbox cannot reconfigure. Afterwards I restored the merged files, andgit status --porcelainis empty.Findings
The two compile errors that oneandonlydean reported at the earlier head are fixed at this head: the module and the test build.
Blocking
The debt entry is duplicated and does not state a gap.
docs/dev/debt/libSceNKWebKit.md:14anddocs/dev/debt/libSceNKWebKit.md:7468(link, link) add the same line under the file's two### Functionalheadings. The text also only describes what is now implemented. CONTRIBUTING.md says an entry "states the gap first (what differs from the console, what is unverified, what throws)".The implementation does have gaps worth recording:
WKWebsiteDataStoreCreateNonPersistentDataStoreandWKWebsiteDataStoreGetDefaultDataStorebuild the same object. Neither persistence nor a session is modelled, so the two differ only in object identity.HTTPCookieStoreholds no cookies.WKWebsiteDataStoreCreateWithConfigurationkeeps a shared reference to the caller's configuration instead of copying it (see non-blocking 1).Suggested fix: keep one entry, under the
### Functionalsection that fits, and rewrite it around these gaps, with a "Closes when" condition like the neighbouring entries.Non-blocking
core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp:28-32(link) stores the caller'sWebsiteDataStoreConfigurationwithRetained::Share. As far as I know, upstream WebKit's C API copies the configuration when it creates the store, so the store does not see the caller's later setter calls. Nothing readsWebsiteDataStore::configurationyet, so nothing observable depends on this today. Either copy the configuration, or record the difference in the debt entry. I could not check the upstream source here (no network), so treat this as something to confirm.core/libs/prx/libSceNKWebKit/Export.cpp:15566-15568(link), and the same happens at the two other removal sites. Remove the extra blank lines.include/WebKitConfigExports.hpp:102-105sit betweenWKWebsiteDataStoreConfigurationCopy*andWKWebsiteDataStoreConfigurationCreate. The rest of the header is alphabetical, so they belong after theWKWebsiteDataStoreConfiguration*block.Not verified
HTTPCookieStoreper store or whether the default store is persistent).WebsiteDataStore.cpp: the sandbox cannot reconfigure (see Negative control).nkwebkit_configpassing on Windows at the earlier head35004f4.To get this to a good state
WKWebsiteDataStoreCreateWithConfiguration(or record the difference), and clean up the blank lines and declaration order.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:24:21Z.
Review: COMMENTED
Reviewed — comments
The new accessors use retained objects and the included tests cover object types, identity, and null arguments, but the implementation explicitly leaves persistence, cookie behavior, configuration copying, and console ABI unverified.
What I ran
Reviewed head
b88caf5b3d60039fb7bec7aef9b0dc6db3738e39using the prepared diff andrepo_read.pyfor changed file contents and targeted context. No commands or tests were run; the reported conventions check is author-supplied.Results
Findings
Blocking
None.
Non-blocking
core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp:22:WKWebsiteDataStoreCreateNonPersistentDataStoreconstructs the same configuration-backed object as the default store, without modeling ephemeral persistence. The debt entry also records this limitation. Consider implementing ephemeral semantics when that behavior is in scope.core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp:30:WKWebsiteDataStoreCreateWithConfigurationshares the caller's mutable configuration. This means later caller mutations affect the store's retained configuration. The debt entry records this behavior; confirm it matches the intended API semantics or copy the configuration.Not verified
No tests, build, convention check, console module ABI, or physical-console behavior were run. Read the prepared description, commits, manifest, and diff, plus
WebsiteDataStore.cpp, relevant ranges ofConfiguration.hpp,Config.cpp, andForwarding.cpp. Changed files excluded from the review folder and not read from head:Export.cpp,InventoryExports.hpp, anddocs/dev/debt/libSceNKWebKit.md.files.jsonwas unavailable; the review folder listing identified these excluded files and reasons. Other source callers were searched, but not all search results were read.To get this to a good state
Nothing is required. Optional follow-up: model non-persistent storage and confirm configuration ownership semantics.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-26T09:19:05Z.
Review: COMMENTED
Reviewed — comments
The store wrappers and accessors are implemented with retained ownership, but the non-persistent constructor currently uses the same persistent default configuration as the regular store.
What I ran
Reviewed head
21cbccc184c069fa2e462a091e20b6fedb59a6ceusing the prepared diff and the pinnedrepo_read.pyreader. No commands or tests were run.Results
Findings
Blocking
None.
Non-blocking
WKWebsiteDataStoreCreateNonPersistentDataStorecreates a defaultWebsiteDataStoreConfiguration, whose storage paths point to persistent locations such as/app0/localand/app0/WebKitCache. The resulting store is therefore not distinguished as ephemeral in its configuration, despite the function name and description. Give it an explicit non-persistent mode or configuration and add an assertion that distinguishes it from the default store.core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp:22Not verified
core/libs/prx/libSceNKWebKit/Export.cppanddocs/dev/debt/libSceNKWebKit.mdwas excluded by the prepared bundle and not read.core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WebKitConfigExports.hpp,core/libs/prx/libSceNKWebKit/src/Configuration.hpp,core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp,core/libs/prx/libSceNKWebKit/tests/Config.cpp, andcore/libs/prx/libSceNKWebKit/tests/Forwarding.cpp.To get this to a good state
Nothing is required. Optional: make non-persistent stores observably ephemeral and cover that behavior in tests.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-29T01:37:38Z.
Review: COMMENTED
Reviewed — comments
Nothing blocks this; the points below are optional.
What I ran
Reviewed head
ab0162ed91a77fbee0a4c021f826943ed16ea392. Read the prepared diff and targeted source context throughrepo_read.py; no tests or builds were run.Results
Findings
Blocking
None.
Non-blocking
WKWebsiteDataStoreGetHTTPCookieStorereturns the cookie store's raw pointer without retaining it. If the caller releases its data store while keeping the cookie-store reference, that reference becomes dangling. Return a retained reference (or otherwise establish an owned reference) and add a test that releases the parent before using the cookie store. Seecore/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp:35.core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp:19.Not verified
Read:
core/libs/prx/libSceNKWebKit/include/InventoryExports.hpp,core/libs/prx/libSceNKWebKit/include/WebKitConfigExports.hpp,core/libs/prx/libSceNKWebKit/src/Configuration.hpp,core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp,core/libs/prx/libSceNKWebKit/src/Object.hpp,core/libs/prx/libSceNKWebKit/src/Object.cpp,core/libs/prx/libSceNKWebKit/src/ForwardExports.cpp,core/libs/prx/libSceNKWebKit/tests/Config.cpp,core/libs/prx/libSceNKWebKit/tests/Forwarding.cpp, andcore/libs/prx/libSceNKWebKit/CMakeLists.txt, plus the prepared description, commits, manifest, and diff.core/libs/prx/libSceNKWebKit/Export.cppwas excluded from the review folder because it was too large; the relevant region was inspected through the reader.review/files.jsonwas not available through the reader, so additional exclusions listed there could not be confirmed. Tests, build, and console ABI/behavior were not verified.To get this to a good state
Nothing is required. Optional: define and test the reference ownership contract for the default store and cookie-store accessor.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-11-29T01:39:38Z.
Review: COMMENTED
Actionable comments posted: 1
2658d4a9-d928-4ca3-ba96-54463414428aReviewing files that changed from the base of the PR and between
ffc6f26b07andab0162ed91.core/libs/prx/libSceNKWebKit/Export.cppcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppcore/libs/prx/libSceNKWebKit/include/WebKitConfigExports.hppcore/libs/prx/libSceNKWebKit/src/Configuration.hppcore/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cppcore/libs/prx/libSceNKWebKit/tests/Config.cppcore/libs/prx/libSceNKWebKit/tests/Forwarding.cppdocs/dev/debt/changes/nkwebkit-website-data-store.mdIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by coderabbitai[bot] on 2026-12-03T05:28:44Z.
Review: COMMENTED
Actionable comments
88172910-2c1e-40fe-8505-58775cb22a78Reviewing files that changed from the base of the PR and between
ab0162ed91and91a06f6455.core/libs/prx/libSceNKWebKit/Export.cppcore/libs/prx/libSceNKWebKit/include/InventoryExports.hppcore/libs/prx/libSceNKWebKit/src/Configuration.hppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-12-03T05:32:51Z.
Review: CHANGES_REQUESTED
Reviewed — changes requested
Changes are required before merge: the non-persistent store has no state that makes it ephemeral.
What I ran
Reviewed head
91a06f645560fd3ebc9280b1279cb5eefba43cfaagainst basemainusingrepo_read.py; no merged-preview check was run. I inspected the prepared diff and read relevant ranges from all changed repository files via the pinned reader. No tests or build checks were run.Results
Negative control
Not run; no tests were executed.
Findings
Blocking
core/libs/prx/libSceNKWebKit/src/WebsiteDataStore.cpp:22-24creates the non-persistent store with the same default configuration as the persistent default store, and theWebsiteDataStoremodel has no ephemeral or persistence state (core/libs/prx/libSceNKWebKit/src/Configuration.hpp:227-236). The change therefore provides a distinct object, but does not make its storage non-persistent as the API and PR description claim. Implement an ephemeral mode with isolated, non-persistent storage before exposing this as a non-persistent store. Pinned sourceNon-blocking
None.
Sources
Not verified
No tests, build, console execution, or ABI comparison were performed. The prepared manifest lists eight reviewed files and no excluded files; the diff was inspected for all changed files, and relevant source ranges were read with
repo_read.py. Large unchanged portions of those files were not read.To get this to a good state
WKWebsiteDataStoreCreateNonPersistentDataStore, then rerun the relevant tests on the new head.Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T13:16:25Z.
Review: COMMENTED
Checked the branch sources and built the focused tests against the existing Linux runtime.
ConfigandForwardingboth passed, including the website data store and cookie store cases.AI-assisted: yes.
Pull request closed