feat(libwebrtc): implement the rtc::RTCCertificate destructor #17704

Merged
LeandroLP23 merged 1 commit from upstream-pr/17704 into main 2026-11-13 10:17:53 +00:00
LeandroLP23 commented 2026-11-09 11:10:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-09T11:10:15Z.


What

Implements the rtc::RTCCertificate destructor in libwebrtc. Upstream defaults it in rtc_certificate.cc; the WebRTC notice and BSD licence head the file.

Same code at both bounding revisions. I compared M127 (e0b28a6a81) with M134 (8d78f5de6c):

  • rtc_certificate.h is byte-identical.
  • ref_counted_base.h differs only by an added include.
  • ssl_identity.h differs only outside SSLIdentity: the kRsaDefaultModSize value and a removed free function.

Layout. RTCCertificate is final with the non-polymorphic RefCountedNonVirtual base, so it has no vtable. The std::atomic<int> count is at 0 and const std::unique_ptr<SSLIdentity> identity_ at 8, 16 bytes in all.

Destruction. The identity is deleted through its virtual deleting destructor. That is slot 1, after the complete destructor, because ~SSLIdentity is the first virtual function of the base-less SSLIdentity. #17454 deletes AudioDecoder::ParseResult's frame the same way.

  • A certificate without an identity does nothing.
  • An identity without a vtable or that slot throws.
  • A null certificate throws.

No implemented export creates a certificate yet, so this destructor matters once one does. The debt entry says so.

Tested

Windows 11, MinGW GCC Release build. guest_webrtc_rtc_certificate is new and guest_webrtc_crypto_options still passes. The new test checks:

  • the identity is deleted through slot 1 and never through slot 0;
  • the count is left as it was;
  • no identity does nothing;
  • every invalid case throws.

As a negative control, using slot 0 fails the test.

tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py --branch merged all 22 overlapping pull requests cleanly. It could not compare #14212, #15189 and #17691, which already conflict with main; none touches RTCCertificate. The branch also merges cleanly with #17698 and #17703.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5222907665 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17704). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-11-09T11:10:15Z. --- ### What Implements the `rtc::RTCCertificate` destructor in libwebrtc. Upstream defaults it in [rtc_certificate.cc](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100/rtc_base/rtc_certificate.cc); the WebRTC notice and BSD licence head the file. **Same code at both bounding revisions.** I compared M127 ([e0b28a6a81](https://webrtc.googlesource.com/src/+/e0b28a6a81a989c1f5c89e30fcd247870047390d)) with M134 ([8d78f5de6c](https://webrtc.googlesource.com/src/+/8d78f5de6c27b2c793039989ea381f1428fb0100)): - `rtc_certificate.h` is byte-identical. - `ref_counted_base.h` differs only by an added include. - `ssl_identity.h` differs only outside `SSLIdentity`: the `kRsaDefaultModSize` value and a removed free function. **Layout.** `RTCCertificate` is `final` with the non-polymorphic `RefCountedNonVirtual` base, so it has no vtable. The `std::atomic<int>` count is at 0 and `const std::unique_ptr<SSLIdentity> identity_` at 8, 16 bytes in all. **Destruction.** The identity is deleted through its virtual deleting destructor. That is slot 1, after the complete destructor, because `~SSLIdentity` is the first virtual function of the base-less `SSLIdentity`. #17454 deletes `AudioDecoder::ParseResult`'s frame the same way. - A certificate without an identity does nothing. - An identity without a vtable or that slot throws. - A null certificate throws. No implemented export creates a certificate yet, so this destructor matters once one does. The debt entry says so. ### Tested Windows 11, MinGW GCC Release build. `guest_webrtc_rtc_certificate` is new and `guest_webrtc_crypto_options` still passes. The new test checks: - the identity is deleted through slot 1 and never through slot 0; - the count is left as it was; - no identity does nothing; - every invalid case throws. As a negative control, using slot 0 fails the test. `tools/check_conventions.py --base origin/main` passes. `tools/pr_overlap.py --branch` merged all 22 overlapping pull requests cleanly. It could not compare #14212, #15189 and #17691, which already conflict with `main`; none touches `RTCCertificate`. The branch also merges cleanly with #17698 and #17703. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!17704
No description provided.