webrtc_m130/pc/data_channel_controller.h

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

170 lines
6.9 KiB
C
Raw Normal View History

/*
* Copyright 2019 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#ifndef PC_DATA_CHANNEL_CONTROLLER_H_
#define PC_DATA_CHANNEL_CONTROLLER_H_
#include <string>
#include <vector>
#include "api/data_channel_interface.h"
#include "api/rtc_error.h"
#include "api/scoped_refptr.h"
#include "api/sequence_checker.h"
#include "api/task_queue/pending_task_safety_flag.h"
#include "api/transport/data_channel_transport_interface.h"
#include "pc/data_channel_utils.h"
#include "pc/sctp_data_channel.h"
#include "rtc_base/checks.h"
#include "rtc_base/copy_on_write_buffer.h"
#include "rtc_base/ssl_stream_adapter.h"
#include "rtc_base/thread.h"
#include "rtc_base/thread_annotations.h"
#include "rtc_base/weak_ptr.h"
namespace webrtc {
class PeerConnectionInternal;
class DataChannelController : public SctpDataChannelControllerInterface,
public DataChannelSink {
public:
explicit DataChannelController(PeerConnectionInternal* pc) : pc_(pc) {}
~DataChannelController();
// Not copyable or movable.
DataChannelController(DataChannelController&) = delete;
DataChannelController& operator=(const DataChannelController& other) = delete;
DataChannelController(DataChannelController&&) = delete;
DataChannelController& operator=(DataChannelController&& other) = delete;
// Implements
// SctpDataChannelProviderInterface.
RTCError SendData(StreamId sid,
const SendDataParams& params,
const rtc::CopyOnWriteBuffer& payload) override;
void AddSctpDataStream(StreamId sid) override;
void RemoveSctpDataStream(StreamId sid) override;
void OnChannelStateChanged(SctpDataChannel* channel,
DataChannelInterface::DataState state) override;
size_t buffered_amount(StreamId sid) const override;
size_t buffered_amount_low_threshold(StreamId sid) const override;
void SetBufferedAmountLowThreshold(StreamId sid, size_t bytes) override;
// Implements DataChannelSink.
void OnDataReceived(int channel_id,
DataMessageType type,
const rtc::CopyOnWriteBuffer& buffer) override;
void OnChannelClosing(int channel_id) override;
void OnChannelClosed(int channel_id) override;
void OnReadyToSend() override;
void OnTransportClosed(RTCError error) override;
void OnBufferedAmountLow(int channel_id) override;
// Called as part of destroying the owning PeerConnection.
void PrepareForShutdown();
// Called from PeerConnection::SetupDataChannelTransport_n
Reland "Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code." This reverts commit 298313534df2420e079ffc6fc9c6019d01d29a88. Changes from the original commit: * Call OnTransportClosed() from TeardownDataChannelTransport_n() (same as before the original commit) * Not call OnTransportClosed() from OnTransportChanged() when its called with nullptr (also preserving the behaviour from before the original commit). Original change's description: > Revert "Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code." > > This reverts commit 2ec6a6c57830e06f601607c1b9473ad821b57e07. > > Reason for revert: It breaks WPT tests (e.g. https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1361972/overview) blocking the roll into Chromium. > > Original change's description: > > Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code. > > > > * DCC = DataChannelController. > > > > * Consolidate steps to set the mid and transport name. They're now > > set at the same time and without a separate PostTask. > > * Transport sink is now consistently set in DCC > > * Order of notifications for setting up the transport is now the same > > regardless of the first time the transport is being set or if it's > > being replaced. > > * Made set_data_channel_transport() private. > > > > Bug: webrtc:11547 > > Change-Id: I39e89c6e269e6f06d55981d7944678bf23c8817a > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300562 > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#39859} > > Bug: webrtc:11547 > Change-Id: I0d8d7453b71be80fbf1b7eba7d161336e29de091 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301360 > Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org> > Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#39864} Bug: webrtc:11547 Change-Id: I8ebbc3d3a12786dff2096350a77e03e98466ff00 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301702 Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39884}
2023-04-18 12:19:19 +02:00
void SetupDataChannelTransport_n(DataChannelTransportInterface* transport);
// Called from PeerConnection::TeardownDataChannelTransport_n
void TeardownDataChannelTransport_n(RTCError error);
// Called from PeerConnection::OnTransportChanged
// to make required changes to datachannels' transports.
void OnTransportChanged(
DataChannelTransportInterface* data_channel_transport);
// Called from PeerConnection::GetDataChannelStats on the signaling thread.
std::vector<DataChannelStats> GetDataChannelStats() const;
// Creates channel and adds it to the collection of DataChannels that will
// be offered in a SessionDescription, and wraps it in a proxy object.
RTCErrorOr<rtc::scoped_refptr<DataChannelInterface>>
InternalCreateDataChannelWithProxy(const std::string& label,
const InternalDataChannelInit& config);
void AllocateSctpSids(rtc::SSLRole role);
// Check if data channels are currently tracked. Used to decide whether a
// rejected m=application section should be reoffered.
bool HasDataChannels() const;
// At some point in time, a data channel has existed.
bool HasUsedDataChannels() const;
protected:
rtc::Thread* network_thread() const;
rtc::Thread* signaling_thread() const;
private:
void OnSctpDataChannelClosed(SctpDataChannel* channel);
Reland "[DataChannel] Send and receive packets on the network thread." This reverts commit 7f16fcda0fd5bb625584b71311dd37b54c096136. Reason for reland: Re-landing after addressing issues in downstream code and hardening the ObserverAdapter from situations where attempted usage of data channel proxies could occur after shutting down the peer connection and terminating the network thread. Original change's description: > Revert "[DataChannel] Send and receive packets on the network thread." > > This reverts commit fe53fec24e02d2d644220f913c3f9ae596bbb2d9. > > Reason for revert: Speculative revert, may be breaking downstream project > > Original change's description: > > [DataChannel] Send and receive packets on the network thread. > > > > This updates sctp channels, including work that happens between the > > data channel controller and the transport, to run on the network > > thread. Previously all network traffic related to data channels was > > routed through the signaling thread before going to either the network > > thread or the caller's thread (e.g. js thread in chrome). Now the > > calls can go straight from the network thread to the JS thread with > > enabling a special flag on the observer (see below) and similarly > > calls to send data, involve 2 threads instead of 3. > > > > * Custom data channel observer adapter implementation that > > maintains compatibility with existing observer implementations in > > that notifications are delivered on the signaling thread. > > The adapter can be explicitly disabled for implementations that > > want to optimize the callback path and promise to not block the > > network thread. > > * Remove the signaling thread copy of data channels in the controller. > > * Remove several PostTask operations that were needed to keep things > > in sync (but the need has gone away). > > * Update tests for the controller to consistently call > > TeardownDataChannelTransport_n to match with production. > > * Update stats collectors (current and legacy) to fetch the data > > channel stats on the network thread where they're maintained. > > * Remove the AsyncChannelCloseTeardown test since the async teardown > > step has gone away. > > * Remove `sid_s` in the channel code since we only need the network > > state now. > > * For the custom observer support (with and without data adapter) and > > maintain compatibility with existing implementations, added a new > > proxy macro that allows an implementation to selectively provide > > its own implementation without being proxied. This is used for > > registering/unregistering a data channel observer. > > * Update the data channel proxy to map most methods to the network > > thread, avoiding the interim jump to the signaling thread. > > * Update a plethora of thread checkers from signaling to network. > > > > Bug: webrtc:11547 > > Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142 > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#39760} > > Bug: webrtc:11547 > Change-Id: Id0d65594bf727ccea5c49093c942b09714d101ad > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300341 > Auto-Submit: Andrey Logvin <landrey@webrtc.org> > Owners-Override: Andrey Logvin <landrey@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#39764} Bug: webrtc:11547 Change-Id: I47dfa7e7168be0cd2faab4f8f3ebf110c3728af5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300360 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39786}
2023-04-06 21:21:45 +02:00
// Creates a new SctpDataChannel object on the network thread.
RTCErrorOr<rtc::scoped_refptr<SctpDataChannel>> CreateDataChannel(
const std::string& label,
InternalDataChannelInit& config) RTC_RUN_ON(network_thread());
// Parses and handles open messages. Returns true if the message is an open
// message and should be considered to be handled, false otherwise.
bool HandleOpenMessage_n(int channel_id,
DataMessageType type,
const rtc::CopyOnWriteBuffer& buffer)
RTC_RUN_ON(network_thread());
// Called when a valid data channel OPEN message is received.
Reland "[DataChannel] Send and receive packets on the network thread." This reverts commit 7f16fcda0fd5bb625584b71311dd37b54c096136. Reason for reland: Re-landing after addressing issues in downstream code and hardening the ObserverAdapter from situations where attempted usage of data channel proxies could occur after shutting down the peer connection and terminating the network thread. Original change's description: > Revert "[DataChannel] Send and receive packets on the network thread." > > This reverts commit fe53fec24e02d2d644220f913c3f9ae596bbb2d9. > > Reason for revert: Speculative revert, may be breaking downstream project > > Original change's description: > > [DataChannel] Send and receive packets on the network thread. > > > > This updates sctp channels, including work that happens between the > > data channel controller and the transport, to run on the network > > thread. Previously all network traffic related to data channels was > > routed through the signaling thread before going to either the network > > thread or the caller's thread (e.g. js thread in chrome). Now the > > calls can go straight from the network thread to the JS thread with > > enabling a special flag on the observer (see below) and similarly > > calls to send data, involve 2 threads instead of 3. > > > > * Custom data channel observer adapter implementation that > > maintains compatibility with existing observer implementations in > > that notifications are delivered on the signaling thread. > > The adapter can be explicitly disabled for implementations that > > want to optimize the callback path and promise to not block the > > network thread. > > * Remove the signaling thread copy of data channels in the controller. > > * Remove several PostTask operations that were needed to keep things > > in sync (but the need has gone away). > > * Update tests for the controller to consistently call > > TeardownDataChannelTransport_n to match with production. > > * Update stats collectors (current and legacy) to fetch the data > > channel stats on the network thread where they're maintained. > > * Remove the AsyncChannelCloseTeardown test since the async teardown > > step has gone away. > > * Remove `sid_s` in the channel code since we only need the network > > state now. > > * For the custom observer support (with and without data adapter) and > > maintain compatibility with existing implementations, added a new > > proxy macro that allows an implementation to selectively provide > > its own implementation without being proxied. This is used for > > registering/unregistering a data channel observer. > > * Update the data channel proxy to map most methods to the network > > thread, avoiding the interim jump to the signaling thread. > > * Update a plethora of thread checkers from signaling to network. > > > > Bug: webrtc:11547 > > Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142 > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#39760} > > Bug: webrtc:11547 > Change-Id: Id0d65594bf727ccea5c49093c942b09714d101ad > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300341 > Auto-Submit: Andrey Logvin <landrey@webrtc.org> > Owners-Override: Andrey Logvin <landrey@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#39764} Bug: webrtc:11547 Change-Id: I47dfa7e7168be0cd2faab4f8f3ebf110c3728af5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300360 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39786}
2023-04-06 21:21:45 +02:00
void OnDataChannelOpenMessage(rtc::scoped_refptr<SctpDataChannel> channel,
bool ready_to_send)
RTC_RUN_ON(signaling_thread());
// Accepts a `StreamId` which may be pre-negotiated or unassigned. For
// pre-negotiated sids, attempts to reserve the sid in the allocation pool,
// for unassigned sids attempts to generate a new sid if possible. Returns
// RTCError::OK() if the sid is reserved (and may have been generated) or
// if not enough information exists to generate a sid, in which case the sid
// will still be unassigned upon return, but will be assigned later.
// If the pool has been exhausted or a sid has already been reserved, an
// error will be returned.
RTCError ReserveOrAllocateSid(absl::optional<StreamId>& sid,
absl::optional<rtc::SSLRole> fallback_ssl_role)
RTC_RUN_ON(network_thread());
// Called when all data channels need to be notified of a transport channel
// (calls OnTransportChannelCreated on the signaling thread).
void NotifyDataChannelsOfTransportCreated();
Reland "Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code." This reverts commit 298313534df2420e079ffc6fc9c6019d01d29a88. Changes from the original commit: * Call OnTransportClosed() from TeardownDataChannelTransport_n() (same as before the original commit) * Not call OnTransportClosed() from OnTransportChanged() when its called with nullptr (also preserving the behaviour from before the original commit). Original change's description: > Revert "Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code." > > This reverts commit 2ec6a6c57830e06f601607c1b9473ad821b57e07. > > Reason for revert: It breaks WPT tests (e.g. https://ci.chromium.org/ui/p/chromium/builders/try/linux-rel/1361972/overview) blocking the roll into Chromium. > > Original change's description: > > Add param to DCC::SetupDataChannelTransport_n, simplify DCC* setup code. > > > > * DCC = DataChannelController. > > > > * Consolidate steps to set the mid and transport name. They're now > > set at the same time and without a separate PostTask. > > * Transport sink is now consistently set in DCC > > * Order of notifications for setting up the transport is now the same > > regardless of the first time the transport is being set or if it's > > being replaced. > > * Made set_data_channel_transport() private. > > > > Bug: webrtc:11547 > > Change-Id: I39e89c6e269e6f06d55981d7944678bf23c8817a > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300562 > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > Reviewed-by: Danil Chapovalov <danilchap@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#39859} > > Bug: webrtc:11547 > Change-Id: I0d8d7453b71be80fbf1b7eba7d161336e29de091 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301360 > Auto-Submit: Mirko Bonadei <mbonadei@webrtc.org> > Owners-Override: Mirko Bonadei <mbonadei@webrtc.org> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Cr-Commit-Position: refs/heads/main@{#39864} Bug: webrtc:11547 Change-Id: I8ebbc3d3a12786dff2096350a77e03e98466ff00 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/301702 Reviewed-by: Henrik Boström <hbos@webrtc.org> Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39884}
2023-04-18 12:19:19 +02:00
void set_data_channel_transport(DataChannelTransportInterface* transport);
// Plugin transport used for data channels. Pointer may be accessed and
// checked from any thread, but the object may only be touched on the
// network thread.
DataChannelTransportInterface* data_channel_transport_
RTC_GUARDED_BY(network_thread()) = nullptr;
SctpSidAllocator sid_allocator_ RTC_GUARDED_BY(network_thread());
std::vector<rtc::scoped_refptr<SctpDataChannel>> sctp_data_channels_n_
RTC_GUARDED_BY(network_thread());
enum class DataChannelUsage : uint8_t {
kNeverUsed = 0,
kHaveBeenUsed,
kInUse
};
DataChannelUsage channel_usage_ RTC_GUARDED_BY(signaling_thread()) =
DataChannelUsage::kNeverUsed;
// Owning PeerConnection.
PeerConnectionInternal* const pc_;
Reland "[DataChannel] Send and receive packets on the network thread." This reverts commit 7f16fcda0fd5bb625584b71311dd37b54c096136. Reason for reland: Re-landing after addressing issues in downstream code and hardening the ObserverAdapter from situations where attempted usage of data channel proxies could occur after shutting down the peer connection and terminating the network thread. Original change's description: > Revert "[DataChannel] Send and receive packets on the network thread." > > This reverts commit fe53fec24e02d2d644220f913c3f9ae596bbb2d9. > > Reason for revert: Speculative revert, may be breaking downstream project > > Original change's description: > > [DataChannel] Send and receive packets on the network thread. > > > > This updates sctp channels, including work that happens between the > > data channel controller and the transport, to run on the network > > thread. Previously all network traffic related to data channels was > > routed through the signaling thread before going to either the network > > thread or the caller's thread (e.g. js thread in chrome). Now the > > calls can go straight from the network thread to the JS thread with > > enabling a special flag on the observer (see below) and similarly > > calls to send data, involve 2 threads instead of 3. > > > > * Custom data channel observer adapter implementation that > > maintains compatibility with existing observer implementations in > > that notifications are delivered on the signaling thread. > > The adapter can be explicitly disabled for implementations that > > want to optimize the callback path and promise to not block the > > network thread. > > * Remove the signaling thread copy of data channels in the controller. > > * Remove several PostTask operations that were needed to keep things > > in sync (but the need has gone away). > > * Update tests for the controller to consistently call > > TeardownDataChannelTransport_n to match with production. > > * Update stats collectors (current and legacy) to fetch the data > > channel stats on the network thread where they're maintained. > > * Remove the AsyncChannelCloseTeardown test since the async teardown > > step has gone away. > > * Remove `sid_s` in the channel code since we only need the network > > state now. > > * For the custom observer support (with and without data adapter) and > > maintain compatibility with existing implementations, added a new > > proxy macro that allows an implementation to selectively provide > > its own implementation without being proxied. This is used for > > registering/unregistering a data channel observer. > > * Update the data channel proxy to map most methods to the network > > thread, avoiding the interim jump to the signaling thread. > > * Update a plethora of thread checkers from signaling to network. > > > > Bug: webrtc:11547 > > Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142 > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#39760} > > Bug: webrtc:11547 > Change-Id: Id0d65594bf727ccea5c49093c942b09714d101ad > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300341 > Auto-Submit: Andrey Logvin <landrey@webrtc.org> > Owners-Override: Andrey Logvin <landrey@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#39764} Bug: webrtc:11547 Change-Id: I47dfa7e7168be0cd2faab4f8f3ebf110c3728af5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300360 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39786}
2023-04-06 21:21:45 +02:00
// The weak pointers must be dereferenced and invalidated on the network
// thread only.
Reland "[DataChannel] Send and receive packets on the network thread." This reverts commit 7f16fcda0fd5bb625584b71311dd37b54c096136. Reason for reland: Re-landing after addressing issues in downstream code and hardening the ObserverAdapter from situations where attempted usage of data channel proxies could occur after shutting down the peer connection and terminating the network thread. Original change's description: > Revert "[DataChannel] Send and receive packets on the network thread." > > This reverts commit fe53fec24e02d2d644220f913c3f9ae596bbb2d9. > > Reason for revert: Speculative revert, may be breaking downstream project > > Original change's description: > > [DataChannel] Send and receive packets on the network thread. > > > > This updates sctp channels, including work that happens between the > > data channel controller and the transport, to run on the network > > thread. Previously all network traffic related to data channels was > > routed through the signaling thread before going to either the network > > thread or the caller's thread (e.g. js thread in chrome). Now the > > calls can go straight from the network thread to the JS thread with > > enabling a special flag on the observer (see below) and similarly > > calls to send data, involve 2 threads instead of 3. > > > > * Custom data channel observer adapter implementation that > > maintains compatibility with existing observer implementations in > > that notifications are delivered on the signaling thread. > > The adapter can be explicitly disabled for implementations that > > want to optimize the callback path and promise to not block the > > network thread. > > * Remove the signaling thread copy of data channels in the controller. > > * Remove several PostTask operations that were needed to keep things > > in sync (but the need has gone away). > > * Update tests for the controller to consistently call > > TeardownDataChannelTransport_n to match with production. > > * Update stats collectors (current and legacy) to fetch the data > > channel stats on the network thread where they're maintained. > > * Remove the AsyncChannelCloseTeardown test since the async teardown > > step has gone away. > > * Remove `sid_s` in the channel code since we only need the network > > state now. > > * For the custom observer support (with and without data adapter) and > > maintain compatibility with existing implementations, added a new > > proxy macro that allows an implementation to selectively provide > > its own implementation without being proxied. This is used for > > registering/unregistering a data channel observer. > > * Update the data channel proxy to map most methods to the network > > thread, avoiding the interim jump to the signaling thread. > > * Update a plethora of thread checkers from signaling to network. > > > > Bug: webrtc:11547 > > Change-Id: Ib4cff1482e31c46008e187189a79e967389bc518 > > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/299142 > > Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> > > Reviewed-by: Henrik Boström <hbos@webrtc.org> > > Cr-Commit-Position: refs/heads/main@{#39760} > > Bug: webrtc:11547 > Change-Id: Id0d65594bf727ccea5c49093c942b09714d101ad > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300341 > Auto-Submit: Andrey Logvin <landrey@webrtc.org> > Owners-Override: Andrey Logvin <landrey@webrtc.org> > Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#39764} Bug: webrtc:11547 Change-Id: I47dfa7e7168be0cd2faab4f8f3ebf110c3728af5 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/300360 Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org> Reviewed-by: Henrik Boström <hbos@webrtc.org> Cr-Commit-Position: refs/heads/main@{#39786}
2023-04-06 21:21:45 +02:00
rtc::WeakPtrFactory<DataChannelController> weak_factory_
RTC_GUARDED_BY(network_thread()){this};
ScopedTaskSafety signaling_safety_;
};
} // namespace webrtc
#endif // PC_DATA_CHANNEL_CONTROLLER_H_