feat(libSceNKWebKit): implement WebCore::AdClickAttribution #24503
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/24503"
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 ToRaNek on 2026-11-20T17:53:36Z.
What
Implements the eleven exported members of
WebCore::AdClickAttribution, which were throwing stubs:parseConversionRequest,convertAndGetEarliestTimeToSend,hasHigherPriorityThan,url,urlForTesting,referrer,markAsExpired,hasExpired,markConversionAsSent,wasConversionSent,toString.They follow AdClickAttribution.cpp on the 64-byte object of AdClickAttribution.h: campaign id at 0, source and destination registrable domains at 8 and 16, click time at 24,
Optional<Conversion>at 32 (flag, then data, priority and sent flag from 36),Optional<WallTime>at 48.Which WebKit. These exports are in the 3.20 inventory only (
LegacyExports.hpp). Two facts bound that module's WebKit:PrivateClickMeasurementon 2020-11-12, so it is older than that;BasicColorMatrixFilterOperation::transformColor(SRGBA<float>&), andSRGBA<float>reachedFilterOperation.hon 2020-06-13, so it is newer than that.The revision used here (2020-09-10) is inside that window. It matters for one function:
parseConversionRequestreturnedOptional<Conversion>until 2020-03-30 andExpected<Conversion, String>afterwards, under the same mangled name. The window settles it:Expected, 24 bytes, a union of the 12-byte conversion and the error string followed by the flag at 16, returned through a hidden pointer. The layout and the bodies of the other ten members are unchanged since 2019-05-01.Details worth a look:
parseConversionRequestreports every error with a null string. WebKit only builds a message when the Ad Click Attribution debug mode is on, a flag of theRuntimeEnabledFeaturessingleton, which is still a stub here and so cannot be turned on. The two number fields go through the same strict parse asStringView::toUInt64Strict(optional+, surrounding white space allowed); the character between them is not checked, as upstream.convertAndGetEarliestTimeToSendreturnsWTF::Optional<Seconds>, which has a user-provided copy constructor, through a hidden result pointer; the delay is24 h + randomNumber() * 24 hfrom libSceJsc'sWTF::randomNumber.url,referrerandurlForTestingbuild their string and hand it to this library'sWTF::URLparser;urlandreferrerreturn a nullURLwhen the object is not valid or the result does not parse, as upstream does.urlForTestingon an object with no conversion throwsstd::logic_error, where WebKit hits the release assertion ofOptional::value().toStringkeeps the result 8-bit unless a domain string is 16-bit, asStringBuilderdoes.Tested
Windows 11, MinGW GCC 15.2.
nkwebkit_adclickattribution(new) passes: 10 accepted and 24 rejected conversion URLs (range limits, field lengths, signs, scheme, credentials, query, fragment, port, prefix case), non-ASCII white space around a number, conversion acceptance by validity and priority, the 24 to 48 hour delay and the stored send time, the sent flag, priority comparison, expiry around the seven-day limit, the two attribution URLs with valid, out-of-range, empty,nullOrigin, unparsable and 16-bit domains,urlForTestingwith and without a base query and with 10-digit numbers, every branch oftoString, and null arguments.nullOriginas empty; a five-day maximum age; dropping the base URL's query; accepting an out-of-range priority; ignoring a query in the request URL; forgetting the port when locating the path; ignoring non-ASCII white space; comparing the scheme without its length.nkwebkit_*tests pass on the branch.python tools/check_conventions.py --base origin/mainandpython tools/debt_fold.py --checkpass.Not tested on a console.
Overlap (
python tools/pr_overlap.py --branch feat/nkwebkit-ad-click-attribution):Export.cppandLegacyExports.hpp, so whichever merges second has a trivial textual conflict there.main. I compared their diffs, and those of the six above, by hand: none touches anAdClickAttributionline.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)Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-20T19:25:13Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
c2786eddff:tools/check_conventions.pypassed.nkwebkit_adclickattribution_testsbuilt cleanly.nkwebkit_adclickattribution):core/libs/prx/libSceNKWebKit/Export.cpp,core/libs/prx/libSceNKWebKit/include/LegacyExports.hpp,core/libs/prx/libSceNKWebKit/libSceNKWebKit.hpp,core/libs/prx/libSceNKWebKit/src/AdClickAttribution.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T19:42:35Z.
Review: COMMENTED
Reviewed — no blocking findings
The inspected implementation and ABI declarations show no verified blocking defect; tests were not run independently, so a formal approval is not justified.
What I ran
Reviewed head
c2786eddff7589474411be1cafb431c1cc0e54cfusing the prepared diff and pinned reader. No test or build commands were run; no execution environment was available.Results
Negative control
Not run independently. The PR description reports ten negative controls that failed as expected.
Findings
Blocking
None verified in the inspected changes.
Non-blocking
Nothing blocks this; the points below are optional.
Sources
Reviewed the changed implementation, ABI declarations, tests, debt entry, and relevant diff hunks at the pinned head.
Not verified
No build, tests, negative controls, or console behavior were independently verified.
Export.cppwas excluded from the prepared full-text bundle; its changed hunks were inspected in the supplied diff, and a content search was used to inspect relevant references. Read:AdClickAttribution.cpp,AdClickAttributionExports.hpp,LegacyExports.hpp,libSceNKWebKit.hpp,tests/AdClickAttribution.cpp, anddocs/dev/debt/changes/feat-nkwebkit-ad-click-attribution.md; also inspected the relevantExport.cppdiff hunks. The excluded full text was not read.To get this to a good state
Nothing is required. Optional: provide CI or test output for the reported run.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-20T21:14:50Z.
Review: APPROVED
Reviewed — looks good
The implementation and its added tests look sound at the reviewed head; no blocking defect was verified.
What I ran
e2ea92d84ab4b16e5049094ea18323212f488639using the prepared diff and the pinned readerrepo_read.py.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
core/libs/prx/libSceNKWebKit/Export.cppfull text was excluded as too large; its relevant diff hunks were inspected.AdClickAttributionExports.hpp,LegacyExports.hpp,libSceNKWebKit.hpp,AdClickAttribution.cpp,tests/AdClickAttribution.cpp, anddocs/dev/debt/changes/feat-nkwebkit-ad-click-attribution.md.Export.cppwas excluded from full text.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-22T19:17:45Z.
Review: COMMENTED
Reviewed — no blocking findings
Nothing blocks this review; the points below are optional.
What I ran
Reviewed head
95679347d1cfe84727f41a5649b3cfed5875826b. No commands or tests were run in this review;repo_read.pywas used to inspect the prepared bundle and targeted source.Results
Findings
Blocking
None.
Non-blocking
Not verified
The full text of
Export.cppwas excluded from the review bundle; its changed lines are removals shown in the diff. The test file was read through line 250, and its remaining lines were inspected in the diff rather than the full file. No build, test, or console run was performed here.Files read:
description.md,commits.md,manifest.json,diff.patch,AdClickAttributionExports.hpp,AdClickAttribution.cpp,LegacyExports.hpp,libSceNKWebKit.hpp, andtests/AdClickAttribution.cpp(partial full text).Export.cppfull text was excluded as too large; no other changed file was excluded.To get this to a good state
Nothing is required. Optional: retain the reported test and negative-control results in CI so they can be checked on the reviewed head.