Consolidate PeerConnection network thread teardown
This patch introduces a new private method, `UninitializeNetworkThread`,
to deduplicate the logic responsible for destroying the transport
controller and port allocator on the network thread. Previously, this
teardown logic existed in both the `~PeerConnection` destructor and the
`PeerConnection::Close` method.
Refactoring this into a single method ensures consistent behavior for
thread safety checks, candidate pool discarding, and pointer resetting.
In addition, this change:
* Updates `DestroyDataChannelTransport` to return early if the data
channel is not configured, avoiding unnecessary context switching.
* Removes the rvalue reference qualifier from the `FakePortAllocator`
callback `on_candidate_pool_discarded_`, simplifying its invocation.
Bug: webrtc:360058654
Change-Id: Iac66c2469c8b2180b88d6fe583ce8fcd07d16ff5
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/427360
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#46274}
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.