feat(libwebrtc): implement webrtc::PendingTaskSafetyFlag::Create #20025
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/20025"
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 Krille2004zzz on 2026-11-14T12:06:42Z.
What
Implements
webrtc::PendingTaskSafetyFlag::Create(_ZN6webrtc21PendingTaskSafetyFlag6CreateEv) in libwebrtc:Createreturnsrtc::scoped_refptr<PendingTaskSafetyFlag>. That type has a non-trivial destructor, so under the Itanium ABI it is returned through a hidden result pointer. The placeholderint(void)signature inApi.hppnow takes and returns that pointer.operator new(asCopyOnWriteBufferdoes), sets theRefCountedNonVirtualcount to 1 andalive_to true, and writes the pointer to the result. A null result throws.scoped_refptr/Release, so the allocation goes through the guest allocator.Follows public BSD-licensed WebRTC source at commit 8d78f5de6c27b2c793039989ea381f1428fb0100.
CreateisCreateInternal(true), which wrapsnew PendingTaskSafetyFlag(alive)in ascoped_refptr; itsAddReftakes the count from 0 to 1. The code is the same at M127 (branch-heads/6533).docs/dev/debt/libwebrtc.mdgets a new entry listing what is unverified: the 8-byte layout with an emptymain_sequence_(anNDEBUGbuild), and the hidden result pointer. The unimplemented export count drops from 222 to 221.Tested
Linux (Debian trixie, GCC 14.2), Release build with
BUILD_TESTING=ON, rebased on currentmain. Not tested on a console, a title or Windows.core/libs/prx/libwebrtc/tests/PendingTaskSafetyFlag.cppnow registers a tracking guest heap. It checks thatCreatereturns the result pointer, allocates exactly 8 bytes, and sets count 1 and alive. It checks that two flags are independent throughSetNotAlive/alive, that freeing both leaves no allocations, and that a null result throws.ctest -R '[Ww]eb[Rr]tc|[Nn]ack|[Ss]afety|public_headers|export_gap|conventions|progress_report|test_registration|debt': 253/253 passed.python3 tools/check_conventions.py --base origin/main: all checks passed.tools/pr_overlap.py --names _ZN6webrtc21PendingTaskSafetyFlag6CreateEv: stub on main, no open pull request.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 MarcZX10 on 2026-11-14T12:20:07Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the implementation matches the described hidden result pointer and guest allocation behavior, with no verified blocking defect.
What I ran
Inspected the prepared diff and changed file contents at head
4149533e069e765a47549022767ee4c6f80a2797, plus allocator and test-registration context throughrepo_read.py. I ran no build or tests; test results in the description are author-reported.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
No tests were run, and console or Windows behavior was not confirmed. The author reports a Linux Release build and 253 passing selected tests; I did not independently verify those results. All files listed as included in the manifest were read:
core/libs/prx/libwebrtc/CMakeLists.txt,core/libs/prx/libwebrtc/Export.cpp,core/libs/prx/libwebrtc/include/Api.hpp,core/libs/prx/libwebrtc/include/PendingTaskSafetyFlag.hpp,core/libs/prx/libwebrtc/src/PendingTaskSafetyFlag.cpp,core/libs/prx/libwebrtc/tests/PendingTaskSafetyFlag.cpp, anddocs/dev/debt/libwebrtc.md. No files were listed as excluded in the manifest. The optionalfiles.jsonlisting was not available through the reader, so any exclusions described only there are not verified.To get this to a good state
Nothing is required.
Imported from boykopovar/AnyPS5. Originally posted by PrivacyOnion on 2026-11-14T12:54:56Z.
Review: APPROVED
Verified on Linux (Ubuntu 24.04, GCC 13.3, Ninja, Release) against
4149533e06:tools/check_conventions.pypassed;git diff --checkclean.guest_webrtc_pending_task_safety_flag_testsbuilt cleanly.guest_webrtc_pending_task_safety_flag):core/libs/prx/libwebrtc/Export.cpp,core/libs/prx/libwebrtc/include/Api.hpp,core/libs/prx/libwebrtc/include/PendingTaskSafetyFlag.hpp,core/libs/prx/libwebrtc/src/PendingTaskSafetyFlag.cppreverted tomain, the new tests do not build/link without the change; restoring it makes them build and pass.Looks Good To Me