| commit | ca640fbffdb141aaa3bb89d89babc574be4476bf | [log] [tgz] |
|---|---|---|
| author | Tommi <tommi@webrtc.org> | Tue Dec 23 16:36:19 2025 |
| committer | WebRTC LUCI CQ <webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Dec 23 20:13:42 2025 |
| tree | 1bfe2b12ee31be0ccbe300642fe3909589937d8d | |
| parent | f37609610b40f115922b552fc521a5e75f735ace [diff] |
Add async cancellation support to RTCStatsCollector This reduces blocking call operations in the PC destructor down to a consistent 2 and removes the synchronous Wait() operation in RTCStatsCollector from that path (it's still in Close()). The implementation uses PendingTaskSafetyFlag and SafeTask to invalidate pending tasks across the signaling and network threads. When CancelPendingRequest is called or the collector is destroyed, in-flight tasks are safely dropped rather than being synchronously waited upon. Key modifications: - Integrate ScopedTaskSafety within RTCStatsCollector for signaling thread task management. - Require a network thread safety flag during RTCStatsCollector initialization to ensure safe cross-thread operations. - Replace WaitForPendingRequest with CancelPendingRequest in the PeerConnection destructor. - Wrap cross-thread PostTask calls in SafeTask to prevent callbacks from executing after the collector has been cancelled or destroyed. Bug: webrtc:42222804 Change-Id: I48f30e839d1d9b4d58ad829e3e9d29962d742a7b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/435440 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#46536}
WebRTC is a free, open software project that provides browsers and mobile applications with Real-Time Communications (RTC) capabilities via simple APIs. The WebRTC components have been optimized to best serve this purpose.
Our mission: To enable rich, high-quality RTC applications to be developed for the browser, mobile platforms, and IoT devices, and allow them all to communicate via a common set of protocols.
The WebRTC initiative is a project supported by Google, Mozilla and Opera, amongst others.
See here for instructions on how to get started developing with the native code.
Authoritative list of directories that contain the native API header files.