Use backticks not vertical bars to denote variables in comments for /pc

Bug: webrtc:12338
Change-Id: I88cf10afa5fc810b95d2a585ab2e895dcc163b63
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/226953
Reviewed-by: Harald Alvestrand <hta@webrtc.org>
Commit-Queue: Artem Titov <titovartem@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#34575}
This commit is contained in:
Artem Titov 2021-07-26 15:29:11 +02:00 committed by WebRTC LUCI CQ
parent 75ac5ab859
commit 37ee0f5e59
81 changed files with 535 additions and 535 deletions

View file

@ -144,7 +144,7 @@ class AudioRtpReceiver : public ObserverInterface,
rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_ rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_
RTC_GUARDED_BY(&signaling_thread_checker_); RTC_GUARDED_BY(&signaling_thread_checker_);
// Stores and updates the playout delay. Handles caching cases if // Stores and updates the playout delay. Handles caching cases if
// |SetJitterBufferMinimumDelay| is called before start. // `SetJitterBufferMinimumDelay` is called before start.
JitterBufferDelay delay_ RTC_GUARDED_BY(worker_thread_); JitterBufferDelay delay_ RTC_GUARDED_BY(worker_thread_);
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_ rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_
RTC_GUARDED_BY(worker_thread_); RTC_GUARDED_BY(worker_thread_);

View file

@ -610,13 +610,13 @@ bool BaseChannel::UpdateLocalStreams_w(const std::vector<StreamParams>& streams,
std::string* error_desc) { std::string* error_desc) {
// In the case of RIDs (where SSRCs are not negotiated), this method will // In the case of RIDs (where SSRCs are not negotiated), this method will
// generate an SSRC for each layer in StreamParams. That representation will // generate an SSRC for each layer in StreamParams. That representation will
// be stored internally in |local_streams_|. // be stored internally in `local_streams_`.
// In subsequent offers, the same stream can appear in |streams| again // In subsequent offers, the same stream can appear in `streams` again
// (without the SSRCs), so it should be looked up using RIDs (if available) // (without the SSRCs), so it should be looked up using RIDs (if available)
// and then by primary SSRC. // and then by primary SSRC.
// In both scenarios, it is safe to assume that the media channel will be // In both scenarios, it is safe to assume that the media channel will be
// created with a StreamParams object with SSRCs. However, it is not safe to // created with a StreamParams object with SSRCs. However, it is not safe to
// assume that |local_streams_| will always have SSRCs as there are scenarios // assume that `local_streams_` will always have SSRCs as there are scenarios
// in which niether SSRCs or RIDs are negotiated. // in which niether SSRCs or RIDs are negotiated.
// Check for streams that have been removed. // Check for streams that have been removed.

View file

@ -99,7 +99,7 @@ class BaseChannel : public ChannelInterface,
public MediaChannel::NetworkInterface, public MediaChannel::NetworkInterface,
public webrtc::RtpPacketSinkInterface { public webrtc::RtpPacketSinkInterface {
public: public:
// If |srtp_required| is true, the channel will not send or receive any // If `srtp_required` is true, the channel will not send or receive any
// RTP/RTCP packets without using SRTP (either using SDES or DTLS-SRTP). // RTP/RTCP packets without using SRTP (either using SDES or DTLS-SRTP).
// The BaseChannel does not own the UniqueRandomIdGenerator so it is the // The BaseChannel does not own the UniqueRandomIdGenerator so it is the
// responsibility of the user to ensure it outlives this object. // responsibility of the user to ensure it outlives this object.
@ -141,7 +141,7 @@ class BaseChannel : public ChannelInterface,
// Set an RTP level transport which could be an RtpTransport without // Set an RTP level transport which could be an RtpTransport without
// encryption, an SrtpTransport for SDES or a DtlsSrtpTransport for DTLS-SRTP. // encryption, an SrtpTransport for SDES or a DtlsSrtpTransport for DTLS-SRTP.
// This can be called from any thread and it hops to the network thread // This can be called from any thread and it hops to the network thread
// internally. It would replace the |SetTransports| and its variants. // internally. It would replace the `SetTransports` and its variants.
bool SetRtpTransport(webrtc::RtpTransportInternal* rtp_transport) override; bool SetRtpTransport(webrtc::RtpTransportInternal* rtp_transport) override;
webrtc::RtpTransportInternal* rtp_transport() const { webrtc::RtpTransportInternal* rtp_transport() const {
@ -279,7 +279,7 @@ class BaseChannel : public ChannelInterface,
RtpHeaderExtensions GetDeduplicatedRtpHeaderExtensions( RtpHeaderExtensions GetDeduplicatedRtpHeaderExtensions(
const RtpHeaderExtensions& extensions); const RtpHeaderExtensions& extensions);
// Add |payload_type| to |demuxer_criteria_| if payload type demuxing is // Add `payload_type` to `demuxer_criteria_` if payload type demuxing is
// enabled. // enabled.
void MaybeAddHandledPayloadType(int payload_type) RTC_RUN_ON(worker_thread()); void MaybeAddHandledPayloadType(int payload_type) RTC_RUN_ON(worker_thread());
@ -350,7 +350,7 @@ class BaseChannel : public ChannelInterface,
// MediaChannel related members that should be accessed from the worker // MediaChannel related members that should be accessed from the worker
// thread. // thread.
const std::unique_ptr<MediaChannel> media_channel_; const std::unique_ptr<MediaChannel> media_channel_;
// Currently the |enabled_| flag is accessed from the signaling thread as // Currently the `enabled_` flag is accessed from the signaling thread as
// well, but it can be changed only when signaling thread does a synchronous // well, but it can be changed only when signaling thread does a synchronous
// call to the worker thread, so it should be safe. // call to the worker thread, so it should be safe.
bool enabled_ RTC_GUARDED_BY(worker_thread()) = false; bool enabled_ RTC_GUARDED_BY(worker_thread()) = false;

View file

@ -513,7 +513,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
} }
// Utility method that calls BaseChannel::srtp_active() on the network thread // Utility method that calls BaseChannel::srtp_active() on the network thread
// and returns the result. The |srtp_active()| state is maintained on the // and returns the result. The `srtp_active()` state is maintained on the
// network thread, which callers need to factor in. // network thread, which callers need to factor in.
bool IsSrtpActive(std::unique_ptr<typename T::Channel>& channel) { bool IsSrtpActive(std::unique_ptr<typename T::Channel>& channel) {
RTC_DCHECK(channel.get()); RTC_DCHECK(channel.get());
@ -637,7 +637,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
stream2.ssrcs.push_back(kSsrc2); stream2.ssrcs.push_back(kSsrc2);
stream2.cname = "stream2_cname"; stream2.cname = "stream2_cname";
// Setup a call where channel 1 send |stream1| to channel 2. // Setup a call where channel 1 send `stream1` to channel 2.
CreateChannels(0, 0); CreateChannels(0, 0);
typename T::Content content1; typename T::Content content1;
CreateContent(0, kPcmuCodec, kH264Codec, &content1); CreateContent(0, kPcmuCodec, kH264Codec, &content1);
@ -663,7 +663,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
WaitForThreads(); WaitForThreads();
EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0)); EXPECT_TRUE(CheckCustomRtp2(kSsrc1, 0));
// Let channel 2 update the content by sending |stream2| and enable SRTP. // Let channel 2 update the content by sending `stream2` and enable SRTP.
typename T::Content content3; typename T::Content content3;
CreateContent(0, kPcmuCodec, kH264Codec, &content3); CreateContent(0, kPcmuCodec, kH264Codec, &content3);
content3.AddStream(stream2); content3.AddStream(stream2);
@ -755,7 +755,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
CreateContent(0, kPcmuCodec, kH264Codec, &content1); CreateContent(0, kPcmuCodec, kH264Codec, &content1);
typename T::Content content2; typename T::Content content2;
CreateContent(0, kPcmuCodec, kH264Codec, &content2); CreateContent(0, kPcmuCodec, kH264Codec, &content2);
// Set |content2| to be InActive. // Set `content2` to be InActive.
content2.set_direction(RtpTransceiverDirection::kInactive); content2.set_direction(RtpTransceiverDirection::kInactive);
channel1_->Enable(true); channel1_->Enable(true);
@ -787,7 +787,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
} }
EXPECT_FALSE(media_channel2()->sending()); // local InActive EXPECT_FALSE(media_channel2()->sending()); // local InActive
// Update |content2| to be RecvOnly. // Update `content2` to be RecvOnly.
content2.set_direction(RtpTransceiverDirection::kRecvOnly); content2.set_direction(RtpTransceiverDirection::kRecvOnly);
EXPECT_TRUE( EXPECT_TRUE(
channel2_->SetLocalContent(&content2, SdpType::kPrAnswer, NULL)); channel2_->SetLocalContent(&content2, SdpType::kPrAnswer, NULL));
@ -803,7 +803,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
} }
EXPECT_FALSE(media_channel2()->sending()); // local RecvOnly EXPECT_FALSE(media_channel2()->sending()); // local RecvOnly
// Update |content2| to be SendRecv. // Update `content2` to be SendRecv.
content2.set_direction(RtpTransceiverDirection::kSendRecv); content2.set_direction(RtpTransceiverDirection::kSendRecv);
EXPECT_TRUE(channel2_->SetLocalContent(&content2, SdpType::kAnswer, NULL)); EXPECT_TRUE(channel2_->SetLocalContent(&content2, SdpType::kAnswer, NULL));
EXPECT_TRUE(channel1_->SetRemoteContent(&content2, SdpType::kAnswer, NULL)); EXPECT_TRUE(channel1_->SetRemoteContent(&content2, SdpType::kAnswer, NULL));
@ -836,7 +836,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
ASSERT_TRUE(media_channel1); ASSERT_TRUE(media_channel1);
// Need to wait for the threads before calling // Need to wait for the threads before calling
// |set_num_network_route_changes| because the network route would be set // `set_num_network_route_changes` because the network route would be set
// when creating the channel. // when creating the channel.
WaitForThreads(); WaitForThreads();
media_channel1->set_num_network_route_changes(0); media_channel1->set_num_network_route_changes(0);
@ -1067,8 +1067,8 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
bool secure) { bool secure) {
ASSERT_EQ(2, len); ASSERT_EQ(2, len);
int sequence_number1_1 = 0, sequence_number2_2 = 0; int sequence_number1_1 = 0, sequence_number2_2 = 0;
// Only pl_type1 was added to the bundle filter for both |channel1_| // Only pl_type1 was added to the bundle filter for both `channel1_`
// and |channel2_|. // and `channel2_`.
int pl_type1 = pl_types[0]; int pl_type1 = pl_types[0];
int pl_type2 = pl_types[1]; int pl_type2 = pl_types[1];
int flags = SSRC_MUX; int flags = SSRC_MUX;
@ -1259,7 +1259,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
} }
// Test that when a channel gets new RtpTransport with a call to // Test that when a channel gets new RtpTransport with a call to
// |SetRtpTransport|, the socket options from the old RtpTransport is merged // `SetRtpTransport`, the socket options from the old RtpTransport is merged
// with the options on the new one. // with the options on the new one.
// For example, audio and video may use separate socket options, but initially // For example, audio and video may use separate socket options, but initially
@ -1359,7 +1359,7 @@ class ChannelTest : public ::testing::Test, public sigslot::has_slots<> {
rtc::Thread::Current()->ProcessMessages(0); rtc::Thread::Current()->ProcessMessages(0);
} }
void WaitForThreads(rtc::ArrayView<rtc::Thread*> threads) { void WaitForThreads(rtc::ArrayView<rtc::Thread*> threads) {
// |threads| and current thread post packets to network thread. // `threads` and current thread post packets to network thread.
for (rtc::Thread* thread : threads) { for (rtc::Thread* thread : threads) {
thread->Invoke<void>(RTC_FROM_HERE, thread->Invoke<void>(RTC_FROM_HERE,
[thread] { ProcessThreadQueue(thread); }); [thread] { ProcessThreadQueue(thread); });

View file

@ -145,8 +145,8 @@ ConnectionContext::~ConnectionContext() {
worker_thread_->Invoke<void>(RTC_FROM_HERE, worker_thread_->Invoke<void>(RTC_FROM_HERE,
[&]() { channel_manager_.reset(nullptr); }); [&]() { channel_manager_.reset(nullptr); });
// Make sure |worker_thread()| and |signaling_thread()| outlive // Make sure `worker_thread()` and `signaling_thread()` outlive
// |default_socket_factory_| and |default_network_manager_|. // `default_socket_factory_` and `default_network_manager_`.
default_socket_factory_ = nullptr; default_socket_factory_ = nullptr;
default_network_manager_ = nullptr; default_network_manager_ = nullptr;

View file

@ -176,7 +176,7 @@ void DataChannelController::SetupDataChannelTransport_n() {
RTC_DCHECK_RUN_ON(network_thread()); RTC_DCHECK_RUN_ON(network_thread());
// There's a new data channel transport. This needs to be signaled to the // There's a new data channel transport. This needs to be signaled to the
// |sctp_data_channels_| so that they can reopen and reconnect. This is // `sctp_data_channels_` so that they can reopen and reconnect. This is
// necessary when bundling is applied. // necessary when bundling is applied.
NotifyDataChannelsOfTransportCreated(); NotifyDataChannelsOfTransportCreated();
} }
@ -194,7 +194,7 @@ void DataChannelController::OnTransportChanged(
RTC_DCHECK_RUN_ON(network_thread()); RTC_DCHECK_RUN_ON(network_thread());
if (data_channel_transport() && if (data_channel_transport() &&
data_channel_transport() != new_data_channel_transport) { data_channel_transport() != new_data_channel_transport) {
// Changed which data channel transport is used for |sctp_mid_| (eg. now // Changed which data channel transport is used for `sctp_mid_` (eg. now
// it's bundled). // it's bundled).
data_channel_transport()->SetDataSink(nullptr); data_channel_transport()->SetDataSink(nullptr);
set_data_channel_transport(new_data_channel_transport); set_data_channel_transport(new_data_channel_transport);
@ -202,7 +202,7 @@ void DataChannelController::OnTransportChanged(
new_data_channel_transport->SetDataSink(this); new_data_channel_transport->SetDataSink(this);
// There's a new data channel transport. This needs to be signaled to the // There's a new data channel transport. This needs to be signaled to the
// |sctp_data_channels_| so that they can reopen and reconnect. This is // `sctp_data_channels_` so that they can reopen and reconnect. This is
// necessary when bundling is applied. // necessary when bundling is applied.
NotifyDataChannelsOfTransportCreated(); NotifyDataChannelsOfTransportCreated();
} }

View file

@ -161,7 +161,7 @@ class DataChannelController : public SctpDataChannelProviderInterface,
std::vector<rtc::scoped_refptr<SctpDataChannel>> sctp_data_channels_to_free_ std::vector<rtc::scoped_refptr<SctpDataChannel>> sctp_data_channels_to_free_
RTC_GUARDED_BY(signaling_thread()); RTC_GUARDED_BY(signaling_thread());
// Signals from |data_channel_transport_|. These are invoked on the // Signals from `data_channel_transport_`. These are invoked on the
// signaling thread. // signaling thread.
// TODO(bugs.webrtc.org/11547): These '_s' signals likely all belong on the // TODO(bugs.webrtc.org/11547): These '_s' signals likely all belong on the
// network thread. // network thread.

View file

@ -42,7 +42,7 @@ void DtlsSrtpTransport::SetDtlsTransports(
// When using DTLS-SRTP, we must reset the SrtpTransport every time the // When using DTLS-SRTP, we must reset the SrtpTransport every time the
// DtlsTransport changes and wait until the DTLS handshake is complete to set // DtlsTransport changes and wait until the DTLS handshake is complete to set
// the newly negotiated parameters. // the newly negotiated parameters.
// If |active_reset_srtp_params_| is true, intentionally reset the SRTP // If `active_reset_srtp_params_` is true, intentionally reset the SRTP
// parameter even though the DtlsTransport may not change. // parameter even though the DtlsTransport may not change.
if (IsSrtpActive() && (rtp_dtls_transport != rtp_dtls_transport_ || if (IsSrtpActive() && (rtp_dtls_transport != rtp_dtls_transport_ ||
active_reset_srtp_params_)) { active_reset_srtp_params_)) {

View file

@ -34,7 +34,7 @@ class DtlsSrtpTransport : public SrtpTransport {
explicit DtlsSrtpTransport(bool rtcp_mux_enabled); explicit DtlsSrtpTransport(bool rtcp_mux_enabled);
// Set P2P layer RTP/RTCP DtlsTransports. When using RTCP-muxing, // Set P2P layer RTP/RTCP DtlsTransports. When using RTCP-muxing,
// |rtcp_dtls_transport| is null. // `rtcp_dtls_transport` is null.
void SetDtlsTransports(cricket::DtlsTransportInternal* rtp_dtls_transport, void SetDtlsTransports(cricket::DtlsTransportInternal* rtp_dtls_transport,
cricket::DtlsTransportInternal* rtcp_dtls_transport); cricket::DtlsTransportInternal* rtcp_dtls_transport);
@ -58,7 +58,7 @@ class DtlsSrtpTransport : public SrtpTransport {
"Set SRTP keys for DTLS-SRTP is not supported."); "Set SRTP keys for DTLS-SRTP is not supported.");
} }
// If |active_reset_srtp_params_| is set to be true, the SRTP parameters will // If `active_reset_srtp_params_` is set to be true, the SRTP parameters will
// be reset whenever the DtlsTransports are reset. // be reset whenever the DtlsTransports are reset.
void SetActiveResetSrtpParams(bool active_reset_srtp_params) { void SetActiveResetSrtpParams(bool active_reset_srtp_params) {
active_reset_srtp_params_ = active_reset_srtp_params; active_reset_srtp_params_ = active_reset_srtp_params;

View file

@ -127,7 +127,7 @@ class DtlsSrtpTransportTest : public ::testing::Test,
packet_size); packet_size);
rtc::PacketOptions options; rtc::PacketOptions options;
// Send a packet from |srtp_transport1_| to |srtp_transport2_| and verify // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
// that the packet can be successfully received and decrypted. // that the packet can be successfully received and decrypted.
int prev_received_packets = transport_observer2_.rtp_count(); int prev_received_packets = transport_observer2_.rtp_count();
ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
@ -157,7 +157,7 @@ class DtlsSrtpTransportTest : public ::testing::Test,
rtc::CopyOnWriteBuffer rtcp_packet2to1(kRtcpReport, rtcp_len, packet_size); rtc::CopyOnWriteBuffer rtcp_packet2to1(kRtcpReport, rtcp_len, packet_size);
rtc::PacketOptions options; rtc::PacketOptions options;
// Send a packet from |srtp_transport1_| to |srtp_transport2_| and verify // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
// that the packet can be successfully received and decrypted. // that the packet can be successfully received and decrypted.
int prev_received_packets = transport_observer2_.rtcp_count(); int prev_received_packets = transport_observer2_.rtcp_count();
ASSERT_TRUE(dtls_srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options, ASSERT_TRUE(dtls_srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options,
@ -202,7 +202,7 @@ class DtlsSrtpTransportTest : public ::testing::Test,
memcpy(original_rtp_data, rtp_packet_data, rtp_len); memcpy(original_rtp_data, rtp_packet_data, rtp_len);
rtc::PacketOptions options; rtc::PacketOptions options;
// Send a packet from |srtp_transport1_| to |srtp_transport2_| and verify // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
// that the packet can be successfully received and decrypted. // that the packet can be successfully received and decrypted.
ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
cricket::PF_SRTP_BYPASS)); cricket::PF_SRTP_BYPASS));
@ -518,7 +518,7 @@ TEST_F(DtlsSrtpTransportTest, SrtpSessionNotResetWhenRtcpTransportRemoved) {
} }
// Tests that RTCP packets can be sent and received if both sides actively reset // Tests that RTCP packets can be sent and received if both sides actively reset
// the SRTP parameters with the |active_reset_srtp_params_| flag. // the SRTP parameters with the `active_reset_srtp_params_` flag.
TEST_F(DtlsSrtpTransportTest, ActivelyResetSrtpParams) { TEST_F(DtlsSrtpTransportTest, ActivelyResetSrtpParams) {
auto rtp_dtls1 = std::make_unique<FakeDtlsTransport>( auto rtp_dtls1 = std::make_unique<FakeDtlsTransport>(
"audio", cricket::ICE_CANDIDATE_COMPONENT_RTP); "audio", cricket::ICE_CANDIDATE_COMPONENT_RTP);
@ -537,7 +537,7 @@ TEST_F(DtlsSrtpTransportTest, ActivelyResetSrtpParams) {
// Send some RTCP packets, causing the SRTCP index to be incremented. // Send some RTCP packets, causing the SRTCP index to be incremented.
SendRecvRtcpPackets(); SendRecvRtcpPackets();
// Only set the |active_reset_srtp_params_| flag to be true one side. // Only set the `active_reset_srtp_params_` flag to be true one side.
dtls_srtp_transport1_->SetActiveResetSrtpParams(true); dtls_srtp_transport1_->SetActiveResetSrtpParams(true);
// Set RTCP transport to null to trigger the SRTP parameters update. // Set RTCP transport to null to trigger the SRTP parameters update.
dtls_srtp_transport1_->SetDtlsTransports(rtp_dtls1.get(), nullptr); dtls_srtp_transport1_->SetDtlsTransports(rtp_dtls1.get(), nullptr);

View file

@ -192,7 +192,7 @@ void DtmfSender::DoInsertDtmf() {
} else { } else {
char tone = tones_[first_tone_pos]; char tone = tones_[first_tone_pos];
if (!GetDtmfCode(tone, &code)) { if (!GetDtmfCode(tone, &code)) {
// The find_first_of(kDtmfValidTones) should have guarantee |tone| is // The find_first_of(kDtmfValidTones) should have guarantee `tone` is
// a valid DTMF tone. // a valid DTMF tone.
RTC_NOTREACHED(); RTC_NOTREACHED();
} }
@ -216,7 +216,7 @@ void DtmfSender::DoInsertDtmf() {
RTC_LOG(LS_ERROR) << "The DtmfProvider can no longer send DTMF."; RTC_LOG(LS_ERROR) << "The DtmfProvider can no longer send DTMF.";
return; return;
} }
// Wait for the number of milliseconds specified by |duration_|. // Wait for the number of milliseconds specified by `duration_`.
tone_gap += duration_; tone_gap += duration_;
} }

View file

@ -38,8 +38,8 @@ class DtmfProviderInterface {
// Returns true if the audio sender is capable of sending DTMF. Otherwise // Returns true if the audio sender is capable of sending DTMF. Otherwise
// returns false. // returns false.
virtual bool CanInsertDtmf() = 0; virtual bool CanInsertDtmf() = 0;
// Sends DTMF |code|. // Sends DTMF `code`.
// The |duration| indicates the length of the DTMF tone in ms. // The `duration` indicates the length of the DTMF tone in ms.
// Returns true on success and false on failure. // Returns true on success and false on failure.
virtual bool InsertDtmf(int code, int duration) = 0; virtual bool InsertDtmf(int code, int duration) = 0;
// Returns a |sigslot::signal0<>| signal. The signal should fire before // Returns a |sigslot::signal0<>| signal. The signal should fire before

View file

@ -129,8 +129,8 @@ class DtmfSenderTest : public ::testing::Test {
} }
} }
// Constructs a list of DtmfInfo from |tones|, |duration| and // Constructs a list of DtmfInfo from `tones`, `duration` and
// |inter_tone_gap|. // `inter_tone_gap`.
void GetDtmfInfoFromString( void GetDtmfInfoFromString(
const std::string& tones, const std::string& tones,
int duration, int duration,

View file

@ -77,8 +77,8 @@ srtp_err_status_t external_hmac_alloc(srtp_auth_t** a,
// Set pointers // Set pointers
*a = reinterpret_cast<srtp_auth_t*>(pointer); *a = reinterpret_cast<srtp_auth_t*>(pointer);
// |external_hmac| is const and libsrtp expects |type| to be non-const. // `external_hmac` is const and libsrtp expects `type` to be non-const.
// const conversion is required. |external_hmac| is constant because we don't // const conversion is required. `external_hmac` is constant because we don't
// want to increase global count in Chrome. // want to increase global count in Chrome.
(*a)->type = const_cast<srtp_auth_type_t*>(&external_hmac); (*a)->type = const_cast<srtp_auth_type_t*>(&external_hmac);
(*a)->state = pointer + sizeof(srtp_auth_t); (*a)->state = pointer + sizeof(srtp_auth_t);
@ -130,7 +130,7 @@ srtp_err_status_t external_hmac_compute(void* /*state*/,
} }
srtp_err_status_t external_crypto_init() { srtp_err_status_t external_crypto_init() {
// |external_hmac| is const. const_cast is required as libsrtp expects // `external_hmac` is const. const_cast is required as libsrtp expects
// non-const. // non-const.
srtp_err_status_t status = srtp_replace_auth_type( srtp_err_status_t status = srtp_replace_auth_type(
const_cast<srtp_auth_type_t*>(&external_hmac), EXTERNAL_HMAC_SHA1); const_cast<srtp_auth_type_t*>(&external_hmac), EXTERNAL_HMAC_SHA1);

View file

@ -59,7 +59,7 @@ static_assert(INVALID == arraysize(kValidIceServiceTypes),
"kValidIceServiceTypes must have as many strings as ServiceType " "kValidIceServiceTypes must have as many strings as ServiceType "
"has values."); "has values.");
// |in_str| should follow of RFC 7064/7065 syntax, but with an optional // `in_str` should follow of RFC 7064/7065 syntax, but with an optional
// "?transport=" already stripped. I.e., // "?transport=" already stripped. I.e.,
// stunURI = scheme ":" host [ ":" port ] // stunURI = scheme ":" host [ ":" port ]
// scheme = "stun" / "stuns" / "turn" / "turns" // scheme = "stun" / "stuns" / "turn" / "turns"
@ -105,7 +105,7 @@ static bool ParsePort(const std::string& in_str, int* port) {
// standard hostname:port format. // standard hostname:port format.
// Consider following formats as correct. // Consider following formats as correct.
// |hostname:port|, |[IPV6 address]:port|, |IPv4 address|:port, // |hostname:port|, |[IPV6 address]:port|, |IPv4 address|:port,
// |hostname|, |[IPv6 address]|, |IPv4 address|. // `hostname`, |[IPv6 address]|, |IPv4 address|.
static bool ParseHostnameAndPortFromString(const std::string& in_str, static bool ParseHostnameAndPortFromString(const std::string& in_str,
std::string* host, std::string* host,
int* port) { int* port) {
@ -145,7 +145,7 @@ static bool ParseHostnameAndPortFromString(const std::string& in_str,
} }
// Adds a STUN or TURN server to the appropriate list, // Adds a STUN or TURN server to the appropriate list,
// by parsing |url| and using the username/password in |server|. // by parsing `url` and using the username/password in `server`.
static RTCErrorType ParseIceServerUrl( static RTCErrorType ParseIceServerUrl(
const PeerConnectionInterface::IceServer& server, const PeerConnectionInterface::IceServer& server,
const std::string& url, const std::string& url,

View file

@ -21,9 +21,9 @@
namespace webrtc { namespace webrtc {
// Parses the URLs for each server in |servers| to build |stun_servers| and // Parses the URLs for each server in `servers` to build `stun_servers` and
// |turn_servers|. Can return SYNTAX_ERROR if the URL is malformed, or // `turn_servers`. Can return SYNTAX_ERROR if the URL is malformed, or
// INVALID_PARAMETER if a TURN server is missing |username| or |password|. // INVALID_PARAMETER if a TURN server is missing `username` or `password`.
// //
// Intended to be used to convert/validate the servers passed into a // Intended to be used to convert/validate the servers passed into a
// PeerConnection through RTCConfiguration. // PeerConnection through RTCConfiguration.

View file

@ -23,7 +23,7 @@ namespace webrtc {
class IceServerParsingTest : public ::testing::Test { class IceServerParsingTest : public ::testing::Test {
public: public:
// Convenience functions for parsing a single URL. Result is stored in // Convenience functions for parsing a single URL. Result is stored in
// |stun_servers_| and |turn_servers_|. // `stun_servers_` and `turn_servers_`.
bool ParseUrl(const std::string& url) { bool ParseUrl(const std::string& url) {
return ParseUrl(url, std::string(), std::string()); return ParseUrl(url, std::string(), std::string());
} }

View file

@ -102,7 +102,7 @@ void UpdateConnectionAddress(
// (draft-ietf-mmusic-trickle-ice-sip), and in particular 0.0.0.0 has been // (draft-ietf-mmusic-trickle-ice-sip), and in particular 0.0.0.0 has been
// widely deployed for this use without outstanding compatibility issues. // widely deployed for this use without outstanding compatibility issues.
// Combining the above considerations, we use 0.0.0.0 with port 9 to // Combining the above considerations, we use 0.0.0.0 with port 9 to
// populate the c= and the m= lines. See |BuildMediaDescription| in // populate the c= and the m= lines. See `BuildMediaDescription` in
// webrtc_sdp.cc for the SDP generation with // webrtc_sdp.cc for the SDP generation with
// |media_desc->connection_address()|. // |media_desc->connection_address()|.
connection_addr = rtc::SocketAddress(kDummyAddress, kDummyPort); connection_addr = rtc::SocketAddress(kDummyAddress, kDummyPort);

View file

@ -111,7 +111,7 @@ JsepTransport::JsepTransport(
TRACE_EVENT0("webrtc", "JsepTransport::JsepTransport"); TRACE_EVENT0("webrtc", "JsepTransport::JsepTransport");
RTC_DCHECK(ice_transport_); RTC_DCHECK(ice_transport_);
RTC_DCHECK(rtp_dtls_transport_); RTC_DCHECK(rtp_dtls_transport_);
// |rtcp_ice_transport_| must be present iff |rtcp_dtls_transport_| is // `rtcp_ice_transport_` must be present iff `rtcp_dtls_transport_` is
// present. // present.
RTC_DCHECK_EQ((rtcp_ice_transport_ != nullptr), RTC_DCHECK_EQ((rtcp_ice_transport_ != nullptr),
(rtcp_dtls_transport_ != nullptr)); (rtcp_dtls_transport_ != nullptr));
@ -528,9 +528,9 @@ bool JsepTransport::SetSdes(const std::vector<CryptoParams>& cryptos,
} else { } else {
RTC_LOG(LS_INFO) << "No crypto keys are provided for SDES."; RTC_LOG(LS_INFO) << "No crypto keys are provided for SDES.";
if (type == SdpType::kAnswer) { if (type == SdpType::kAnswer) {
// Explicitly reset the |sdes_transport_| if no crypto param is // Explicitly reset the `sdes_transport_` if no crypto param is
// provided in the answer. No need to call |ResetParams()| for // provided in the answer. No need to call `ResetParams()` for
// |sdes_negotiator_| because it resets the params inside |SetAnswer|. // `sdes_negotiator_` because it resets the params inside `SetAnswer`.
sdes_transport_->ResetParams(); sdes_transport_->ResetParams();
} }
} }

View file

@ -88,8 +88,8 @@ struct JsepTransportDescription {
// so its methods should only be called on the network thread. // so its methods should only be called on the network thread.
class JsepTransport { class JsepTransport {
public: public:
// |mid| is just used for log statements in order to identify the Transport. // `mid` is just used for log statements in order to identify the Transport.
// Note that |local_certificate| is allowed to be null since a remote // Note that `local_certificate` is allowed to be null since a remote
// description may be set before a local certificate is generated. // description may be set before a local certificate is generated.
JsepTransport( JsepTransport(
const std::string& mid, const std::string& mid,
@ -138,7 +138,7 @@ class JsepTransport {
// set, offers should generate new ufrags/passwords until an ICE restart // set, offers should generate new ufrags/passwords until an ICE restart
// occurs. // occurs.
// //
// This and |needs_ice_restart()| must be called on the network thread. // This and `needs_ice_restart()` must be called on the network thread.
void SetNeedsIceRestartFlag(); void SetNeedsIceRestartFlag();
// Returns true if the ICE restart flag above was set, and no ICE restart has // Returns true if the ICE restart flag above was set, and no ICE restart has

View file

@ -93,7 +93,7 @@ void BundleManager::DeleteMid(const cricket::ContentGroup* bundle_group,
RTC_DCHECK_RUN_ON(&sequence_checker_); RTC_DCHECK_RUN_ON(&sequence_checker_);
RTC_LOG(LS_VERBOSE) << "Deleting mid " << mid << " from bundle group " RTC_LOG(LS_VERBOSE) << "Deleting mid " << mid << " from bundle group "
<< bundle_group->ToString(); << bundle_group->ToString();
// Remove the rejected content from the |bundle_group|. // Remove the rejected content from the `bundle_group`.
// The const pointer arg is used to identify the group, we verify // The const pointer arg is used to identify the group, we verify
// it before we use it to make a modification. // it before we use it to make a modification.
auto bundle_group_it = std::find_if( auto bundle_group_it = std::find_if(

View file

@ -57,7 +57,7 @@ JsepTransportController::JsepTransportController(
config_(config), config_(config),
active_reset_srtp_params_(config.active_reset_srtp_params), active_reset_srtp_params_(config.active_reset_srtp_params),
bundles_(config.bundle_policy) { bundles_(config.bundle_policy) {
// The |transport_observer| is assumed to be non-null. // The `transport_observer` is assumed to be non-null.
RTC_DCHECK(config_.transport_observer); RTC_DCHECK(config_.transport_observer);
RTC_DCHECK(config_.rtcp_handler); RTC_DCHECK(config_.rtcp_handler);
RTC_DCHECK(config_.ice_transport_factory); RTC_DCHECK(config_.ice_transport_factory);
@ -657,7 +657,7 @@ RTCError JsepTransportController::ValidateAndMaybeUpdateBundleGroups(
std::vector<const cricket::ContentGroup*> new_bundle_groups = std::vector<const cricket::ContentGroup*> new_bundle_groups =
description->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE); description->GetGroupsByName(cricket::GROUP_TYPE_BUNDLE);
// Verify |new_bundle_groups|. // Verify `new_bundle_groups`.
std::map<std::string, const cricket::ContentGroup*> new_bundle_groups_by_mid; std::map<std::string, const cricket::ContentGroup*> new_bundle_groups_by_mid;
for (const cricket::ContentGroup* new_bundle_group : new_bundle_groups) { for (const cricket::ContentGroup* new_bundle_group : new_bundle_groups) {
for (const std::string& content_name : new_bundle_group->content_names()) { for (const std::string& content_name : new_bundle_group->content_names()) {
@ -812,7 +812,7 @@ RTCError JsepTransportController::ValidateAndMaybeUpdateBundleGroups(
"An m= section associated with the BUNDLE-tag doesn't exist."); "An m= section associated with the BUNDLE-tag doesn't exist.");
} }
// If the |bundled_content| is rejected, other contents in the bundle group // If the `bundled_content` is rejected, other contents in the bundle group
// must also be rejected. // must also be rejected.
if (bundled_content->rejected) { if (bundled_content->rejected) {
for (const auto& content_name : bundle_group->content_names()) { for (const auto& content_name : bundle_group->content_names()) {
@ -861,7 +861,7 @@ void JsepTransportController::HandleRejectedContent(
} else { } else {
transports_.RemoveTransportForMid(content_info.name); transports_.RemoveTransportForMid(content_info.name);
if (bundle_group) { if (bundle_group) {
// Remove the rejected content from the |bundle_group|. // Remove the rejected content from the `bundle_group`.
bundles_.DeleteMid(bundle_group, content_info.name); bundles_.DeleteMid(bundle_group, content_info.name);
} }
} }

View file

@ -84,20 +84,20 @@ class JsepTransportController : public sigslot::has_slots<> {
public: public:
virtual ~Observer() {} virtual ~Observer() {}
// Returns true if media associated with |mid| was successfully set up to be // Returns true if media associated with `mid` was successfully set up to be
// demultiplexed on |rtp_transport|. Could return false if two bundled m= // demultiplexed on `rtp_transport`. Could return false if two bundled m=
// sections use the same SSRC, for example. // sections use the same SSRC, for example.
// //
// If a data channel transport must be negotiated, |data_channel_transport| // If a data channel transport must be negotiated, `data_channel_transport`
// and |negotiation_state| indicate negotiation status. If // and `negotiation_state` indicate negotiation status. If
// |data_channel_transport| is null, the data channel transport should not // `data_channel_transport` is null, the data channel transport should not
// be used. Otherwise, the value is a pointer to the transport to be used // be used. Otherwise, the value is a pointer to the transport to be used
// for data channels on |mid|, if any. // for data channels on `mid`, if any.
// //
// The observer should not send data on |data_channel_transport| until // The observer should not send data on `data_channel_transport` until
// |negotiation_state| is provisional or final. It should not delete // `negotiation_state` is provisional or final. It should not delete
// |data_channel_transport| or any fallback transport until // `data_channel_transport` or any fallback transport until
// |negotiation_state| is final. // `negotiation_state` is final.
virtual bool OnTransportChanged( virtual bool OnTransportChanged(
const std::string& mid, const std::string& mid,
RtpTransportInternal* rtp_transport, RtpTransportInternal* rtp_transport,
@ -106,12 +106,12 @@ class JsepTransportController : public sigslot::has_slots<> {
}; };
struct Config { struct Config {
// If |redetermine_role_on_ice_restart| is true, ICE role is redetermined // If `redetermine_role_on_ice_restart` is true, ICE role is redetermined
// upon setting a local transport description that indicates an ICE // upon setting a local transport description that indicates an ICE
// restart. // restart.
bool redetermine_role_on_ice_restart = true; bool redetermine_role_on_ice_restart = true;
rtc::SSLProtocolVersion ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12; rtc::SSLProtocolVersion ssl_max_version = rtc::SSL_PROTOCOL_DTLS_12;
// |crypto_options| is used to determine if created DTLS transports // `crypto_options` is used to determine if created DTLS transports
// negotiate GCM crypto suites or not. // negotiate GCM crypto suites or not.
webrtc::CryptoOptions crypto_options; webrtc::CryptoOptions crypto_options;
PeerConnectionInterface::BundlePolicy bundle_policy = PeerConnectionInterface::BundlePolicy bundle_policy =
@ -139,10 +139,10 @@ class JsepTransportController : public sigslot::has_slots<> {
std::function<void(const rtc::SSLHandshakeError)> on_dtls_handshake_error_; std::function<void(const rtc::SSLHandshakeError)> on_dtls_handshake_error_;
}; };
// The ICE related events are fired on the |network_thread|. // The ICE related events are fired on the `network_thread`.
// All the transport related methods are called on the |network_thread| // All the transport related methods are called on the `network_thread`
// and destruction of the JsepTransportController must occur on the // and destruction of the JsepTransportController must occur on the
// |network_thread|. // `network_thread`.
JsepTransportController( JsepTransportController(
rtc::Thread* network_thread, rtc::Thread* network_thread,
cricket::PortAllocator* port_allocator, cricket::PortAllocator* port_allocator,
@ -160,7 +160,7 @@ class JsepTransportController : public sigslot::has_slots<> {
RTCError SetRemoteDescription(SdpType type, RTCError SetRemoteDescription(SdpType type,
const cricket::SessionDescription* description); const cricket::SessionDescription* description);
// Get transports to be used for the provided |mid|. If bundling is enabled, // Get transports to be used for the provided `mid`. If bundling is enabled,
// calling GetRtpTransport for multiple MIDs may yield the same object. // calling GetRtpTransport for multiple MIDs may yield the same object.
RtpTransportInternal* GetRtpTransport(const std::string& mid) const; RtpTransportInternal* GetRtpTransport(const std::string& mid) const;
cricket::DtlsTransportInternal* GetDtlsTransport(const std::string& mid); cricket::DtlsTransportInternal* GetDtlsTransport(const std::string& mid);
@ -366,8 +366,8 @@ class JsepTransportController : public sigslot::has_slots<> {
const std::string& transport_name) RTC_RUN_ON(network_thread_); const std::string& transport_name) RTC_RUN_ON(network_thread_);
// Creates jsep transport. Noop if transport is already created. // Creates jsep transport. Noop if transport is already created.
// Transport is created either during SetLocalDescription (|local| == true) or // Transport is created either during SetLocalDescription (`local` == true) or
// during SetRemoteDescription (|local| == false). Passing |local| helps to // during SetRemoteDescription (`local` == false). Passing `local` helps to
// differentiate initiator (caller) from answerer (callee). // differentiate initiator (caller) from answerer (callee).
RTCError MaybeCreateJsepTransport( RTCError MaybeCreateJsepTransport(
bool local, bool local,

View file

@ -349,7 +349,7 @@ class JsepTransportControllerTest : public JsepTransportController::Observer,
int gathering_state_signal_count_ = 0; int gathering_state_signal_count_ = 0;
int candidates_signal_count_ = 0; int candidates_signal_count_ = 0;
// |network_thread_| should be destroyed after |transport_controller_| // `network_thread_` should be destroyed after `transport_controller_`
std::unique_ptr<rtc::Thread> network_thread_; std::unique_ptr<rtc::Thread> network_thread_;
std::unique_ptr<FakeIceTransportFactory> fake_ice_transport_factory_; std::unique_ptr<FakeIceTransportFactory> fake_ice_transport_factory_;
std::unique_ptr<FakeDtlsTransportFactory> fake_dtls_transport_factory_; std::unique_ptr<FakeDtlsTransportFactory> fake_dtls_transport_factory_;
@ -905,14 +905,14 @@ TEST_F(JsepTransportControllerTest, IceSignalingOccursOnNetworkThread) {
} }
// Test that if the TransportController was created with the // Test that if the TransportController was created with the
// |redetermine_role_on_ice_restart| parameter set to false, the role is *not* // `redetermine_role_on_ice_restart` parameter set to false, the role is *not*
// redetermined on an ICE restart. // redetermined on an ICE restart.
TEST_F(JsepTransportControllerTest, IceRoleNotRedetermined) { TEST_F(JsepTransportControllerTest, IceRoleNotRedetermined) {
JsepTransportController::Config config; JsepTransportController::Config config;
config.redetermine_role_on_ice_restart = false; config.redetermine_role_on_ice_restart = false;
CreateJsepTransportController(config); CreateJsepTransportController(config);
// Let the |transport_controller_| be the controlled side initially. // Let the `transport_controller_` be the controlled side initially.
auto remote_offer = std::make_unique<cricket::SessionDescription>(); auto remote_offer = std::make_unique<cricket::SessionDescription>();
AddAudioSection(remote_offer.get(), kAudioMid1, kIceUfrag1, kIcePwd1, AddAudioSection(remote_offer.get(), kAudioMid1, kIceUfrag1, kIcePwd1,
cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS,
@ -1996,7 +1996,7 @@ TEST_F(JsepTransportControllerTest, BundleSubsetOfMediaSections) {
->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get())
.ok()); .ok());
// Verifiy that only |kAudio1| and |kVideo1| are bundled. // Verifiy that only `kAudio1` and `kVideo1` are bundled.
auto transport1 = transport_controller_->GetRtpTransport(kAudioMid1); auto transport1 = transport_controller_->GetRtpTransport(kAudioMid1);
auto transport2 = transport_controller_->GetRtpTransport(kAudioMid2); auto transport2 = transport_controller_->GetRtpTransport(kAudioMid2);
auto transport3 = transport_controller_->GetRtpTransport(kVideoMid1); auto transport3 = transport_controller_->GetRtpTransport(kVideoMid1);
@ -2170,7 +2170,7 @@ TEST_F(JsepTransportControllerTest, ChangeBundledMidNotSupported) {
EXPECT_TRUE(bundle_group.RemoveContentName(kAudioMid1)); EXPECT_TRUE(bundle_group.RemoveContentName(kAudioMid1));
bundle_group.AddContentName(kAudioMid1); bundle_group.AddContentName(kAudioMid1);
// The answerer uses the new bundle group and now the bundle mid is changed to // The answerer uses the new bundle group and now the bundle mid is changed to
// |kVideo1|. // `kVideo1`.
remote_answer->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE); remote_answer->RemoveGroupByName(cricket::GROUP_TYPE_BUNDLE);
remote_answer->AddGroup(bundle_group); remote_answer->AddGroup(bundle_group);
EXPECT_TRUE(transport_controller_ EXPECT_TRUE(transport_controller_

View file

@ -157,7 +157,7 @@ class JsepTransport2Test : public ::testing::Test, public sigslot::has_slots<> {
std::unique_ptr<JsepTransport> jsep_transport_; std::unique_ptr<JsepTransport> jsep_transport_;
bool signal_rtcp_mux_active_received_ = false; bool signal_rtcp_mux_active_received_ = false;
// The SrtpTransport is owned by |jsep_transport_|. Keep a raw pointer here // The SrtpTransport is owned by `jsep_transport_`. Keep a raw pointer here
// for testing. // for testing.
webrtc::SrtpTransport* sdes_transport_ = nullptr; webrtc::SrtpTransport* sdes_transport_ = nullptr;
}; };

View file

@ -421,9 +421,9 @@ static void AddSimulcastToMediaDescription(
description->set_simulcast_description(simulcast); description->set_simulcast_description(simulcast);
} }
// Adds a StreamParams for each SenderOptions in |sender_options| to // Adds a StreamParams for each SenderOptions in `sender_options` to
// content_description. // content_description.
// |current_params| - All currently known StreamParams of any media type. // `current_params` - All currently known StreamParams of any media type.
template <class C> template <class C>
static bool AddStreamParams( static bool AddStreamParams(
const std::vector<SenderOptions>& sender_options, const std::vector<SenderOptions>& sender_options,
@ -476,10 +476,10 @@ static bool AddStreamParams(
return true; return true;
} }
// Updates the transport infos of the |sdesc| according to the given // Updates the transport infos of the `sdesc` according to the given
// |bundle_group|. The transport infos of the content names within the // `bundle_group`. The transport infos of the content names within the
// |bundle_group| should be updated to use the ufrag, pwd and DTLS role of the // `bundle_group` should be updated to use the ufrag, pwd and DTLS role of the
// first content within the |bundle_group|. // first content within the `bundle_group`.
static bool UpdateTransportInfoForBundle(const ContentGroup& bundle_group, static bool UpdateTransportInfoForBundle(const ContentGroup& bundle_group,
SessionDescription* sdesc) { SessionDescription* sdesc) {
// The bundle should not be empty. // The bundle should not be empty.
@ -513,8 +513,8 @@ static bool UpdateTransportInfoForBundle(const ContentGroup& bundle_group,
return true; return true;
} }
// Gets the CryptoParamsVec of the given |content_name| from |sdesc|, and // Gets the CryptoParamsVec of the given `content_name` from `sdesc`, and
// sets it to |cryptos|. // sets it to `cryptos`.
static bool GetCryptosByName(const SessionDescription* sdesc, static bool GetCryptosByName(const SessionDescription* sdesc,
const std::string& content_name, const std::string& content_name,
CryptoParamsVec* cryptos) { CryptoParamsVec* cryptos) {
@ -529,8 +529,8 @@ static bool GetCryptosByName(const SessionDescription* sdesc,
return true; return true;
} }
// Prunes the |target_cryptos| by removing the crypto params (cipher_suite) // Prunes the `target_cryptos` by removing the crypto params (cipher_suite)
// which are not available in |filter|. // which are not available in `filter`.
static void PruneCryptos(const CryptoParamsVec& filter, static void PruneCryptos(const CryptoParamsVec& filter,
CryptoParamsVec* target_cryptos) { CryptoParamsVec* target_cryptos) {
if (!target_cryptos) { if (!target_cryptos) {
@ -539,8 +539,8 @@ static void PruneCryptos(const CryptoParamsVec& filter,
target_cryptos->erase( target_cryptos->erase(
std::remove_if(target_cryptos->begin(), target_cryptos->end(), std::remove_if(target_cryptos->begin(), target_cryptos->end(),
// Returns true if the |crypto|'s cipher_suite is not // Returns true if the `crypto`'s cipher_suite is not
// found in |filter|. // found in `filter`.
[&filter](const CryptoParams& crypto) { [&filter](const CryptoParams& crypto) {
for (const CryptoParams& entry : filter) { for (const CryptoParams& entry : filter) {
if (entry.cipher_suite == crypto.cipher_suite) if (entry.cipher_suite == crypto.cipher_suite)
@ -561,9 +561,9 @@ static bool IsRtpContent(SessionDescription* sdesc,
return is_rtp; return is_rtp;
} }
// Updates the crypto parameters of the |sdesc| according to the given // Updates the crypto parameters of the `sdesc` according to the given
// |bundle_group|. The crypto parameters of all the contents within the // `bundle_group`. The crypto parameters of all the contents within the
// |bundle_group| should be updated to use the common subset of the // `bundle_group` should be updated to use the common subset of the
// available cryptos. // available cryptos.
static bool UpdateCryptoParamsForBundle(const ContentGroup& bundle_group, static bool UpdateCryptoParamsForBundle(const ContentGroup& bundle_group,
SessionDescription* sdesc) { SessionDescription* sdesc) {
@ -673,7 +673,7 @@ static bool IsFlexfecCodec(const C& codec) {
return absl::EqualsIgnoreCase(codec.name, kFlexfecCodecName); return absl::EqualsIgnoreCase(codec.name, kFlexfecCodecName);
} }
// Create a media content to be offered for the given |sender_options|, // Create a media content to be offered for the given `sender_options`,
// according to the given options.rtcp_mux, session_options.is_muc, codecs, // according to the given options.rtcp_mux, session_options.is_muc, codecs,
// secure_transport, crypto, and current_streams. If we don't currently have // secure_transport, crypto, and current_streams. If we don't currently have
// crypto (in current_cryptos) and it is enabled (in secure_policy), crypto is // crypto (in current_cryptos) and it is enabled (in secure_policy), crypto is
@ -828,15 +828,15 @@ static void NegotiateCodecs(const std::vector<C>& local_codecs,
} }
} }
// Finds a codec in |codecs2| that matches |codec_to_match|, which is // Finds a codec in `codecs2` that matches `codec_to_match`, which is
// a member of |codecs1|. If |codec_to_match| is an RTX codec, both // a member of `codecs1`. If `codec_to_match` is an RTX codec, both
// the codecs themselves and their associated codecs must match. // the codecs themselves and their associated codecs must match.
template <class C> template <class C>
static bool FindMatchingCodec(const std::vector<C>& codecs1, static bool FindMatchingCodec(const std::vector<C>& codecs1,
const std::vector<C>& codecs2, const std::vector<C>& codecs2,
const C& codec_to_match, const C& codec_to_match,
C* found_codec) { C* found_codec) {
// |codec_to_match| should be a member of |codecs1|, in order to look up RTX // `codec_to_match` should be a member of `codecs1`, in order to look up RTX
// codecs' associated codecs correctly. If not, that's a programming error. // codecs' associated codecs correctly. If not, that's a programming error.
RTC_DCHECK(absl::c_any_of(codecs1, [&codec_to_match](const C& codec) { RTC_DCHECK(absl::c_any_of(codecs1, [&codec_to_match](const C& codec) {
return &codec == &codec_to_match; return &codec == &codec_to_match;
@ -867,7 +867,7 @@ static bool FindMatchingCodec(const std::vector<C>& codecs1,
return false; return false;
} }
// Find the codec in |codec_list| that |rtx_codec| is associated with. // Find the codec in `codec_list` that `rtx_codec` is associated with.
template <class C> template <class C>
static const C* GetAssociatedCodec(const std::vector<C>& codec_list, static const C* GetAssociatedCodec(const std::vector<C>& codec_list,
const C& rtx_codec) { const C& rtx_codec) {
@ -897,8 +897,8 @@ static const C* GetAssociatedCodec(const std::vector<C>& codec_list,
return associated_codec; return associated_codec;
} }
// Adds all codecs from |reference_codecs| to |offered_codecs| that don't // Adds all codecs from `reference_codecs` to `offered_codecs` that don't
// already exist in |offered_codecs| and ensure the payload types don't // already exist in `offered_codecs` and ensure the payload types don't
// collide. // collide.
template <class C> template <class C>
static void MergeCodecs(const std::vector<C>& reference_codecs, static void MergeCodecs(const std::vector<C>& reference_codecs,
@ -989,13 +989,13 @@ static Codecs MatchCodecPreference(
return filtered_codecs; return filtered_codecs;
} }
// Adds all extensions from |reference_extensions| to |offered_extensions| that // Adds all extensions from `reference_extensions` to `offered_extensions` that
// don't already exist in |offered_extensions| and ensure the IDs don't // don't already exist in `offered_extensions` and ensure the IDs don't
// collide. If an extension is added, it's also added to |regular_extensions| or // collide. If an extension is added, it's also added to `regular_extensions` or
// |encrypted_extensions|, and if the extension is in |regular_extensions| or // `encrypted_extensions`, and if the extension is in `regular_extensions` or
// |encrypted_extensions|, its ID is marked as used in |used_ids|. // `encrypted_extensions`, its ID is marked as used in `used_ids`.
// |offered_extensions| is for either audio or video while |regular_extensions| // `offered_extensions` is for either audio or video while `regular_extensions`
// and |encrypted_extensions| are used for both audio and video. There could be // and `encrypted_extensions` are used for both audio and video. There could be
// overlap between audio extensions and video extensions. // overlap between audio extensions and video extensions.
static void MergeRtpHdrExts(const RtpHeaderExtensions& reference_extensions, static void MergeRtpHdrExts(const RtpHeaderExtensions& reference_extensions,
RtpHeaderExtensions* offered_extensions, RtpHeaderExtensions* offered_extensions,
@ -1226,7 +1226,7 @@ static bool SetCodecsInAnswer(
return true; return true;
} }
// Create a media content to be answered for the given |sender_options| // Create a media content to be answered for the given `sender_options`
// according to the given session_options.rtcp_mux, session_options.streams, // according to the given session_options.rtcp_mux, session_options.streams,
// codecs, crypto, and current_streams. If we don't currently have crypto (in // codecs, crypto, and current_streams. If we don't currently have crypto (in
// current_cryptos) and it is enabled (in secure_policy), crypto is created // current_cryptos) and it is enabled (in secure_policy), crypto is created
@ -1290,7 +1290,7 @@ static bool IsMediaProtocolSupported(MediaType type,
const std::string& protocol, const std::string& protocol,
bool secure_transport) { bool secure_transport) {
// Since not all applications serialize and deserialize the media protocol, // Since not all applications serialize and deserialize the media protocol,
// we will have to accept |protocol| to be empty. // we will have to accept `protocol` to be empty.
if (protocol.empty()) { if (protocol.empty()) {
return true; return true;
} }
@ -1327,8 +1327,8 @@ static void SetMediaProtocol(bool secure_transport,
desc->set_protocol(kMediaProtocolAvpf); desc->set_protocol(kMediaProtocolAvpf);
} }
// Gets the TransportInfo of the given |content_name| from the // Gets the TransportInfo of the given `content_name` from the
// |current_description|. If doesn't exist, returns a new one. // `current_description`. If doesn't exist, returns a new one.
static const TransportDescription* GetTransportDescription( static const TransportDescription* GetTransportDescription(
const std::string& content_name, const std::string& content_name,
const SessionDescription* current_description) { const SessionDescription* current_description) {
@ -1523,7 +1523,7 @@ std::unique_ptr<SessionDescription> MediaSessionDescriptionFactory::CreateOffer(
auto offer = std::make_unique<SessionDescription>(); auto offer = std::make_unique<SessionDescription>();
// Iterate through the media description options, matching with existing media // Iterate through the media description options, matching with existing media
// descriptions in |current_description|. // descriptions in `current_description`.
size_t msection_index = 0; size_t msection_index = 0;
for (const MediaDescriptionOptions& media_description_options : for (const MediaDescriptionOptions& media_description_options :
session_options.media_description_options) { session_options.media_description_options) {
@ -1667,8 +1667,8 @@ MediaSessionDescriptionFactory::CreateAnswer(
std::vector<const ContentGroup*> offer_bundles = std::vector<const ContentGroup*> offer_bundles =
offer->GetGroupsByName(GROUP_TYPE_BUNDLE); offer->GetGroupsByName(GROUP_TYPE_BUNDLE);
// There are as many answer BUNDLE groups as offer BUNDLE groups (even if // There are as many answer BUNDLE groups as offer BUNDLE groups (even if
// rejected, we respond with an empty group). |offer_bundles|, // rejected, we respond with an empty group). `offer_bundles`,
// |answer_bundles| and |bundle_transports| share the same size and indices. // `answer_bundles` and `bundle_transports` share the same size and indices.
std::vector<ContentGroup> answer_bundles; std::vector<ContentGroup> answer_bundles;
std::vector<std::unique_ptr<TransportInfo>> bundle_transports; std::vector<std::unique_ptr<TransportInfo>> bundle_transports;
answer_bundles.reserve(offer_bundles.size()); answer_bundles.reserve(offer_bundles.size());
@ -1681,7 +1681,7 @@ MediaSessionDescriptionFactory::CreateAnswer(
answer->set_extmap_allow_mixed(offer->extmap_allow_mixed()); answer->set_extmap_allow_mixed(offer->extmap_allow_mixed());
// Iterate through the media description options, matching with existing // Iterate through the media description options, matching with existing
// media descriptions in |current_description|. // media descriptions in `current_description`.
size_t msection_index = 0; size_t msection_index = 0;
for (const MediaDescriptionOptions& media_description_options : for (const MediaDescriptionOptions& media_description_options :
session_options.media_description_options) { session_options.media_description_options) {
@ -1755,7 +1755,7 @@ MediaSessionDescriptionFactory::CreateAnswer(
ContentInfo& added = answer->contents().back(); ContentInfo& added = answer->contents().back();
if (!added.rejected && session_options.bundle_enabled && if (!added.rejected && session_options.bundle_enabled &&
bundle_index.has_value()) { bundle_index.has_value()) {
// The |bundle_index| is for |media_description_options.mid|. // The `bundle_index` is for |media_description_options.mid|.
RTC_DCHECK_EQ(media_description_options.mid, added.name); RTC_DCHECK_EQ(media_description_options.mid, added.name);
answer_bundles[bundle_index.value()].AddContentName(added.name); answer_bundles[bundle_index.value()].AddContentName(added.name);
bundle_transports[bundle_index.value()].reset( bundle_transports[bundle_index.value()].reset(
@ -1926,7 +1926,7 @@ void MediaSessionDescriptionFactory::GetCodecsForOffer(
AudioCodecs* audio_codecs, AudioCodecs* audio_codecs,
VideoCodecs* video_codecs) const { VideoCodecs* video_codecs) const {
// First - get all codecs from the current description if the media type // First - get all codecs from the current description if the media type
// is used. Add them to |used_pltypes| so the payload type is not reused if a // is used. Add them to `used_pltypes` so the payload type is not reused if a
// new media type is added. // new media type is added.
UsedPayloadTypes used_pltypes; UsedPayloadTypes used_pltypes;
MergeCodecsFromDescription(current_active_contents, audio_codecs, MergeCodecsFromDescription(current_active_contents, audio_codecs,
@ -1950,7 +1950,7 @@ void MediaSessionDescriptionFactory::GetCodecsForAnswer(
AudioCodecs* audio_codecs, AudioCodecs* audio_codecs,
VideoCodecs* video_codecs) const { VideoCodecs* video_codecs) const {
// First - get all codecs from the current description if the media type // First - get all codecs from the current description if the media type
// is used. Add them to |used_pltypes| so the payload type is not reused if a // is used. Add them to `used_pltypes` so the payload type is not reused if a
// new media type is added. // new media type is added.
UsedPayloadTypes used_pltypes; UsedPayloadTypes used_pltypes;
MergeCodecsFromDescription(current_active_contents, audio_codecs, MergeCodecsFromDescription(current_active_contents, audio_codecs,
@ -1988,7 +1988,7 @@ void MediaSessionDescriptionFactory::GetCodecsForAnswer(
} }
// Add codecs that are not in the current description but were in // Add codecs that are not in the current description but were in
// |remote_offer|. // `remote_offer`.
MergeCodecs<AudioCodec>(filtered_offered_audio_codecs, audio_codecs, MergeCodecs<AudioCodec>(filtered_offered_audio_codecs, audio_codecs,
&used_pltypes); &used_pltypes);
MergeCodecs<VideoCodec>(filtered_offered_video_codecs, video_codecs, MergeCodecs<VideoCodec>(filtered_offered_video_codecs, video_codecs,
@ -2017,7 +2017,7 @@ MediaSessionDescriptionFactory::GetOfferedRtpHeaderExtensionsWithIds(
AudioVideoRtpHeaderExtensions offered_extensions; AudioVideoRtpHeaderExtensions offered_extensions;
// First - get all extensions from the current description if the media type // First - get all extensions from the current description if the media type
// is used. // is used.
// Add them to |used_ids| so the local ids are not reused if a new media // Add them to `used_ids` so the local ids are not reused if a new media
// type is added. // type is added.
for (const ContentInfo* content : current_active_contents) { for (const ContentInfo* content : current_active_contents) {
if (IsMediaContentOfType(content, MEDIA_TYPE_AUDIO)) { if (IsMediaContentOfType(content, MEDIA_TYPE_AUDIO)) {
@ -2112,10 +2112,10 @@ bool MediaSessionDescriptionFactory::AddTransportAnswer(
return true; return true;
} }
// |audio_codecs| = set of all possible codecs that can be used, with correct // `audio_codecs` = set of all possible codecs that can be used, with correct
// payload type mappings // payload type mappings
// //
// |supported_audio_codecs| = set of codecs that are supported for the direction // `supported_audio_codecs` = set of codecs that are supported for the direction
// of this m= section // of this m= section
// //
// acd->codecs() = set of previously negotiated codecs for this m= section // acd->codecs() = set of previously negotiated codecs for this m= section
@ -2168,7 +2168,7 @@ bool MediaSessionDescriptionFactory::AddAudioContentForOffer(
codec, &found_codec) && codec, &found_codec) &&
!FindMatchingCodec<AudioCodec>(supported_audio_codecs, !FindMatchingCodec<AudioCodec>(supported_audio_codecs,
filtered_codecs, codec, nullptr)) { filtered_codecs, codec, nullptr)) {
// Use the |found_codec| from |audio_codecs| because it has the // Use the `found_codec` from `audio_codecs` because it has the
// correctly mapped payload type. // correctly mapped payload type.
filtered_codecs.push_back(found_codec); filtered_codecs.push_back(found_codec);
} }
@ -2257,7 +2257,7 @@ bool MediaSessionDescriptionFactory::AddVideoContentForOffer(
codec, &found_codec) && codec, &found_codec) &&
!FindMatchingCodec<VideoCodec>(supported_video_codecs, !FindMatchingCodec<VideoCodec>(supported_video_codecs,
filtered_codecs, codec, nullptr)) { filtered_codecs, codec, nullptr)) {
// Use the |found_codec| from |video_codecs| because it has the // Use the `found_codec` from `video_codecs` because it has the
// correctly mapped payload type. // correctly mapped payload type.
filtered_codecs.push_back(found_codec); filtered_codecs.push_back(found_codec);
} }
@ -2375,10 +2375,10 @@ bool MediaSessionDescriptionFactory::AddUnsupportedContentForOffer(
return true; return true;
} }
// |audio_codecs| = set of all possible codecs that can be used, with correct // `audio_codecs` = set of all possible codecs that can be used, with correct
// payload type mappings // payload type mappings
// //
// |supported_audio_codecs| = set of codecs that are supported for the direction // `supported_audio_codecs` = set of codecs that are supported for the direction
// of this m= section // of this m= section
// //
// acd->codecs() = set of previously negotiated codecs for this m= section // acd->codecs() = set of previously negotiated codecs for this m= section
@ -2448,7 +2448,7 @@ bool MediaSessionDescriptionFactory::AddAudioContentForAnswer(
!FindMatchingCodec<AudioCodec>(supported_audio_codecs, !FindMatchingCodec<AudioCodec>(supported_audio_codecs,
filtered_codecs, codec, nullptr)) { filtered_codecs, codec, nullptr)) {
// We should use the local codec with local parameters and the codec id // We should use the local codec with local parameters and the codec id
// would be correctly mapped in |NegotiateCodecs|. // would be correctly mapped in `NegotiateCodecs`.
filtered_codecs.push_back(codec); filtered_codecs.push_back(codec);
} }
} }
@ -2563,7 +2563,7 @@ bool MediaSessionDescriptionFactory::AddVideoContentForAnswer(
!FindMatchingCodec<VideoCodec>(supported_video_codecs, !FindMatchingCodec<VideoCodec>(supported_video_codecs,
filtered_codecs, codec, nullptr)) { filtered_codecs, codec, nullptr)) {
// We should use the local codec with local parameters and the codec id // We should use the local codec with local parameters and the codec id
// would be correctly mapped in |NegotiateCodecs|. // would be correctly mapped in `NegotiateCodecs`.
filtered_codecs.push_back(codec); filtered_codecs.push_back(codec);
} }
} }

View file

@ -50,7 +50,7 @@ struct SenderOptions {
// Use RIDs and Simulcast Layers to indicate spec-compliant Simulcast. // Use RIDs and Simulcast Layers to indicate spec-compliant Simulcast.
std::vector<RidDescription> rids; std::vector<RidDescription> rids;
SimulcastLayerList simulcast_layers; SimulcastLayerList simulcast_layers;
// Use |num_sim_layers| to indicate legacy simulcast. // Use `num_sim_layers` to indicate legacy simulcast.
int num_sim_layers; int num_sim_layers;
}; };
@ -84,7 +84,7 @@ struct MediaDescriptionOptions {
std::vector<webrtc::RtpHeaderExtensionCapability> header_extensions; std::vector<webrtc::RtpHeaderExtensionCapability> header_extensions;
private: private:
// Doesn't DCHECK on |type|. // Doesn't DCHECK on `type`.
void AddSenderInternal(const std::string& track_id, void AddSenderInternal(const std::string& track_id,
const std::vector<std::string>& stream_ids, const std::vector<std::string>& stream_ids,
const std::vector<RidDescription>& rids, const std::vector<RidDescription>& rids,

View file

@ -321,7 +321,7 @@ FindFirstMediaDescriptionByMid(const std::string& mid,
[&mid](const MediaDescriptionOptions& t) { return t.mid == mid; }); [&mid](const MediaDescriptionOptions& t) { return t.mid == mid; });
} }
// Add a media section to the |session_options|. // Add a media section to the `session_options`.
static void AddMediaDescriptionOptions(MediaType type, static void AddMediaDescriptionOptions(MediaType type,
const std::string& mid, const std::string& mid,
RtpTransceiverDirection direction, RtpTransceiverDirection direction,
@ -632,8 +632,8 @@ class MediaSessionDescriptionFactoryTest : public ::testing::Test {
} }
// This test that the audio and video media direction is set to // This test that the audio and video media direction is set to
// |expected_direction_in_answer| in an answer if the offer direction is set // `expected_direction_in_answer` in an answer if the offer direction is set
// to |direction_in_offer| and the answer is willing to both send and receive. // to `direction_in_offer` and the answer is willing to both send and receive.
void TestMediaDirectionInAnswer( void TestMediaDirectionInAnswer(
RtpTransceiverDirection direction_in_offer, RtpTransceiverDirection direction_in_offer,
RtpTransceiverDirection expected_direction_in_answer) { RtpTransceiverDirection expected_direction_in_answer) {
@ -2716,9 +2716,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
f2_.CreateOffer(opts, answer.get())); f2_.CreateOffer(opts, answer.get()));
// The expected audio codecs are the common audio codecs from the first // The expected audio codecs are the common audio codecs from the first
// offer/answer exchange plus the audio codecs only |f2_| offer, sorted in // offer/answer exchange plus the audio codecs only `f2_` offer, sorted in
// preference order. // preference order.
// TODO(wu): |updated_offer| should not include the codec // TODO(wu): `updated_offer` should not include the codec
// (i.e. |kAudioCodecs2[0]|) the other side doesn't support. // (i.e. |kAudioCodecs2[0]|) the other side doesn't support.
const AudioCodec kUpdatedAudioCodecOffer[] = { const AudioCodec kUpdatedAudioCodecOffer[] = {
kAudioCodecsAnswer[0], kAudioCodecsAnswer[0],
@ -2727,7 +2727,7 @@ TEST_F(MediaSessionDescriptionFactoryTest,
}; };
// The expected video codecs are the common video codecs from the first // The expected video codecs are the common video codecs from the first
// offer/answer exchange plus the video codecs only |f2_| offer, sorted in // offer/answer exchange plus the video codecs only `f2_` offer, sorted in
// preference order. // preference order.
const VideoCodec kUpdatedVideoCodecOffer[] = { const VideoCodec kUpdatedVideoCodecOffer[] = {
kVideoCodecsAnswer[0], kVideoCodecsAnswer[0],
@ -2803,8 +2803,8 @@ TEST_F(MediaSessionDescriptionFactoryTest,
f1_.set_video_codecs({}, {}); f1_.set_video_codecs({}, {});
f2_.set_video_codecs({}, {}); f2_.set_video_codecs({}, {});
// Perform initial offer/answer in reverse (|f2_| as offerer) so that the // Perform initial offer/answer in reverse (`f2_` as offerer) so that the
// second offer/answer is forward (|f1_| as offerer). // second offer/answer is forward (`f1_` as offerer).
MediaSessionOptions opts; MediaSessionOptions opts;
AddMediaDescriptionOptions(MEDIA_TYPE_AUDIO, "a0", AddMediaDescriptionOptions(MEDIA_TYPE_AUDIO, "a0",
RtpTransceiverDirection::kSendRecv, kActive, RtpTransceiverDirection::kSendRecv, kActive,
@ -2834,8 +2834,8 @@ TEST_F(MediaSessionDescriptionFactoryTest,
f1_.set_audio_codecs({}, {}); f1_.set_audio_codecs({}, {});
f2_.set_audio_codecs({}, {}); f2_.set_audio_codecs({}, {});
// Perform initial offer/answer in reverse (|f2_| as offerer) so that the // Perform initial offer/answer in reverse (`f2_` as offerer) so that the
// second offer/answer is forward (|f1_| as offerer). // second offer/answer is forward (`f1_` as offerer).
MediaSessionOptions opts; MediaSessionOptions opts;
AddMediaDescriptionOptions(MEDIA_TYPE_VIDEO, "v0", AddMediaDescriptionOptions(MEDIA_TYPE_VIDEO, "v0",
RtpTransceiverDirection::kSendRecv, kActive, RtpTransceiverDirection::kSendRecv, kActive,
@ -2868,12 +2868,12 @@ TEST_F(MediaSessionDescriptionFactoryTest,
RtpTransceiverDirection::kRecvOnly, kActive, RtpTransceiverDirection::kRecvOnly, kActive,
&opts); &opts);
std::vector<VideoCodec> f1_codecs = MAKE_VECTOR(kVideoCodecs1); std::vector<VideoCodec> f1_codecs = MAKE_VECTOR(kVideoCodecs1);
// This creates rtx for H264 with the payload type |f1_| uses. // This creates rtx for H264 with the payload type `f1_` uses.
AddRtxCodec(VideoCodec::CreateRtxCodec(126, kVideoCodecs1[1].id), &f1_codecs); AddRtxCodec(VideoCodec::CreateRtxCodec(126, kVideoCodecs1[1].id), &f1_codecs);
f1_.set_video_codecs(f1_codecs, f1_codecs); f1_.set_video_codecs(f1_codecs, f1_codecs);
std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2); std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2);
// This creates rtx for H264 with the payload type |f2_| uses. // This creates rtx for H264 with the payload type `f2_` uses.
AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs); AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs);
f2_.set_video_codecs(f2_codecs, f2_codecs); f2_.set_video_codecs(f2_codecs, f2_codecs);
@ -2891,9 +2891,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
EXPECT_EQ(expected_codecs, vcd->codecs()); EXPECT_EQ(expected_codecs, vcd->codecs());
// Now, make sure we get same result (except for the order) if |f2_| creates // Now, make sure we get same result (except for the order) if `f2_` creates
// an updated offer even though the default payload types between |f1_| and // an updated offer even though the default payload types between `f1_` and
// |f2_| are different. // `f2_` are different.
std::unique_ptr<SessionDescription> updated_offer( std::unique_ptr<SessionDescription> updated_offer(
f2_.CreateOffer(opts, answer.get())); f2_.CreateOffer(opts, answer.get()));
ASSERT_TRUE(updated_offer); ASSERT_TRUE(updated_offer);
@ -2968,7 +2968,7 @@ TEST_F(MediaSessionDescriptionFactoryTest,
TEST_F(MediaSessionDescriptionFactoryTest, TEST_F(MediaSessionDescriptionFactoryTest,
RespondentCreatesOfferWithVideoAndRtxAfterCreatingAudioAnswer) { RespondentCreatesOfferWithVideoAndRtxAfterCreatingAudioAnswer) {
std::vector<VideoCodec> f1_codecs = MAKE_VECTOR(kVideoCodecs1); std::vector<VideoCodec> f1_codecs = MAKE_VECTOR(kVideoCodecs1);
// This creates rtx for H264 with the payload type |f1_| uses. // This creates rtx for H264 with the payload type `f1_` uses.
AddRtxCodec(VideoCodec::CreateRtxCodec(126, kVideoCodecs1[1].id), &f1_codecs); AddRtxCodec(VideoCodec::CreateRtxCodec(126, kVideoCodecs1[1].id), &f1_codecs);
f1_.set_video_codecs(f1_codecs, f1_codecs); f1_.set_video_codecs(f1_codecs, f1_codecs);
@ -2985,7 +2985,7 @@ TEST_F(MediaSessionDescriptionFactoryTest,
GetFirstAudioContentDescription(answer.get()); GetFirstAudioContentDescription(answer.get());
EXPECT_THAT(acd->codecs(), ElementsAreArray(kAudioCodecsAnswer)); EXPECT_THAT(acd->codecs(), ElementsAreArray(kAudioCodecsAnswer));
// Now - let |f2_| add video with RTX and let the payload type the RTX codec // Now - let `f2_` add video with RTX and let the payload type the RTX codec
// reference be the same as an audio codec that was negotiated in the // reference be the same as an audio codec that was negotiated in the
// first offer/answer exchange. // first offer/answer exchange.
opts.media_description_options.clear(); opts.media_description_options.clear();
@ -3029,7 +3029,7 @@ TEST_F(MediaSessionDescriptionFactoryTest,
AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts);
std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2); std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2);
// This creates rtx for H264 with the payload type |f2_| uses. // This creates rtx for H264 with the payload type `f2_` uses.
AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs); AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs);
f2_.set_video_codecs(f2_codecs, f2_codecs); f2_.set_video_codecs(f2_codecs, f2_codecs);
@ -3044,9 +3044,9 @@ TEST_F(MediaSessionDescriptionFactoryTest,
std::vector<VideoCodec> expected_codecs = MAKE_VECTOR(kVideoCodecsAnswer); std::vector<VideoCodec> expected_codecs = MAKE_VECTOR(kVideoCodecsAnswer);
EXPECT_EQ(expected_codecs, vcd->codecs()); EXPECT_EQ(expected_codecs, vcd->codecs());
// Now, ensure that the RTX codec is created correctly when |f2_| creates an // Now, ensure that the RTX codec is created correctly when `f2_` creates an
// updated offer, even though the default payload types are different from // updated offer, even though the default payload types are different from
// those of |f1_|. // those of `f1_`.
std::unique_ptr<SessionDescription> updated_offer( std::unique_ptr<SessionDescription> updated_offer(
f2_.CreateOffer(opts, answer.get())); f2_.CreateOffer(opts, answer.get()));
ASSERT_TRUE(updated_offer); ASSERT_TRUE(updated_offer);
@ -3073,7 +3073,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, RtxWithoutApt) {
f1_.set_video_codecs(f1_codecs, f1_codecs); f1_.set_video_codecs(f1_codecs, f1_codecs);
std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2); std::vector<VideoCodec> f2_codecs = MAKE_VECTOR(kVideoCodecs2);
// This creates RTX for H264 with the payload type |f2_| uses. // This creates RTX for H264 with the payload type `f2_` uses.
AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs); AddRtxCodec(VideoCodec::CreateRtxCodec(125, kVideoCodecs2[0].id), &f2_codecs);
f2_.set_video_codecs(f2_codecs, f2_codecs); f2_.set_video_codecs(f2_codecs, f2_codecs);
@ -3363,17 +3363,17 @@ TEST_F(MediaSessionDescriptionFactoryTest,
// The expected RTP header extensions in the new offer are the resulting // The expected RTP header extensions in the new offer are the resulting
// extensions from the first offer/answer exchange plus the extensions only // extensions from the first offer/answer exchange plus the extensions only
// |f2_| offer. // `f2_` offer.
// Since the default local extension id |f2_| uses has already been used by // Since the default local extension id `f2_` uses has already been used by
// |f1_| for another extensions, it is changed to 13. // `f1_` for another extensions, it is changed to 13.
const RtpExtension kUpdatedAudioRtpExtensions[] = { const RtpExtension kUpdatedAudioRtpExtensions[] = {
kAudioRtpExtensionAnswer[0], kAudioRtpExtensionAnswer[0],
RtpExtension(kAudioRtpExtension2[1].uri, 13), RtpExtension(kAudioRtpExtension2[1].uri, 13),
kAudioRtpExtension2[2], kAudioRtpExtension2[2],
}; };
// Since the default local extension id |f2_| uses has already been used by // Since the default local extension id `f2_` uses has already been used by
// |f1_| for another extensions, is is changed to 12. // `f1_` for another extensions, is is changed to 12.
const RtpExtension kUpdatedVideoRtpExtensions[] = { const RtpExtension kUpdatedVideoRtpExtensions[] = {
kVideoRtpExtensionAnswer[0], kVideoRtpExtensionAnswer[0],
RtpExtension(kVideoRtpExtension2[1].uri, 12), RtpExtension(kVideoRtpExtension2[1].uri, 12),

View file

@ -276,7 +276,7 @@ bool DtlsEnabled(const PeerConnectionInterface::RTCConfiguration& configuration,
bool default_enabled = bool default_enabled =
(dependencies.cert_generator || !configuration.certificates.empty()); (dependencies.cert_generator || !configuration.certificates.empty());
// The |configuration| can override the default value. // The `configuration` can override the default value.
return configuration.enable_dtls_srtp.value_or(default_enabled); return configuration.enable_dtls_srtp.value_or(default_enabled);
} }
@ -499,7 +499,7 @@ PeerConnection::PeerConnection(
call_ptr_(call_.get()), call_ptr_(call_.get()),
// RFC 3264: The numeric value of the session id and version in the // RFC 3264: The numeric value of the session id and version in the
// o line MUST be representable with a "64 bit signed integer". // o line MUST be representable with a "64 bit signed integer".
// Due to this constraint session id |session_id_| is max limited to // Due to this constraint session id `session_id_` is max limited to
// LLONG_MAX. // LLONG_MAX.
session_id_(rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX)), session_id_(rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX)),
dtls_enabled_(dtls_enabled), dtls_enabled_(dtls_enabled),
@ -1195,7 +1195,7 @@ void PeerConnection::GetStats(
break; break;
} }
} }
// If there is no |internal_sender| then |selector| is either null or does not // If there is no `internal_sender` then `selector` is either null or does not
// belong to the PeerConnection (in Plan B, senders can be removed from the // belong to the PeerConnection (in Plan B, senders can be removed from the
// PeerConnection). This means that "all the stats objects representing the // PeerConnection). This means that "all the stats objects representing the
// selector" is an empty set. Invoking GetStatsReport() with a null selector // selector" is an empty set. Invoking GetStatsReport() with a null selector
@ -1225,7 +1225,7 @@ void PeerConnection::GetStats(
break; break;
} }
} }
// If there is no |internal_receiver| then |selector| is either null or does // If there is no `internal_receiver` then `selector` is either null or does
// not belong to the PeerConnection (in Plan B, receivers can be removed from // not belong to the PeerConnection (in Plan B, receivers can be removed from
// the PeerConnection). This means that "all the stats objects representing // the PeerConnection). This means that "all the stats objects representing
// the selector" is an empty set. Invoking GetStatsReport() with a null // the selector" is an empty set. Invoking GetStatsReport() with a null
@ -2418,7 +2418,7 @@ bool PeerConnection::SetupDataChannelTransport_n(const std::string& mid) {
void PeerConnection::TeardownDataChannelTransport_n() { void PeerConnection::TeardownDataChannelTransport_n() {
if (sctp_mid_n_) { if (sctp_mid_n_) {
// |sctp_mid_| may still be active through an SCTP transport. If not, unset // `sctp_mid_` may still be active through an SCTP transport. If not, unset
// it. // it.
RTC_LOG(LS_INFO) << "Tearing down data channel transport for mid=" RTC_LOG(LS_INFO) << "Tearing down data channel transport for mid="
<< *sctp_mid_n_; << *sctp_mid_n_;

View file

@ -404,7 +404,7 @@ class PeerConnection : public PeerConnectionInternal,
void ResetSctpDataMid(); void ResetSctpDataMid();
// Asynchronously calls SctpTransport::Start() on the network thread for // Asynchronously calls SctpTransport::Start() on the network thread for
// |sctp_mid()| if set. Called as part of setting the local description. // `sctp_mid()` if set. Called as part of setting the local description.
void StartSctpTransport(int local_port, void StartSctpTransport(int local_port,
int remote_port, int remote_port,
int max_message_size); int max_message_size);
@ -415,7 +415,7 @@ class PeerConnection : public PeerConnectionInternal,
CryptoOptions GetCryptoOptions(); CryptoOptions GetCryptoOptions();
// Internal implementation for AddTransceiver family of methods. If // Internal implementation for AddTransceiver family of methods. If
// |fire_callback| is set, fires OnRenegotiationNeeded callback if successful. // `fire_callback` is set, fires OnRenegotiationNeeded callback if successful.
RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver( RTCErrorOr<rtc::scoped_refptr<RtpTransceiverInterface>> AddTransceiver(
cricket::MediaType media_type, cricket::MediaType media_type,
rtc::scoped_refptr<MediaStreamTrackInterface> track, rtc::scoped_refptr<MediaStreamTrackInterface> track,
@ -531,8 +531,8 @@ class PeerConnection : public PeerConnectionInternal,
// This function should only be called from the worker thread. // This function should only be called from the worker thread.
void StopRtcEventLog_w(); void StopRtcEventLog_w();
// Returns true and the TransportInfo of the given |content_name| // Returns true and the TransportInfo of the given `content_name`
// from |description|. Returns false if it's not available. // from `description`. Returns false if it's not available.
static bool GetTransportDescription( static bool GetTransportDescription(
const cricket::SessionDescription* description, const cricket::SessionDescription* description,
const std::string& content_name, const std::string& content_name,
@ -540,7 +540,7 @@ class PeerConnection : public PeerConnectionInternal,
// Returns the media index for a local ice candidate given the content name. // Returns the media index for a local ice candidate given the content name.
// Returns false if the local session description does not have a media // Returns false if the local session description does not have a media
// content called |content_name|. // content called `content_name`.
bool GetLocalCandidateMediaIndex(const std::string& content_name, bool GetLocalCandidateMediaIndex(const std::string& content_name,
int* sdp_mline_index) int* sdp_mline_index)
RTC_RUN_ON(signaling_thread()); RTC_RUN_ON(signaling_thread());
@ -585,7 +585,7 @@ class PeerConnection : public PeerConnectionInternal,
// JsepTransportController::Observer override. // JsepTransportController::Observer override.
// //
// Called by |transport_controller_| when processing transport information // Called by `transport_controller_` when processing transport information
// from a session description, and the mapping from m= sections to transports // from a session description, and the mapping from m= sections to transports
// changed (as a result of BUNDLE negotiation, or m= sections being // changed (as a result of BUNDLE negotiation, or m= sections being
// rejected). // rejected).
@ -606,7 +606,7 @@ class PeerConnection : public PeerConnectionInternal,
const bool is_unified_plan_; const bool is_unified_plan_;
// The EventLog needs to outlive |call_| (and any other object that uses it). // The EventLog needs to outlive `call_` (and any other object that uses it).
std::unique_ptr<RtcEventLog> event_log_ RTC_GUARDED_BY(worker_thread()); std::unique_ptr<RtcEventLog> event_log_ RTC_GUARDED_BY(worker_thread());
// Points to the same thing as `event_log_`. Since it's const, we may read the // Points to the same thing as `event_log_`. Since it's const, we may read the
@ -634,7 +634,7 @@ class PeerConnection : public PeerConnectionInternal,
ice_transport_factory_; // TODO(bugs.webrtc.org/9987): Accessed on the ice_transport_factory_; // TODO(bugs.webrtc.org/9987): Accessed on the
// signaling thread but the underlying raw // signaling thread but the underlying raw
// pointer is given to // pointer is given to
// |jsep_transport_controller_| and used on the // `jsep_transport_controller_` and used on the
// network thread. // network thread.
const std::unique_ptr<rtc::SSLCertificateVerifier> tls_cert_verifier_ const std::unique_ptr<rtc::SSLCertificateVerifier> tls_cert_verifier_
RTC_GUARDED_BY(network_thread()); RTC_GUARDED_BY(network_thread());
@ -663,7 +663,7 @@ class PeerConnection : public PeerConnectionInternal,
transport_controller_; // TODO(bugs.webrtc.org/9987): Accessed on both transport_controller_; // TODO(bugs.webrtc.org/9987): Accessed on both
// signaling and network thread. // signaling and network thread.
// |sctp_mid_| is the content name (MID) in SDP. // `sctp_mid_` is the content name (MID) in SDP.
// Note: this is used as the data channel MID by both SCTP and data channel // Note: this is used as the data channel MID by both SCTP and data channel
// transports. It is set when either transport is initialized and unset when // transports. It is set when either transport is initialized and unset when
// both transports are deleted. // both transports are deleted.

View file

@ -132,7 +132,7 @@ class PeerConnectionEndToEndBaseTest : public sigslot::has_slots<>,
callee_signaled_data_channels_.push_back(dc); callee_signaled_data_channels_.push_back(dc);
} }
// Tests that |dc1| and |dc2| can send to and receive from each other. // Tests that `dc1` and `dc2` can send to and receive from each other.
void TestDataChannelSendAndReceive(DataChannelInterface* dc1, void TestDataChannelSendAndReceive(DataChannelInterface* dc1,
DataChannelInterface* dc2, DataChannelInterface* dc2,
size_t size = 6) { size_t size = 6) {

View file

@ -248,7 +248,7 @@ PeerConnectionFactory::CreatePeerConnectionOrError(
} }
// We configure the proxy with a pointer to the network thread for methods // We configure the proxy with a pointer to the network thread for methods
// that need to be invoked there rather than on the signaling thread. // that need to be invoked there rather than on the signaling thread.
// Internally, the proxy object has a member variable named |worker_thread_| // Internally, the proxy object has a member variable named `worker_thread_`
// which will point to the network thread (and not the factory's // which will point to the network thread (and not the factory's
// worker_thread()). All such methods have thread checks though, so the code // worker_thread()). All such methods have thread checks though, so the code
// should still be clear (outside of macro expansion). // should still be clear (outside of macro expansion).

View file

@ -651,7 +651,7 @@ TEST_F(PeerConnectionUsageHistogramTest,
EXPECT_TRUE(caller->observer()->candidate_gathered()); EXPECT_TRUE(caller->observer()->candidate_gathered());
// Get the current offer that contains candidates and pass it to the callee. // Get the current offer that contains candidates and pass it to the callee.
// //
// Note that we cannot use CloneSessionDescription on |cur_offer| to obtain an // Note that we cannot use CloneSessionDescription on `cur_offer` to obtain an
// SDP with candidates. The method above does not strictly copy everything, in // SDP with candidates. The method above does not strictly copy everything, in
// particular, not copying the ICE candidates. // particular, not copying the ICE candidates.
// TODO(qingsi): Technically, this is a bug. Fix it. // TODO(qingsi): Technically, this is a bug. Fix it.

View file

@ -233,7 +233,7 @@ class PeerConnectionIceBaseTest : public ::testing::Test {
} }
// Returns a list of (ufrag, pwd) pairs in the order that they appear in // Returns a list of (ufrag, pwd) pairs in the order that they appear in
// |description|, or the empty list if |description| is null. // `description`, or the empty list if `description` is null.
std::vector<std::pair<std::string, std::string>> GetIceCredentials( std::vector<std::pair<std::string, std::string>> GetIceCredentials(
const SessionDescriptionInterface* description) { const SessionDescriptionInterface* description) {
std::vector<std::pair<std::string, std::string>> ice_credentials; std::vector<std::pair<std::string, std::string>> ice_credentials;
@ -589,7 +589,7 @@ TEST_P(PeerConnectionIceTest,
ASSERT_TRUE( ASSERT_TRUE(
caller->SetRemoteDescription(callee->CreateAnswerAndSetAsLocal())); caller->SetRemoteDescription(callee->CreateAnswerAndSetAsLocal()));
// Add one candidate via |AddIceCandidate|. // Add one candidate via `AddIceCandidate`.
cricket::Candidate candidate1 = CreateLocalUdpCandidate(kCallerAddress1); cricket::Candidate candidate1 = CreateLocalUdpCandidate(kCallerAddress1);
ASSERT_TRUE(callee->AddIceCandidate(&candidate1)); ASSERT_TRUE(callee->AddIceCandidate(&candidate1));
@ -1005,7 +1005,7 @@ TEST_P(PeerConnectionIceTest,
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal())); ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
auto initial_ice_credentials = auto initial_ice_credentials =
GetIceCredentials(caller->pc()->local_description()); GetIceCredentials(caller->pc()->local_description());
// ICE restart becomes needed while an O/A is pending and |caller| is the // ICE restart becomes needed while an O/A is pending and `caller` is the
// offerer. // offerer.
caller->pc()->RestartIce(); caller->pc()->RestartIce();
ASSERT_TRUE( ASSERT_TRUE(
@ -1025,7 +1025,7 @@ TEST_P(PeerConnectionIceTest,
auto initial_ice_credentials = auto initial_ice_credentials =
GetIceCredentials(caller->pc()->local_description()); GetIceCredentials(caller->pc()->local_description());
ASSERT_TRUE(caller->SetRemoteDescription(callee->CreateOfferAndSetAsLocal())); ASSERT_TRUE(caller->SetRemoteDescription(callee->CreateOfferAndSetAsLocal()));
// ICE restart becomes needed while an O/A is pending and |caller| is the // ICE restart becomes needed while an O/A is pending and `caller` is the
// answerer. // answerer.
caller->pc()->RestartIce(); caller->pc()->RestartIce();
ASSERT_TRUE( ASSERT_TRUE(
@ -1044,7 +1044,7 @@ TEST_P(PeerConnectionIceTest, RestartIceTriggeredByRemoteSide) {
auto initial_ice_credentials = auto initial_ice_credentials =
GetIceCredentials(caller->pc()->local_description()); GetIceCredentials(caller->pc()->local_description());
// Remote restart and O/A exchange with |caller| as the answerer should // Remote restart and O/A exchange with `caller` as the answerer should
// restart ICE locally as well. // restart ICE locally as well.
callee->pc()->RestartIce(); callee->pc()->RestartIce();
ASSERT_TRUE(callee->ExchangeOfferAnswerWith(caller.get())); ASSERT_TRUE(callee->ExchangeOfferAnswerWith(caller.get()));
@ -1082,7 +1082,7 @@ TEST_F(PeerConnectionIceTestUnifiedPlan,
auto callee = CreatePeerConnectionWithAudioVideo(); auto callee = CreatePeerConnectionWithAudioVideo();
ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal())); ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal()));
// ICE restart becomes needed while an O/A is pending and |caller| is the // ICE restart becomes needed while an O/A is pending and `caller` is the
// offerer. // offerer.
caller->observer()->clear_legacy_renegotiation_needed(); caller->observer()->clear_legacy_renegotiation_needed();
caller->observer()->clear_latest_negotiation_needed_event(); caller->observer()->clear_latest_negotiation_needed_event();
@ -1105,7 +1105,7 @@ TEST_F(PeerConnectionIceTestUnifiedPlan,
// Establish initial credentials as the caller. // Establish initial credentials as the caller.
ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get())); ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get()));
ASSERT_TRUE(caller->SetRemoteDescription(callee->CreateOfferAndSetAsLocal())); ASSERT_TRUE(caller->SetRemoteDescription(callee->CreateOfferAndSetAsLocal()));
// ICE restart becomes needed while an O/A is pending and |caller| is the // ICE restart becomes needed while an O/A is pending and `caller` is the
// answerer. // answerer.
caller->observer()->clear_legacy_renegotiation_needed(); caller->observer()->clear_legacy_renegotiation_needed();
caller->observer()->clear_latest_negotiation_needed_event(); caller->observer()->clear_latest_negotiation_needed_event();
@ -1130,7 +1130,7 @@ TEST_F(PeerConnectionIceTestUnifiedPlan,
caller->pc()->RestartIce(); caller->pc()->RestartIce();
caller->observer()->clear_legacy_renegotiation_needed(); caller->observer()->clear_legacy_renegotiation_needed();
caller->observer()->clear_latest_negotiation_needed_event(); caller->observer()->clear_latest_negotiation_needed_event();
// Remote restart and O/A exchange with |caller| as the answerer should // Remote restart and O/A exchange with `caller` as the answerer should
// restart ICE locally as well. // restart ICE locally as well.
callee->pc()->RestartIce(); callee->pc()->RestartIce();
ASSERT_TRUE(callee->ExchangeOfferAnswerWith(caller.get())); ASSERT_TRUE(callee->ExchangeOfferAnswerWith(caller.get()));

View file

@ -203,7 +203,7 @@ class DummyDtmfObserver : public DtmfSenderObserverInterface {
std::vector<std::string> tones_; std::vector<std::string> tones_;
}; };
// Assumes |sender| already has an audio track added and the offer/answer // Assumes `sender` already has an audio track added and the offer/answer
// exchange is done. // exchange is done.
void TestDtmfFromSenderToReceiver(PeerConnectionIntegrationWrapper* sender, void TestDtmfFromSenderToReceiver(PeerConnectionIntegrationWrapper* sender,
PeerConnectionIntegrationWrapper* receiver) { PeerConnectionIntegrationWrapper* receiver) {
@ -288,7 +288,7 @@ TEST_P(PeerConnectionIntegrationTest, EndToEndCallWithSdes) {
webrtc::kEnumCounterKeyProtocolDtls)); webrtc::kEnumCounterKeyProtocolDtls));
} }
// Basic end-to-end test specifying the |enable_encrypted_rtp_header_extensions| // Basic end-to-end test specifying the `enable_encrypted_rtp_header_extensions`
// option to offer encrypted versions of all header extensions alongside the // option to offer encrypted versions of all header extensions alongside the
// unencrypted versions. // unencrypted versions.
TEST_P(PeerConnectionIntegrationTest, TEST_P(PeerConnectionIntegrationTest,

View file

@ -504,7 +504,7 @@ void SetSsrcToZero(std::string* sdp) {
} }
} }
// Check if |streams| contains the specified track. // Check if `streams` contains the specified track.
bool ContainsTrack(const std::vector<cricket::StreamParams>& streams, bool ContainsTrack(const std::vector<cricket::StreamParams>& streams,
const std::string& stream_id, const std::string& stream_id,
const std::string& track_id) { const std::string& track_id) {
@ -516,7 +516,7 @@ bool ContainsTrack(const std::vector<cricket::StreamParams>& streams,
return false; return false;
} }
// Check if |senders| contains the specified sender, by id. // Check if `senders` contains the specified sender, by id.
bool ContainsSender( bool ContainsSender(
const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders, const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders,
const std::string& id) { const std::string& id) {
@ -528,7 +528,7 @@ bool ContainsSender(
return false; return false;
} }
// Check if |senders| contains the specified sender, by id and stream id. // Check if `senders` contains the specified sender, by id and stream id.
bool ContainsSender( bool ContainsSender(
const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders, const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders,
const std::string& id, const std::string& id,
@ -1096,10 +1096,10 @@ class PeerConnectionInterfaceBaseTest : public ::testing::Test {
} }
// This function creates a MediaStream with label kStreams[0] and // This function creates a MediaStream with label kStreams[0] and
// |number_of_audio_tracks| and |number_of_video_tracks| tracks and the // `number_of_audio_tracks` and `number_of_video_tracks` tracks and the
// corresponding SessionDescriptionInterface. The SessionDescriptionInterface // corresponding SessionDescriptionInterface. The SessionDescriptionInterface
// is returned and the MediaStream is stored in // is returned and the MediaStream is stored in
// |reference_collection_| // `reference_collection_`
std::unique_ptr<SessionDescriptionInterface> std::unique_ptr<SessionDescriptionInterface>
CreateSessionDescriptionAndReference(size_t number_of_audio_tracks, CreateSessionDescriptionAndReference(size_t number_of_audio_tracks,
size_t number_of_video_tracks) { size_t number_of_video_tracks) {
@ -3217,7 +3217,7 @@ TEST_P(PeerConnectionInterfaceTest, CurrentAndPendingDescriptions) {
// Tests that it won't crash when calling StartRtcEventLog or StopRtcEventLog // Tests that it won't crash when calling StartRtcEventLog or StopRtcEventLog
// after the PeerConnection is closed. // after the PeerConnection is closed.
// This version tests the StartRtcEventLog version that receives an object // This version tests the StartRtcEventLog version that receives an object
// of type |RtcEventLogOutput|. // of type `RtcEventLogOutput`.
TEST_P(PeerConnectionInterfaceTest, TEST_P(PeerConnectionInterfaceTest,
StartAndStopLoggingToOutputAfterPeerConnectionClosed) { StartAndStopLoggingToOutputAfterPeerConnectionClosed) {
CreatePeerConnection(); CreatePeerConnection();
@ -3473,7 +3473,7 @@ TEST_P(PeerConnectionInterfaceTest,
} }
// Test that the audio and video content will be added to an offer if both // Test that the audio and video content will be added to an offer if both
// |offer_to_receive_audio| and |offer_to_receive_video| options are 1. // `offer_to_receive_audio` and `offer_to_receive_video` options are 1.
TEST_P(PeerConnectionInterfaceTest, CreateOfferWithAudioVideoOptions) { TEST_P(PeerConnectionInterfaceTest, CreateOfferWithAudioVideoOptions) {
RTCOfferAnswerOptions rtc_options; RTCOfferAnswerOptions rtc_options;
rtc_options.offer_to_receive_audio = 1; rtc_options.offer_to_receive_audio = 1;
@ -3488,7 +3488,7 @@ TEST_P(PeerConnectionInterfaceTest, CreateOfferWithAudioVideoOptions) {
} }
// Test that only audio content will be added to the offer if only // Test that only audio content will be added to the offer if only
// |offer_to_receive_audio| options is 1. // `offer_to_receive_audio` options is 1.
TEST_P(PeerConnectionInterfaceTest, CreateOfferWithAudioOnlyOptions) { TEST_P(PeerConnectionInterfaceTest, CreateOfferWithAudioOnlyOptions) {
RTCOfferAnswerOptions rtc_options; RTCOfferAnswerOptions rtc_options;
rtc_options.offer_to_receive_audio = 1; rtc_options.offer_to_receive_audio = 1;
@ -3502,7 +3502,7 @@ TEST_P(PeerConnectionInterfaceTest, CreateOfferWithAudioOnlyOptions) {
EXPECT_EQ(nullptr, GetFirstVideoContent(offer->description())); EXPECT_EQ(nullptr, GetFirstVideoContent(offer->description()));
} }
// Test that only video content will be added if only |offer_to_receive_video| // Test that only video content will be added if only `offer_to_receive_video`
// options is 1. // options is 1.
TEST_P(PeerConnectionInterfaceTest, CreateOfferWithVideoOnlyOptions) { TEST_P(PeerConnectionInterfaceTest, CreateOfferWithVideoOnlyOptions) {
RTCOfferAnswerOptions rtc_options; RTCOfferAnswerOptions rtc_options;
@ -3530,7 +3530,7 @@ TEST_P(PeerConnectionInterfaceTest, CreateOfferWithDefaultOfferAnswerOptions) {
EXPECT_EQ(nullptr, GetFirstVideoContent(offer->description())); EXPECT_EQ(nullptr, GetFirstVideoContent(offer->description()));
} }
// Test that if |ice_restart| is true, the ufrag/pwd will change, otherwise // Test that if `ice_restart` is true, the ufrag/pwd will change, otherwise
// ufrag/pwd will be the same in the new offer. // ufrag/pwd will be the same in the new offer.
TEST_P(PeerConnectionInterfaceTest, CreateOfferWithIceRestart) { TEST_P(PeerConnectionInterfaceTest, CreateOfferWithIceRestart) {
CreatePeerConnection(); CreatePeerConnection();
@ -3547,14 +3547,14 @@ TEST_P(PeerConnectionInterfaceTest, CreateOfferWithIceRestart) {
auto pwd1 = auto pwd1 =
offer->description()->GetTransportInfoByName(mid)->description.ice_pwd; offer->description()->GetTransportInfoByName(mid)->description.ice_pwd;
// |ice_restart| is false, the ufrag/pwd shouldn't change. // `ice_restart` is false, the ufrag/pwd shouldn't change.
CreateOfferWithOptionsAsLocalDescription(&offer, rtc_options); CreateOfferWithOptionsAsLocalDescription(&offer, rtc_options);
auto ufrag2 = auto ufrag2 =
offer->description()->GetTransportInfoByName(mid)->description.ice_ufrag; offer->description()->GetTransportInfoByName(mid)->description.ice_ufrag;
auto pwd2 = auto pwd2 =
offer->description()->GetTransportInfoByName(mid)->description.ice_pwd; offer->description()->GetTransportInfoByName(mid)->description.ice_pwd;
// |ice_restart| is true, the ufrag/pwd should change. // `ice_restart` is true, the ufrag/pwd should change.
rtc_options.ice_restart = true; rtc_options.ice_restart = true;
CreateOfferWithOptionsAsLocalDescription(&offer, rtc_options); CreateOfferWithOptionsAsLocalDescription(&offer, rtc_options);
auto ufrag3 = auto ufrag3 =
@ -3568,7 +3568,7 @@ TEST_P(PeerConnectionInterfaceTest, CreateOfferWithIceRestart) {
EXPECT_NE(pwd2, pwd3); EXPECT_NE(pwd2, pwd3);
} }
// Test that if |use_rtp_mux| is true, the bundling will be enabled in the // Test that if `use_rtp_mux` is true, the bundling will be enabled in the
// offer; if it is false, there won't be any bundle group in the offer. // offer; if it is false, there won't be any bundle group in the offer.
TEST_P(PeerConnectionInterfaceTest, CreateOfferWithRtpMux) { TEST_P(PeerConnectionInterfaceTest, CreateOfferWithRtpMux) {
RTCOfferAnswerOptions rtc_options; RTCOfferAnswerOptions rtc_options;

View file

@ -298,7 +298,7 @@ class PeerConnectionRampUpTest : public ::testing::Test {
if (ice_candidate_pair_stats.available_outgoing_bitrate.is_defined()) { if (ice_candidate_pair_stats.available_outgoing_bitrate.is_defined()) {
return *ice_candidate_pair_stats.available_outgoing_bitrate; return *ice_candidate_pair_stats.available_outgoing_bitrate;
} }
// We couldn't get the |available_outgoing_bitrate| for the active candidate // We couldn't get the `available_outgoing_bitrate` for the active candidate
// pair. // pair.
return 0; return 0;
} }
@ -307,7 +307,7 @@ class PeerConnectionRampUpTest : public ::testing::Test {
// The turn servers should be accessed & deleted on the network thread to // The turn servers should be accessed & deleted on the network thread to
// avoid a race with the socket read/write which occurs on the network thread. // avoid a race with the socket read/write which occurs on the network thread.
std::vector<std::unique_ptr<cricket::TestTurnServer>> turn_servers_; std::vector<std::unique_ptr<cricket::TestTurnServer>> turn_servers_;
// |virtual_socket_server_| is used by |network_thread_| so it must be // `virtual_socket_server_` is used by `network_thread_` so it must be
// destroyed later. // destroyed later.
// TODO(bugs.webrtc.org/7668): We would like to update the virtual network we // TODO(bugs.webrtc.org/7668): We would like to update the virtual network we
// use for this test. VirtualSocketServer isn't ideal because: // use for this test. VirtualSocketServer isn't ideal because:
@ -325,7 +325,7 @@ class PeerConnectionRampUpTest : public ::testing::Test {
std::unique_ptr<rtc::FirewallSocketServer> firewall_socket_server_; std::unique_ptr<rtc::FirewallSocketServer> firewall_socket_server_;
std::unique_ptr<rtc::Thread> network_thread_; std::unique_ptr<rtc::Thread> network_thread_;
std::unique_ptr<rtc::Thread> worker_thread_; std::unique_ptr<rtc::Thread> worker_thread_;
// The |pc_factory| uses |network_thread_| & |worker_thread_|, so it must be // The `pc_factory` uses `network_thread_` & `worker_thread_`, so it must be
// destroyed first. // destroyed first.
std::vector<std::unique_ptr<rtc::FakeNetworkManager>> fake_network_managers_; std::vector<std::unique_ptr<rtc::FakeNetworkManager>> fake_network_managers_;
rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_; rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;

View file

@ -208,7 +208,7 @@ TEST_P(PeerConnectionSignalingTest, FailToSetNullRemoteDescription) {
// methods on PeerConnection will succeed/fail depending on what is the // methods on PeerConnection will succeed/fail depending on what is the
// PeerConnection's signaling state. Note that the test tries many different // PeerConnection's signaling state. Note that the test tries many different
// forms of SignalingState::kClosed by arriving at a valid state then calling // forms of SignalingState::kClosed by arriving at a valid state then calling
// |Close()|. This is intended to catch cases where the PeerConnection signaling // `Close()`. This is intended to catch cases where the PeerConnection signaling
// method ignores the closed flag but may work/not work because of the single // method ignores the closed flag but may work/not work because of the single
// state the PeerConnection was created in before it was closed. // state the PeerConnection was created in before it was closed.

View file

@ -377,7 +377,7 @@ std::unique_ptr<RTCInboundRTPStreamStats> CreateInboundAudioStreamStats(
inbound_audio->total_audio_energy = voice_receiver_info.total_output_energy; inbound_audio->total_audio_energy = voice_receiver_info.total_output_energy;
inbound_audio->total_samples_duration = inbound_audio->total_samples_duration =
voice_receiver_info.total_output_duration; voice_receiver_info.total_output_duration;
// |fir_count|, |pli_count| and |sli_count| are only valid for video and are // `fir_count`, `pli_count` and `sli_count` are only valid for video and are
// purposefully left undefined for audio. // purposefully left undefined for audio.
if (voice_receiver_info.last_packet_received_timestamp_ms) { if (voice_receiver_info.last_packet_received_timestamp_ms) {
inbound_audio->last_packet_received_timestamp = static_cast<double>( inbound_audio->last_packet_received_timestamp = static_cast<double>(
@ -491,7 +491,7 @@ void SetInboundRTPStreamStatsFromVideoReceiverInfo(
inbound_video->estimated_playout_timestamp = static_cast<double>( inbound_video->estimated_playout_timestamp = static_cast<double>(
*video_receiver_info.estimated_playout_ntp_timestamp_ms); *video_receiver_info.estimated_playout_ntp_timestamp_ms);
} }
// TODO(bugs.webrtc.org/10529): When info's |content_info| is optional // TODO(bugs.webrtc.org/10529): When info's `content_info` is optional
// support the "unspecified" value. // support the "unspecified" value.
if (video_receiver_info.content_type == VideoContentType::SCREENSHARE) if (video_receiver_info.content_type == VideoContentType::SCREENSHARE)
inbound_video->content_type = RTCContentType::kScreenshare; inbound_video->content_type = RTCContentType::kScreenshare;
@ -532,7 +532,7 @@ void SetOutboundRTPStreamStatsFromVoiceSenderInfo(
outbound_audio->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload( outbound_audio->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload(
mid, /*inbound=*/false, *voice_sender_info.codec_payload_type); mid, /*inbound=*/false, *voice_sender_info.codec_payload_type);
} }
// |fir_count|, |pli_count| and |sli_count| are only valid for video and are // `fir_count`, `pli_count` and `sli_count` are only valid for video and are
// purposefully left undefined for audio. // purposefully left undefined for audio.
} }
@ -585,7 +585,7 @@ void SetOutboundRTPStreamStatsFromVideoSenderInfo(
video_sender_info.quality_limitation_durations_ms); video_sender_info.quality_limitation_durations_ms);
outbound_video->quality_limitation_resolution_changes = outbound_video->quality_limitation_resolution_changes =
video_sender_info.quality_limitation_resolution_changes; video_sender_info.quality_limitation_resolution_changes;
// TODO(https://crbug.com/webrtc/10529): When info's |content_info| is // TODO(https://crbug.com/webrtc/10529): When info's `content_info` is
// optional, support the "unspecified" value. // optional, support the "unspecified" value.
if (video_sender_info.content_type == VideoContentType::SCREENSHARE) if (video_sender_info.content_type == VideoContentType::SCREENSHARE)
outbound_video->content_type = RTCContentType::kScreenshare; outbound_video->content_type = RTCContentType::kScreenshare;
@ -629,7 +629,7 @@ ProduceRemoteInboundRtpStreamStatsFromReportBlockData(
std::string local_id = std::string local_id =
RTCOutboundRTPStreamStatsIDFromSSRC(media_type, report_block.source_ssrc); RTCOutboundRTPStreamStatsIDFromSSRC(media_type, report_block.source_ssrc);
// Look up local stat from |outbound_rtps| where the pointers are non-const. // Look up local stat from `outbound_rtps` where the pointers are non-const.
auto local_id_it = outbound_rtps.find(local_id); auto local_id_it = outbound_rtps.find(local_id);
if (local_id_it != outbound_rtps.end()) { if (local_id_it != outbound_rtps.end()) {
remote_inbound->local_id = local_id; remote_inbound->local_id = local_id;
@ -780,7 +780,7 @@ ProduceMediaStreamTrackStatsFromVoiceSenderInfo(
voice_sender_info.apm_statistics); voice_sender_info.apm_statistics);
auto audio_processor(audio_track.GetAudioProcessor()); auto audio_processor(audio_track.GetAudioProcessor());
if (audio_processor.get()) { if (audio_processor.get()) {
// The |has_remote_tracks| argument is obsolete; makes no difference if it's // The `has_remote_tracks` argument is obsolete; makes no difference if it's
// set to true or false. // set to true or false.
AudioProcessorInterface::AudioProcessorStatistics ap_stats = AudioProcessorInterface::AudioProcessorStatistics ap_stats =
audio_processor->GetStats(/*has_remote_tracks=*/false); audio_processor->GetStats(/*has_remote_tracks=*/false);
@ -1213,7 +1213,7 @@ void RTCStatsCollector::GetStatsReportInternal(
this, cached_report_, std::move(requests))); this, cached_report_, std::move(requests)));
} else if (!num_pending_partial_reports_) { } else if (!num_pending_partial_reports_) {
// Only start gathering stats if we're not already gathering stats. In the // Only start gathering stats if we're not already gathering stats. In the
// case of already gathering stats, |callback_| will be invoked when there // case of already gathering stats, `callback_` will be invoked when there
// are no more pending partial reports. // are no more pending partial reports.
// "Now" using a system clock, relative to the UNIX epoch (Jan 1, 1970, // "Now" using a system clock, relative to the UNIX epoch (Jan 1, 1970,
@ -1224,13 +1224,13 @@ void RTCStatsCollector::GetStatsReportInternal(
num_pending_partial_reports_ = 2; num_pending_partial_reports_ = 2;
partial_report_timestamp_us_ = cache_now_us; partial_report_timestamp_us_ = cache_now_us;
// Prepare |transceiver_stats_infos_| and |call_stats_| for use in // Prepare `transceiver_stats_infos_` and `call_stats_` for use in
// |ProducePartialResultsOnNetworkThread| and // `ProducePartialResultsOnNetworkThread` and
// |ProducePartialResultsOnSignalingThread|. // `ProducePartialResultsOnSignalingThread`.
PrepareTransceiverStatsInfosAndCallStats_s_w_n(); PrepareTransceiverStatsInfosAndCallStats_s_w_n();
// Don't touch |network_report_| on the signaling thread until // Don't touch `network_report_` on the signaling thread until
// ProducePartialResultsOnNetworkThread() has signaled the // ProducePartialResultsOnNetworkThread() has signaled the
// |network_report_event_|. // `network_report_event_`.
network_report_event_.Reset(); network_report_event_.Reset();
rtc::scoped_refptr<RTCStatsCollector> collector(this); rtc::scoped_refptr<RTCStatsCollector> collector(this);
network_thread_->PostTask( network_thread_->PostTask(
@ -1251,7 +1251,7 @@ void RTCStatsCollector::ClearCachedStatsReport() {
void RTCStatsCollector::WaitForPendingRequest() { void RTCStatsCollector::WaitForPendingRequest() {
RTC_DCHECK_RUN_ON(signaling_thread_); RTC_DCHECK_RUN_ON(signaling_thread_);
// If a request is pending, blocks until the |network_report_event_| is // If a request is pending, blocks until the `network_report_event_` is
// signaled and then delivers the result. Otherwise this is a NO-OP. // signaled and then delivers the result. Otherwise this is a NO-OP.
MergeNetworkReport_s(); MergeNetworkReport_s();
} }
@ -1295,8 +1295,8 @@ void RTCStatsCollector::ProducePartialResultsOnNetworkThread(
RTC_DCHECK_RUN_ON(network_thread_); RTC_DCHECK_RUN_ON(network_thread_);
rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls; rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls;
// Touching |network_report_| on this thread is safe by this method because // Touching `network_report_` on this thread is safe by this method because
// |network_report_event_| is reset before this method is invoked. // `network_report_event_` is reset before this method is invoked.
network_report_ = RTCStatsReport::Create(timestamp_us); network_report_ = RTCStatsReport::Create(timestamp_us);
std::set<std::string> transport_names; std::set<std::string> transport_names;
@ -1318,7 +1318,7 @@ void RTCStatsCollector::ProducePartialResultsOnNetworkThread(
timestamp_us, transport_stats_by_name, transport_cert_stats, timestamp_us, transport_stats_by_name, transport_cert_stats,
network_report_.get()); network_report_.get());
// Signal that it is now safe to touch |network_report_| on the signaling // Signal that it is now safe to touch `network_report_` on the signaling
// thread, and post a task to merge it into the final results. // thread, and post a task to merge it into the final results.
network_report_event_.Set(); network_report_event_.Set();
rtc::scoped_refptr<RTCStatsCollector> collector(this); rtc::scoped_refptr<RTCStatsCollector> collector(this);
@ -1347,16 +1347,16 @@ void RTCStatsCollector::ProducePartialResultsOnNetworkThreadImpl(
void RTCStatsCollector::MergeNetworkReport_s() { void RTCStatsCollector::MergeNetworkReport_s() {
RTC_DCHECK_RUN_ON(signaling_thread_); RTC_DCHECK_RUN_ON(signaling_thread_);
// The |network_report_event_| must be signaled for it to be safe to touch // The `network_report_event_` must be signaled for it to be safe to touch
// |network_report_|. This is normally not blocking, but if // `network_report_`. This is normally not blocking, but if
// WaitForPendingRequest() is called while a request is pending, we might have // WaitForPendingRequest() is called while a request is pending, we might have
// to wait until the network thread is done touching |network_report_|. // to wait until the network thread is done touching `network_report_`.
network_report_event_.Wait(rtc::Event::kForever); network_report_event_.Wait(rtc::Event::kForever);
if (!network_report_) { if (!network_report_) {
// Normally, MergeNetworkReport_s() is executed because it is posted from // Normally, MergeNetworkReport_s() is executed because it is posted from
// the network thread. But if WaitForPendingRequest() is called while a // the network thread. But if WaitForPendingRequest() is called while a
// request is pending, an early call to MergeNetworkReport_s() is made, // request is pending, an early call to MergeNetworkReport_s() is made,
// merging the report and setting |network_report_| to null. If so, when the // merging the report and setting `network_report_` to null. If so, when the
// previously posted MergeNetworkReport_s() is later executed, the report is // previously posted MergeNetworkReport_s() is later executed, the report is
// already null and nothing needs to be done here. // already null and nothing needs to be done here.
return; return;
@ -1366,8 +1366,8 @@ void RTCStatsCollector::MergeNetworkReport_s() {
partial_report_->TakeMembersFrom(network_report_); partial_report_->TakeMembersFrom(network_report_);
network_report_ = nullptr; network_report_ = nullptr;
--num_pending_partial_reports_; --num_pending_partial_reports_;
// |network_report_| is currently the only partial report collected // `network_report_` is currently the only partial report collected
// asynchronously, so |num_pending_partial_reports_| must now be 0 and we are // asynchronously, so `num_pending_partial_reports_` must now be 0 and we are
// ready to deliver the result. // ready to deliver the result.
RTC_DCHECK_EQ(num_pending_partial_reports_, 0); RTC_DCHECK_EQ(num_pending_partial_reports_, 0);
cache_timestamp_us_ = partial_report_timestamp_us_; cache_timestamp_us_ = partial_report_timestamp_us_;
@ -1380,7 +1380,7 @@ void RTCStatsCollector::MergeNetworkReport_s() {
TRACE_EVENT_INSTANT1("webrtc_stats", "webrtc_stats", "report", TRACE_EVENT_INSTANT1("webrtc_stats", "webrtc_stats", "report",
cached_report_->ToJson()); cached_report_->ToJson());
// Deliver report and clear |requests_|. // Deliver report and clear `requests_`.
std::vector<RequestInfo> requests; std::vector<RequestInfo> requests;
requests.swap(requests_); requests.swap(requests_);
DeliverCachedReport(cached_report_, std::move(requests)); DeliverCachedReport(cached_report_, std::move(requests));
@ -1704,7 +1704,7 @@ void RTCStatsCollector::ProduceMediaSourceStats_s(
// stream, so look in both places. // stream, so look in both places.
auto audio_processor(audio_track->GetAudioProcessor()); auto audio_processor(audio_track->GetAudioProcessor());
if (audio_processor.get()) { if (audio_processor.get()) {
// The |has_remote_tracks| argument is obsolete; makes no difference // The `has_remote_tracks` argument is obsolete; makes no difference
// if it's set to true or false. // if it's set to true or false.
AudioProcessorInterface::AudioProcessorStatistics ap_stats = AudioProcessorInterface::AudioProcessorStatistics ap_stats =
audio_processor->GetStats(/*has_remote_tracks=*/false); audio_processor->GetStats(/*has_remote_tracks=*/false);
@ -2218,7 +2218,7 @@ void RTCStatsCollector::OnDataChannelOpened(DataChannelInterface* channel) {
void RTCStatsCollector::OnDataChannelClosed(DataChannelInterface* channel) { void RTCStatsCollector::OnDataChannelClosed(DataChannelInterface* channel) {
RTC_DCHECK_RUN_ON(signaling_thread_); RTC_DCHECK_RUN_ON(signaling_thread_);
// Only channels that have been fully opened (and have increased the // Only channels that have been fully opened (and have increased the
// |data_channels_opened_| counter) increase the closed counter. // `data_channels_opened_` counter) increase the closed counter.
if (internal_record_.opened_data_channels.erase( if (internal_record_.opened_data_channels.erase(
reinterpret_cast<uintptr_t>(channel))) { reinterpret_cast<uintptr_t>(channel))) {
++internal_record_.data_channels_closed; ++internal_record_.data_channels_closed;

View file

@ -52,7 +52,7 @@ class RtpReceiverInternal;
// All public methods of the collector are to be called on the signaling thread. // All public methods of the collector are to be called on the signaling thread.
// Stats are gathered on the signaling, worker and network threads // Stats are gathered on the signaling, worker and network threads
// asynchronously. The callback is invoked on the signaling thread. Resulting // asynchronously. The callback is invoked on the signaling thread. Resulting
// reports are cached for |cache_lifetime_| ms. // reports are cached for `cache_lifetime_` ms.
class RTCStatsCollector : public rtc::RefCountInterface, class RTCStatsCollector : public rtc::RefCountInterface,
public sigslot::has_slots<> { public sigslot::has_slots<> {
public: public:
@ -62,25 +62,25 @@ class RTCStatsCollector : public rtc::RefCountInterface,
// Gets a recent stats report. If there is a report cached that is still fresh // Gets a recent stats report. If there is a report cached that is still fresh
// it is returned, otherwise new stats are gathered and returned. A report is // it is returned, otherwise new stats are gathered and returned. A report is
// considered fresh for |cache_lifetime_| ms. const RTCStatsReports are safe // considered fresh for `cache_lifetime_` ms. const RTCStatsReports are safe
// to use across multiple threads and may be destructed on any thread. // to use across multiple threads and may be destructed on any thread.
// If the optional selector argument is used, stats are filtered according to // If the optional selector argument is used, stats are filtered according to
// stats selection algorithm before delivery. // stats selection algorithm before delivery.
// https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm // https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm
void GetStatsReport(rtc::scoped_refptr<RTCStatsCollectorCallback> callback); void GetStatsReport(rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
// If |selector| is null the selection algorithm is still applied (interpreted // If `selector` is null the selection algorithm is still applied (interpreted
// as: no RTP streams are sent by selector). The result is empty. // as: no RTP streams are sent by selector). The result is empty.
void GetStatsReport(rtc::scoped_refptr<RtpSenderInternal> selector, void GetStatsReport(rtc::scoped_refptr<RtpSenderInternal> selector,
rtc::scoped_refptr<RTCStatsCollectorCallback> callback); rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
// If |selector| is null the selection algorithm is still applied (interpreted // If `selector` is null the selection algorithm is still applied (interpreted
// as: no RTP streams are received by selector). The result is empty. // as: no RTP streams are received by selector). The result is empty.
void GetStatsReport(rtc::scoped_refptr<RtpReceiverInternal> selector, void GetStatsReport(rtc::scoped_refptr<RtpReceiverInternal> selector,
rtc::scoped_refptr<RTCStatsCollectorCallback> callback); rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
// Clears the cache's reference to the most recent stats report. Subsequently // Clears the cache's reference to the most recent stats report. Subsequently
// calling |GetStatsReport| guarantees fresh stats. // calling `GetStatsReport` guarantees fresh stats.
void ClearCachedStatsReport(); void ClearCachedStatsReport();
// If there is a |GetStatsReport| requests in-flight, waits until it has been // If there is a `GetStatsReport` requests in-flight, waits until it has been
// completed. Must be called on the signaling thread. // completed. Must be called on the signaling thread.
void WaitForPendingRequest(); void WaitForPendingRequest();
@ -113,11 +113,11 @@ class RTCStatsCollector : public rtc::RefCountInterface,
explicit RequestInfo( explicit RequestInfo(
rtc::scoped_refptr<RTCStatsCollectorCallback> callback); rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
// Constructs with FilterMode::kSenderSelector. The selection algorithm is // Constructs with FilterMode::kSenderSelector. The selection algorithm is
// applied even if |selector| is null, resulting in an empty report. // applied even if `selector` is null, resulting in an empty report.
RequestInfo(rtc::scoped_refptr<RtpSenderInternal> selector, RequestInfo(rtc::scoped_refptr<RtpSenderInternal> selector,
rtc::scoped_refptr<RTCStatsCollectorCallback> callback); rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
// Constructs with FilterMode::kReceiverSelector. The selection algorithm is // Constructs with FilterMode::kReceiverSelector. The selection algorithm is
// applied even if |selector| is null, resulting in an empty report. // applied even if `selector` is null, resulting in an empty report.
RequestInfo(rtc::scoped_refptr<RtpReceiverInternal> selector, RequestInfo(rtc::scoped_refptr<RtpReceiverInternal> selector,
rtc::scoped_refptr<RTCStatsCollectorCallback> callback); rtc::scoped_refptr<RTCStatsCollectorCallback> callback);
@ -154,7 +154,7 @@ class RTCStatsCollector : public rtc::RefCountInterface,
// Some fields are copied from the RtpTransceiver/BaseChannel object so that // Some fields are copied from the RtpTransceiver/BaseChannel object so that
// they can be accessed safely on threads other than the signaling thread. // they can be accessed safely on threads other than the signaling thread.
// If a BaseChannel is not available (e.g., if signaling has not started), // If a BaseChannel is not available (e.g., if signaling has not started),
// then |mid| and |transport_name| will be null. // then `mid` and `transport_name` will be null.
struct RtpTransceiverStatsInfo { struct RtpTransceiverStatsInfo {
rtc::scoped_refptr<RtpTransceiver> transceiver; rtc::scoped_refptr<RtpTransceiver> transceiver;
cricket::MediaType media_type; cricket::MediaType media_type;
@ -167,40 +167,40 @@ class RTCStatsCollector : public rtc::RefCountInterface,
rtc::scoped_refptr<const RTCStatsReport> cached_report, rtc::scoped_refptr<const RTCStatsReport> cached_report,
std::vector<RequestInfo> requests); std::vector<RequestInfo> requests);
// Produces |RTCCertificateStats|. // Produces `RTCCertificateStats`.
void ProduceCertificateStats_n( void ProduceCertificateStats_n(
int64_t timestamp_us, int64_t timestamp_us,
const std::map<std::string, CertificateStatsPair>& transport_cert_stats, const std::map<std::string, CertificateStatsPair>& transport_cert_stats,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCCodecStats|. // Produces `RTCCodecStats`.
void ProduceCodecStats_n( void ProduceCodecStats_n(
int64_t timestamp_us, int64_t timestamp_us,
const std::vector<RtpTransceiverStatsInfo>& transceiver_stats_infos, const std::vector<RtpTransceiverStatsInfo>& transceiver_stats_infos,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCDataChannelStats|. // Produces `RTCDataChannelStats`.
void ProduceDataChannelStats_s(int64_t timestamp_us, void ProduceDataChannelStats_s(int64_t timestamp_us,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCIceCandidatePairStats| and |RTCIceCandidateStats|. // Produces `RTCIceCandidatePairStats` and `RTCIceCandidateStats`.
void ProduceIceCandidateAndPairStats_n( void ProduceIceCandidateAndPairStats_n(
int64_t timestamp_us, int64_t timestamp_us,
const std::map<std::string, cricket::TransportStats>& const std::map<std::string, cricket::TransportStats>&
transport_stats_by_name, transport_stats_by_name,
const Call::Stats& call_stats, const Call::Stats& call_stats,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCMediaStreamStats|. // Produces `RTCMediaStreamStats`.
void ProduceMediaStreamStats_s(int64_t timestamp_us, void ProduceMediaStreamStats_s(int64_t timestamp_us,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCMediaStreamTrackStats|. // Produces `RTCMediaStreamTrackStats`.
void ProduceMediaStreamTrackStats_s(int64_t timestamp_us, void ProduceMediaStreamTrackStats_s(int64_t timestamp_us,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces RTCMediaSourceStats, including RTCAudioSourceStats and // Produces RTCMediaSourceStats, including RTCAudioSourceStats and
// RTCVideoSourceStats. // RTCVideoSourceStats.
void ProduceMediaSourceStats_s(int64_t timestamp_us, void ProduceMediaSourceStats_s(int64_t timestamp_us,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCPeerConnectionStats|. // Produces `RTCPeerConnectionStats`.
void ProducePeerConnectionStats_s(int64_t timestamp_us, void ProducePeerConnectionStats_s(int64_t timestamp_us,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCInboundRTPStreamStats| and |RTCOutboundRTPStreamStats|. // Produces `RTCInboundRTPStreamStats` and `RTCOutboundRTPStreamStats`.
// This has to be invoked after codecs and transport stats have been created // This has to be invoked after codecs and transport stats have been created
// because some metrics are calculated through lookup of other metrics. // because some metrics are calculated through lookup of other metrics.
void ProduceRTPStreamStats_n( void ProduceRTPStreamStats_n(
@ -213,7 +213,7 @@ class RTCStatsCollector : public rtc::RefCountInterface,
void ProduceVideoRTPStreamStats_n(int64_t timestamp_us, void ProduceVideoRTPStreamStats_n(int64_t timestamp_us,
const RtpTransceiverStatsInfo& stats, const RtpTransceiverStatsInfo& stats,
RTCStatsReport* report) const; RTCStatsReport* report) const;
// Produces |RTCTransportStats|. // Produces `RTCTransportStats`.
void ProduceTransportStats_n( void ProduceTransportStats_n(
int64_t timestamp_us, int64_t timestamp_us,
const std::map<std::string, cricket::TransportStats>& const std::map<std::string, cricket::TransportStats>&
@ -226,7 +226,7 @@ class RTCStatsCollector : public rtc::RefCountInterface,
PrepareTransportCertificateStats_n( PrepareTransportCertificateStats_n(
const std::map<std::string, cricket::TransportStats>& const std::map<std::string, cricket::TransportStats>&
transport_stats_by_name) const; transport_stats_by_name) const;
// The results are stored in |transceiver_stats_infos_| and |call_stats_|. // The results are stored in `transceiver_stats_infos_` and `call_stats_`.
void PrepareTransceiverStatsInfosAndCallStats_s_w_n(); void PrepareTransceiverStatsInfosAndCallStats_s_w_n();
// Stats gathering on a particular thread. // Stats gathering on a particular thread.
@ -234,13 +234,13 @@ class RTCStatsCollector : public rtc::RefCountInterface,
void ProducePartialResultsOnNetworkThread( void ProducePartialResultsOnNetworkThread(
int64_t timestamp_us, int64_t timestamp_us,
absl::optional<std::string> sctp_transport_name); absl::optional<std::string> sctp_transport_name);
// Merges |network_report_| into |partial_report_| and completes the request. // Merges `network_report_` into `partial_report_` and completes the request.
// This is a NO-OP if |network_report_| is null. // This is a NO-OP if `network_report_` is null.
void MergeNetworkReport_s(); void MergeNetworkReport_s();
// Slots for signals (sigslot) that are wired up to |pc_|. // Slots for signals (sigslot) that are wired up to `pc_`.
void OnSctpDataChannelCreated(SctpDataChannel* channel); void OnSctpDataChannelCreated(SctpDataChannel* channel);
// Slots for signals (sigslot) that are wired up to |channel|. // Slots for signals (sigslot) that are wired up to `channel`.
void OnDataChannelOpened(DataChannelInterface* channel); void OnDataChannelOpened(DataChannelInterface* channel);
void OnDataChannelClosed(DataChannelInterface* channel); void OnDataChannelClosed(DataChannelInterface* channel);
@ -257,14 +257,14 @@ class RTCStatsCollector : public rtc::RefCountInterface,
rtc::scoped_refptr<RTCStatsReport> partial_report_; rtc::scoped_refptr<RTCStatsReport> partial_report_;
std::vector<RequestInfo> requests_; std::vector<RequestInfo> requests_;
// Holds the result of ProducePartialResultsOnNetworkThread(). It is merged // Holds the result of ProducePartialResultsOnNetworkThread(). It is merged
// into |partial_report_| on the signaling thread and then nulled by // into `partial_report_` on the signaling thread and then nulled by
// MergeNetworkReport_s(). Thread-safety is ensured by using // MergeNetworkReport_s(). Thread-safety is ensured by using
// |network_report_event_|. // `network_report_event_`.
rtc::scoped_refptr<RTCStatsReport> network_report_; rtc::scoped_refptr<RTCStatsReport> network_report_;
// If set, it is safe to touch the |network_report_| on the signaling thread. // If set, it is safe to touch the `network_report_` on the signaling thread.
// This is reset before async-invoking ProducePartialResultsOnNetworkThread() // This is reset before async-invoking ProducePartialResultsOnNetworkThread()
// and set when ProducePartialResultsOnNetworkThread() is complete, after it // and set when ProducePartialResultsOnNetworkThread() is complete, after it
// has updated the value of |network_report_|. // has updated the value of `network_report_`.
rtc::Event network_report_event_; rtc::Event network_report_event_;
// Cleared and set in `PrepareTransceiverStatsInfosAndCallStats_s_w_n`, // Cleared and set in `PrepareTransceiverStatsInfosAndCallStats_s_w_n`,

View file

@ -55,7 +55,7 @@ using ::testing::Return;
namespace webrtc { namespace webrtc {
// These are used by gtest code, such as if |EXPECT_EQ| fails. // These are used by gtest code, such as if `EXPECT_EQ` fails.
void PrintTo(const RTCCertificateStats& stats, ::std::ostream* os) { void PrintTo(const RTCCertificateStats& stats, ::std::ostream* os) {
*os << stats.ToJson(); *os << stats.ToJson();
} }
@ -916,7 +916,7 @@ TEST_F(RTCStatsCollectorTest, MultipleCallbacks) {
} }
TEST_F(RTCStatsCollectorTest, CachedStatsReports) { TEST_F(RTCStatsCollectorTest, CachedStatsReports) {
// Caching should ensure |a| and |b| are the same report. // Caching should ensure `a` and `b` are the same report.
rtc::scoped_refptr<const RTCStatsReport> a = stats_->GetStatsReport(); rtc::scoped_refptr<const RTCStatsReport> a = stats_->GetStatsReport();
rtc::scoped_refptr<const RTCStatsReport> b = stats_->GetStatsReport(); rtc::scoped_refptr<const RTCStatsReport> b = stats_->GetStatsReport();
EXPECT_EQ(a.get(), b.get()); EXPECT_EQ(a.get(), b.get());
@ -942,8 +942,8 @@ TEST_F(RTCStatsCollectorTest, MultipleCallbacksWithInvalidatedCacheInBetween) {
EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs); EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs);
EXPECT_TRUE_WAIT(c, kGetStatsReportTimeoutMs); EXPECT_TRUE_WAIT(c, kGetStatsReportTimeoutMs);
EXPECT_EQ(a.get(), b.get()); EXPECT_EQ(a.get(), b.get());
// The act of doing |AdvanceTime| processes all messages. If this was not the // The act of doing `AdvanceTime` processes all messages. If this was not the
// case we might not require |c| to be fresher than |b|. // case we might not require `c` to be fresher than `b`.
EXPECT_NE(c.get(), b.get()); EXPECT_NE(c.get(), b.get());
} }
@ -2807,7 +2807,7 @@ class RTCStatsCollectorTestWithParamKind
} }
// Adds a sender and channel of the appropriate kind, creating a sender info // Adds a sender and channel of the appropriate kind, creating a sender info
// with the report block's |source_ssrc| and report block data. // with the report block's `source_ssrc` and report block data.
void AddSenderInfoAndMediaChannel( void AddSenderInfoAndMediaChannel(
std::string transport_name, std::string transport_name,
const std::vector<ReportBlockData>& report_block_datas, const std::vector<ReportBlockData>& report_block_datas,
@ -2881,7 +2881,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
for (auto ssrc : ssrcs) { for (auto ssrc : ssrcs) {
RTCPReportBlock report_block; RTCPReportBlock report_block;
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the // The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
// |source_ssrc|, "SSRC of the RTP packet sender". // `source_ssrc`, "SSRC of the RTP packet sender".
report_block.source_ssrc = ssrc; report_block.source_ssrc = ssrc;
report_block.packets_lost = 7; report_block.packets_lost = 7;
report_block.fraction_lost = kFractionLost; report_block.fraction_lost = kFractionLost;
@ -2916,7 +2916,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
expected_remote_inbound_rtp.total_round_trip_time = expected_remote_inbound_rtp.total_round_trip_time =
kRoundTripTimeSample1Seconds + kRoundTripTimeSample2Seconds; kRoundTripTimeSample1Seconds + kRoundTripTimeSample2Seconds;
expected_remote_inbound_rtp.round_trip_time_measurements = 2; expected_remote_inbound_rtp.round_trip_time_measurements = 2;
// This test does not set up RTCCodecStats, so |codec_id| and |jitter| are // This test does not set up RTCCodecStats, so `codec_id` and `jitter` are
// expected to be missing. These are tested separately. // expected to be missing. These are tested separately.
ASSERT_TRUE(report->Get(expected_remote_inbound_rtp.id())); ASSERT_TRUE(report->Get(expected_remote_inbound_rtp.id()));
@ -2940,7 +2940,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
RTCPReportBlock report_block; RTCPReportBlock report_block;
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the // The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
// |source_ssrc|, "SSRC of the RTP packet sender". // `source_ssrc`, "SSRC of the RTP packet sender".
report_block.source_ssrc = 12; report_block.source_ssrc = 12;
ReportBlockData report_block_data; ReportBlockData report_block_data;
report_block_data.SetReportBlock(report_block, kReportBlockTimestampUtcUs); report_block_data.SetReportBlock(report_block, kReportBlockTimestampUtcUs);
@ -2972,7 +2972,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
RTCPReportBlock report_block; RTCPReportBlock report_block;
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the // The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
// |source_ssrc|, "SSRC of the RTP packet sender". // `source_ssrc`, "SSRC of the RTP packet sender".
report_block.source_ssrc = 12; report_block.source_ssrc = 12;
report_block.jitter = 5000; report_block.jitter = 5000;
ReportBlockData report_block_data; ReportBlockData report_block_data;
@ -3009,7 +3009,7 @@ TEST_P(RTCStatsCollectorTestWithParamKind,
RTCPReportBlock report_block; RTCPReportBlock report_block;
// The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the // The remote-inbound-rtp SSRC and the outbound-rtp SSRC is the same as the
// |source_ssrc|, "SSRC of the RTP packet sender". // `source_ssrc`, "SSRC of the RTP packet sender".
report_block.source_ssrc = 12; report_block.source_ssrc = 12;
ReportBlockData report_block_data; ReportBlockData report_block_data;
report_block_data.SetReportBlock(report_block, kReportBlockTimestampUtcUs); report_block_data.SetReportBlock(report_block, kReportBlockTimestampUtcUs);

View file

@ -192,7 +192,7 @@ class RTCStatsIntegrationTest : public ::testing::Test {
return stats_obtainer->report(); return stats_obtainer->report();
} }
// |network_thread_| uses |virtual_socket_server_| so they must be // `network_thread_` uses `virtual_socket_server_` so they must be
// constructed/destructed in the correct order. // constructed/destructed in the correct order.
rtc::VirtualSocketServer virtual_socket_server_; rtc::VirtualSocketServer virtual_socket_server_;
std::unique_ptr<rtc::Thread> network_thread_; std::unique_ptr<rtc::Thread> network_thread_;
@ -405,13 +405,13 @@ class RTCStatsReportVerifier {
} else if (stats.type() == RTCAudioSourceStats::kType) { } else if (stats.type() == RTCAudioSourceStats::kType) {
// RTCAudioSourceStats::kType and RTCVideoSourceStats::kType both have // RTCAudioSourceStats::kType and RTCVideoSourceStats::kType both have
// the value "media-source", but they are distinguishable with pointer // the value "media-source", but they are distinguishable with pointer
// equality (==). In JavaScript they would be distinguished with |kind|. // equality (==). In JavaScript they would be distinguished with `kind`.
verify_successful &= verify_successful &=
VerifyRTCAudioSourceStats(stats.cast_to<RTCAudioSourceStats>()); VerifyRTCAudioSourceStats(stats.cast_to<RTCAudioSourceStats>());
} else if (stats.type() == RTCVideoSourceStats::kType) { } else if (stats.type() == RTCVideoSourceStats::kType) {
// RTCAudioSourceStats::kType and RTCVideoSourceStats::kType both have // RTCAudioSourceStats::kType and RTCVideoSourceStats::kType both have
// the value "media-source", but they are distinguishable with pointer // the value "media-source", but they are distinguishable with pointer
// equality (==). In JavaScript they would be distinguished with |kind|. // equality (==). In JavaScript they would be distinguished with `kind`.
verify_successful &= verify_successful &=
VerifyRTCVideoSourceStats(stats.cast_to<RTCVideoSourceStats>()); VerifyRTCVideoSourceStats(stats.cast_to<RTCVideoSourceStats>());
} else if (stats.type() == RTCTransportStats::kType) { } else if (stats.type() == RTCTransportStats::kType) {
@ -749,7 +749,7 @@ class RTCStatsReportVerifier {
verifier.TestMemberIsUndefined( verifier.TestMemberIsUndefined(
media_stream_track.sum_squared_frame_durations); media_stream_track.sum_squared_frame_durations);
// Audio-only members // Audio-only members
// TODO(hbos): |echo_return_loss| and |echo_return_loss_enhancement| are // TODO(hbos): `echo_return_loss` and `echo_return_loss_enhancement` are
// flaky on msan bot (sometimes defined, sometimes undefined). Should the // flaky on msan bot (sometimes defined, sometimes undefined). Should the
// test run until available or is there a way to have it always be // test run until available or is there a way to have it always be
// defined? crbug.com/627816 // defined? crbug.com/627816
@ -1086,7 +1086,7 @@ class RTCStatsReportVerifier {
verifier.TestMemberIsNonNegative<double>(audio_source.audio_level); verifier.TestMemberIsNonNegative<double>(audio_source.audio_level);
verifier.TestMemberIsPositive<double>(audio_source.total_audio_energy); verifier.TestMemberIsPositive<double>(audio_source.total_audio_energy);
verifier.TestMemberIsPositive<double>(audio_source.total_samples_duration); verifier.TestMemberIsPositive<double>(audio_source.total_samples_duration);
// TODO(hbos): |echo_return_loss| and |echo_return_loss_enhancement| are // TODO(hbos): `echo_return_loss` and `echo_return_loss_enhancement` are
// flaky on msan bot (sometimes defined, sometimes undefined). Should the // flaky on msan bot (sometimes defined, sometimes undefined). Should the
// test run until available or is there a way to have it always be // test run until available or is there a way to have it always be
// defined? crbug.com/627816 // defined? crbug.com/627816
@ -1100,7 +1100,7 @@ class RTCStatsReportVerifier {
VerifyRTCMediaSourceStats(video_source, &verifier); VerifyRTCMediaSourceStats(video_source, &verifier);
// TODO(hbos): This integration test uses fakes that doesn't support // TODO(hbos): This integration test uses fakes that doesn't support
// VideoTrackSourceInterface::Stats. When this is fixed we should // VideoTrackSourceInterface::Stats. When this is fixed we should
// TestMemberIsNonNegative<uint32_t>() for |width| and |height| instead to // TestMemberIsNonNegative<uint32_t>() for `width` and `height` instead to
// reflect real code. // reflect real code.
verifier.TestMemberIsUndefined(video_source.width); verifier.TestMemberIsUndefined(video_source.width);
verifier.TestMemberIsUndefined(video_source.height); verifier.TestMemberIsUndefined(video_source.height);

View file

@ -25,8 +25,8 @@ namespace {
void TraverseAndTakeVisitedStats(RTCStatsReport* report, void TraverseAndTakeVisitedStats(RTCStatsReport* report,
RTCStatsReport* visited_report, RTCStatsReport* visited_report,
const std::string& current_id) { const std::string& current_id) {
// Mark current stats object as visited by moving it |report| to // Mark current stats object as visited by moving it `report` to
// |visited_report|. // `visited_report`.
std::unique_ptr<const RTCStats> current = report->Take(current_id); std::unique_ptr<const RTCStats> current = report->Take(current_id);
if (!current) { if (!current) {
// This node has already been visited (or it is an invalid id). // This node has already been visited (or it is an invalid id).

View file

@ -22,16 +22,16 @@ namespace webrtc {
// Traverses the stats graph, taking all stats objects that are directly or // Traverses the stats graph, taking all stats objects that are directly or
// indirectly accessible from and including the stats objects identified by // indirectly accessible from and including the stats objects identified by
// |ids|, returning them as a new stats report. // `ids`, returning them as a new stats report.
// This is meant to be used to implement the stats selection algorithm. // This is meant to be used to implement the stats selection algorithm.
// https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm // https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm
rtc::scoped_refptr<RTCStatsReport> TakeReferencedStats( rtc::scoped_refptr<RTCStatsReport> TakeReferencedStats(
rtc::scoped_refptr<RTCStatsReport> report, rtc::scoped_refptr<RTCStatsReport> report,
const std::vector<std::string>& ids); const std::vector<std::string>& ids);
// Gets pointers to the string values of any members in |stats| that are used as // Gets pointers to the string values of any members in `stats` that are used as
// references for looking up other stats objects in the same report by ID. The // references for looking up other stats objects in the same report by ID. The
// pointers are valid for the lifetime of |stats| assumings its members are not // pointers are valid for the lifetime of `stats` assumings its members are not
// modified. // modified.
// //
// For example, RTCCodecStats contains "transportId" // For example, RTCCodecStats contains "transportId"

View file

@ -32,12 +32,12 @@ bool RtpTransceiverDirectionHasRecv(RtpTransceiverDirection direction);
RtpTransceiverDirection RtpTransceiverDirectionReversed( RtpTransceiverDirection RtpTransceiverDirectionReversed(
RtpTransceiverDirection direction); RtpTransceiverDirection direction);
// Returns the RtpTransceiverDirection with its send component set to |send|. // Returns the RtpTransceiverDirection with its send component set to `send`.
RtpTransceiverDirection RtpTransceiverDirectionWithSendSet( RtpTransceiverDirection RtpTransceiverDirectionWithSendSet(
RtpTransceiverDirection direction, RtpTransceiverDirection direction,
bool send = true); bool send = true);
// Returns the RtpTransceiverDirection with its recv component set to |recv|. // Returns the RtpTransceiverDirection with its recv component set to `recv`.
RtpTransceiverDirection RtpTransceiverDirectionWithRecvSet( RtpTransceiverDirection RtpTransceiverDirectionWithRecvSet(
RtpTransceiverDirection direction, RtpTransceiverDirection direction,
bool recv = true); bool recv = true);

View file

@ -75,7 +75,7 @@ RTCErrorOr<cricket::StreamParamsVec> ToCricketStreamParamsVec(
// functionality is not yet implemented. // functionality is not yet implemented.
//***************************************************************************** //*****************************************************************************
// Returns empty value if |cricket_feedback| is a feedback type not // Returns empty value if `cricket_feedback` is a feedback type not
// supported/recognized. // supported/recognized.
absl::optional<RtcpFeedback> ToRtcpFeedback( absl::optional<RtcpFeedback> ToRtcpFeedback(
const cricket::FeedbackParam& cricket_feedback); const cricket::FeedbackParam& cricket_feedback);

View file

@ -642,7 +642,7 @@ void VideoRtpSender::ClearSend() {
RTC_LOG(LS_WARNING) << "SetVideoSend: No video channel exists."; RTC_LOG(LS_WARNING) << "SetVideoSend: No video channel exists.";
return; return;
} }
// Allow SetVideoSend to fail since |enable| is false and |source| is null. // Allow SetVideoSend to fail since `enable` is false and `source` is null.
// This the normal case when the underlying media channel has already been // This the normal case when the underlying media channel has already been
// deleted. // deleted.
worker_thread_->Invoke<bool>(RTC_FROM_HERE, [&] { worker_thread_->Invoke<bool>(RTC_FROM_HERE, [&] {

View file

@ -56,7 +56,7 @@ class RtpSenderInternal : public RtpSenderInterface {
virtual void SetMediaChannel(cricket::MediaChannel* media_channel) = 0; virtual void SetMediaChannel(cricket::MediaChannel* media_channel) = 0;
// Used to set the SSRC of the sender, once a local description has been set. // Used to set the SSRC of the sender, once a local description has been set.
// If |ssrc| is 0, this indiates that the sender should disconnect from the // If `ssrc` is 0, this indiates that the sender should disconnect from the
// underlying transport (this occurs if the sender isn't seen in a local // underlying transport (this occurs if the sender isn't seen in a local
// description). // description).
virtual void SetSsrc(uint32_t ssrc) = 0; virtual void SetSsrc(uint32_t ssrc) = 0;
@ -69,7 +69,7 @@ class RtpSenderInternal : public RtpSenderInterface {
virtual void Stop() = 0; virtual void Stop() = 0;
// |GetParameters| and |SetParameters| operate with a transactional model. // `GetParameters` and `SetParameters` operate with a transactional model.
// Allow access to get/set parameters without invalidating transaction id. // Allow access to get/set parameters without invalidating transaction id.
virtual RtpParameters GetParametersInternal() const = 0; virtual RtpParameters GetParametersInternal() const = 0;
virtual RTCError SetParametersInternal(const RtpParameters& parameters) = 0; virtual RTCError SetParametersInternal(const RtpParameters& parameters) = 0;
@ -110,13 +110,13 @@ class RtpSenderBase : public RtpSenderInternal, public ObserverInterface {
RtpParameters GetParameters() const override; RtpParameters GetParameters() const override;
RTCError SetParameters(const RtpParameters& parameters) override; RTCError SetParameters(const RtpParameters& parameters) override;
// |GetParameters| and |SetParameters| operate with a transactional model. // `GetParameters` and `SetParameters` operate with a transactional model.
// Allow access to get/set parameters without invalidating transaction id. // Allow access to get/set parameters without invalidating transaction id.
RtpParameters GetParametersInternal() const override; RtpParameters GetParametersInternal() const override;
RTCError SetParametersInternal(const RtpParameters& parameters) override; RTCError SetParametersInternal(const RtpParameters& parameters) override;
// Used to set the SSRC of the sender, once a local description has been set. // Used to set the SSRC of the sender, once a local description has been set.
// If |ssrc| is 0, this indiates that the sender should disconnect from the // If `ssrc` is 0, this indiates that the sender should disconnect from the
// underlying transport (this occurs if the sender isn't seen in a local // underlying transport (this occurs if the sender isn't seen in a local
// description). // description).
void SetSsrc(uint32_t ssrc) override; void SetSsrc(uint32_t ssrc) override;
@ -171,8 +171,8 @@ class RtpSenderBase : public RtpSenderInternal, public ObserverInterface {
void SetTransceiverAsStopped() override { is_transceiver_stopped_ = true; } void SetTransceiverAsStopped() override { is_transceiver_stopped_ = true; }
protected: protected:
// If |set_streams_observer| is not null, it is invoked when SetStreams() // If `set_streams_observer` is not null, it is invoked when SetStreams()
// is called. |set_streams_observer| is not owned by this object. If not // is called. `set_streams_observer` is not owned by this object. If not
// null, it must be valid at least until this sender becomes stopped. // null, it must be valid at least until this sender becomes stopped.
RtpSenderBase(rtc::Thread* worker_thread, RtpSenderBase(rtc::Thread* worker_thread,
const std::string& id, const std::string& id,
@ -210,10 +210,10 @@ class RtpSenderBase : public RtpSenderInternal, public ObserverInterface {
rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_; rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_;
rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor_; rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor_;
// |last_transaction_id_| is used to verify that |SetParameters| is receiving // `last_transaction_id_` is used to verify that `SetParameters` is receiving
// the parameters object that was last returned from |GetParameters|. // the parameters object that was last returned from `GetParameters`.
// As such, it is used for internal verification and is not observable by the // As such, it is used for internal verification and is not observable by the
// the client. It is marked as mutable to enable |GetParameters| to be a // the client. It is marked as mutable to enable `GetParameters` to be a
// const method. // const method.
mutable absl::optional<std::string> last_transaction_id_; mutable absl::optional<std::string> last_transaction_id_;
std::vector<std::string> disabled_rids_; std::vector<std::string> disabled_rids_;
@ -258,7 +258,7 @@ class LocalAudioSinkAdapter : public AudioTrackSinkInterface,
void SetSink(cricket::AudioSource::Sink* sink) override; void SetSink(cricket::AudioSource::Sink* sink) override;
cricket::AudioSource::Sink* sink_; cricket::AudioSource::Sink* sink_;
// Critical section protecting |sink_|. // Critical section protecting `sink_`.
Mutex lock_; Mutex lock_;
int num_preferred_channels_ = -1; int num_preferred_channels_ = -1;
}; };
@ -269,8 +269,8 @@ class AudioRtpSender : public DtmfProviderInterface, public RtpSenderBase {
// The sender is initialized with no track to send and no associated streams. // The sender is initialized with no track to send and no associated streams.
// StatsCollector provided so that Add/RemoveLocalAudioTrack can be called // StatsCollector provided so that Add/RemoveLocalAudioTrack can be called
// at the appropriate times. // at the appropriate times.
// If |set_streams_observer| is not null, it is invoked when SetStreams() // If `set_streams_observer` is not null, it is invoked when SetStreams()
// is called. |set_streams_observer| is not owned by this object. If not // is called. `set_streams_observer` is not owned by this object. If not
// null, it must be valid at least until this sender becomes stopped. // null, it must be valid at least until this sender becomes stopped.
static rtc::scoped_refptr<AudioRtpSender> Create( static rtc::scoped_refptr<AudioRtpSender> Create(
rtc::Thread* worker_thread, rtc::Thread* worker_thread,
@ -325,7 +325,7 @@ class AudioRtpSender : public DtmfProviderInterface, public RtpSenderBase {
rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender_proxy_; rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender_proxy_;
bool cached_track_enabled_ = false; bool cached_track_enabled_ = false;
// Used to pass the data callback from the |track_| to the other end of // Used to pass the data callback from the `track_` to the other end of
// cricket::AudioSource. // cricket::AudioSource.
std::unique_ptr<LocalAudioSinkAdapter> sink_adapter_; std::unique_ptr<LocalAudioSinkAdapter> sink_adapter_;
}; };
@ -334,8 +334,8 @@ class VideoRtpSender : public RtpSenderBase {
public: public:
// Construct an RtpSender for video with the given sender ID. // Construct an RtpSender for video with the given sender ID.
// The sender is initialized with no track to send and no associated streams. // The sender is initialized with no track to send and no associated streams.
// If |set_streams_observer| is not null, it is invoked when SetStreams() // If `set_streams_observer` is not null, it is invoked when SetStreams()
// is called. |set_streams_observer| is not owned by this object. If not // is called. `set_streams_observer` is not owned by this object. If not
// null, it must be valid at least until this sender becomes stopped. // null, it must be valid at least until this sender becomes stopped.
static rtc::scoped_refptr<VideoRtpSender> Create( static rtc::scoped_refptr<VideoRtpSender> Create(
rtc::Thread* worker_thread, rtc::Thread* worker_thread,

View file

@ -494,7 +494,7 @@ class RtpSenderReceiverTest
} }
// Check that minimum Jitter Buffer delay is propagated to the underlying // Check that minimum Jitter Buffer delay is propagated to the underlying
// |media_channel|. // `media_channel`.
void VerifyRtpReceiverDelayBehaviour(cricket::Delayable* media_channel, void VerifyRtpReceiverDelayBehaviour(cricket::Delayable* media_channel,
RtpReceiverInterface* receiver, RtpReceiverInterface* receiver,
uint32_t ssrc) { uint32_t ssrc) {
@ -509,13 +509,13 @@ class RtpSenderReceiverTest
rtc::Thread* const network_thread_; rtc::Thread* const network_thread_;
rtc::Thread* const worker_thread_; rtc::Thread* const worker_thread_;
webrtc::RtcEventLogNull event_log_; webrtc::RtcEventLogNull event_log_;
// The |rtp_dtls_transport_| and |rtp_transport_| should be destroyed after // The `rtp_dtls_transport_` and `rtp_transport_` should be destroyed after
// the |channel_manager|. // the `channel_manager`.
std::unique_ptr<cricket::DtlsTransportInternal> rtp_dtls_transport_; std::unique_ptr<cricket::DtlsTransportInternal> rtp_dtls_transport_;
std::unique_ptr<webrtc::RtpTransportInternal> rtp_transport_; std::unique_ptr<webrtc::RtpTransportInternal> rtp_transport_;
std::unique_ptr<webrtc::VideoBitrateAllocatorFactory> std::unique_ptr<webrtc::VideoBitrateAllocatorFactory>
video_bitrate_allocator_factory_; video_bitrate_allocator_factory_;
// |media_engine_| is actually owned by |channel_manager_|. // `media_engine_` is actually owned by `channel_manager_`.
cricket::FakeMediaEngine* media_engine_; cricket::FakeMediaEngine* media_engine_;
std::unique_ptr<cricket::ChannelManager> channel_manager_; std::unique_ptr<cricket::ChannelManager> channel_manager_;
cricket::FakeCall fake_call_; cricket::FakeCall fake_call_;
@ -534,28 +534,28 @@ class RtpSenderReceiverTest
rtc::UniqueRandomIdGenerator ssrc_generator_; rtc::UniqueRandomIdGenerator ssrc_generator_;
}; };
// Test that |voice_channel_| is updated when an audio track is associated // Test that `voice_channel_` is updated when an audio track is associated
// and disassociated with an AudioRtpSender. // and disassociated with an AudioRtpSender.
TEST_F(RtpSenderReceiverTest, AddAndDestroyAudioRtpSender) { TEST_F(RtpSenderReceiverTest, AddAndDestroyAudioRtpSender) {
CreateAudioRtpSender(); CreateAudioRtpSender();
DestroyAudioRtpSender(); DestroyAudioRtpSender();
} }
// Test that |video_channel_| is updated when a video track is associated and // Test that `video_channel_` is updated when a video track is associated and
// disassociated with a VideoRtpSender. // disassociated with a VideoRtpSender.
TEST_F(RtpSenderReceiverTest, AddAndDestroyVideoRtpSender) { TEST_F(RtpSenderReceiverTest, AddAndDestroyVideoRtpSender) {
CreateVideoRtpSender(); CreateVideoRtpSender();
DestroyVideoRtpSender(); DestroyVideoRtpSender();
} }
// Test that |voice_channel_| is updated when a remote audio track is // Test that `voice_channel_` is updated when a remote audio track is
// associated and disassociated with an AudioRtpReceiver. // associated and disassociated with an AudioRtpReceiver.
TEST_F(RtpSenderReceiverTest, AddAndDestroyAudioRtpReceiver) { TEST_F(RtpSenderReceiverTest, AddAndDestroyAudioRtpReceiver) {
CreateAudioRtpReceiver(); CreateAudioRtpReceiver();
DestroyAudioRtpReceiver(); DestroyAudioRtpReceiver();
} }
// Test that |video_channel_| is updated when a remote video track is // Test that `video_channel_` is updated when a remote video track is
// associated and disassociated with a VideoRtpReceiver. // associated and disassociated with a VideoRtpReceiver.
TEST_F(RtpSenderReceiverTest, AddAndDestroyVideoRtpReceiver) { TEST_F(RtpSenderReceiverTest, AddAndDestroyVideoRtpReceiver) {
CreateVideoRtpReceiver(); CreateVideoRtpReceiver();
@ -1423,7 +1423,7 @@ TEST_F(RtpSenderReceiverTest, PropagatesVideoTrackContentHint) {
video_track_->set_enabled(true); video_track_->set_enabled(true);
// |video_track_| is not screencast by default. // `video_track_` is not screencast by default.
EXPECT_EQ(false, video_media_channel_->options().is_screencast); EXPECT_EQ(false, video_media_channel_->options().is_screencast);
// No content hint should be set by default. // No content hint should be set by default.
EXPECT_EQ(VideoTrackInterface::ContentHint::kNone, EXPECT_EQ(VideoTrackInterface::ContentHint::kNone,
@ -1453,7 +1453,7 @@ TEST_F(RtpSenderReceiverTest,
video_track_->set_enabled(true); video_track_->set_enabled(true);
// |video_track_| with a screencast source should be screencast by default. // `video_track_` with a screencast source should be screencast by default.
EXPECT_EQ(true, video_media_channel_->options().is_screencast); EXPECT_EQ(true, video_media_channel_->options().is_screencast);
// No content hint should be set by default. // No content hint should be set by default.
EXPECT_EQ(VideoTrackInterface::ContentHint::kNone, EXPECT_EQ(VideoTrackInterface::ContentHint::kNone,
@ -1518,8 +1518,8 @@ TEST_F(RtpSenderReceiverTest, VideoSenderDoesNotHaveDtmfSender) {
EXPECT_EQ(nullptr, video_rtp_sender_->GetDtmfSender()); EXPECT_EQ(nullptr, video_rtp_sender_->GetDtmfSender());
} }
// Test that the DTMF sender is really using |voice_channel_|, and thus returns // Test that the DTMF sender is really using `voice_channel_`, and thus returns
// true/false from CanSendDtmf based on what |voice_channel_| returns. // true/false from CanSendDtmf based on what `voice_channel_` returns.
TEST_F(RtpSenderReceiverTest, CanInsertDtmf) { TEST_F(RtpSenderReceiverTest, CanInsertDtmf) {
AddDtmfCodec(); AddDtmfCodec();
CreateAudioRtpSender(); CreateAudioRtpSender();

View file

@ -77,14 +77,14 @@ class RtpTransceiver final
public: public:
// Construct a Plan B-style RtpTransceiver with no senders, receivers, or // Construct a Plan B-style RtpTransceiver with no senders, receivers, or
// channel set. // channel set.
// |media_type| specifies the type of RtpTransceiver (and, by transitivity, // `media_type` specifies the type of RtpTransceiver (and, by transitivity,
// the type of senders, receivers, and channel). Can either by audio or video. // the type of senders, receivers, and channel). Can either by audio or video.
RtpTransceiver(cricket::MediaType media_type, RtpTransceiver(cricket::MediaType media_type,
cricket::ChannelManager* channel_manager); cricket::ChannelManager* channel_manager);
// Construct a Unified Plan-style RtpTransceiver with the given sender and // Construct a Unified Plan-style RtpTransceiver with the given sender and
// receiver. The media type will be derived from the media types of the sender // receiver. The media type will be derived from the media types of the sender
// and receiver. The sender and receiver should have the same media type. // and receiver. The sender and receiver should have the same media type.
// |HeaderExtensionsToOffer| is used for initializing the return value of // `HeaderExtensionsToOffer` is used for initializing the return value of
// HeaderExtensionsToOffer(). // HeaderExtensionsToOffer().
RtpTransceiver( RtpTransceiver(
rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender, rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender,
@ -275,7 +275,7 @@ class RtpTransceiver final
std::vector<RtpCodecCapability> codec_preferences_; std::vector<RtpCodecCapability> codec_preferences_;
std::vector<RtpHeaderExtensionCapability> header_extensions_to_offer_; std::vector<RtpHeaderExtensionCapability> header_extensions_to_offer_;
// |negotiated_header_extensions_| is read and written to on the signaling // `negotiated_header_extensions_` is read and written to on the signaling
// thread from the SdpOfferAnswerHandler class (e.g. // thread from the SdpOfferAnswerHandler class (e.g.
// PushdownMediaDescription(). // PushdownMediaDescription().
cricket::RtpHeaderExtensions negotiated_header_extensions_ cricket::RtpHeaderExtensions negotiated_header_extensions_

View file

@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * be found in the AUTHORS file in the root of the source tree.
*/ */
// This file contains tests for |RtpTransceiver|. // This file contains tests for `RtpTransceiver`.
#include "pc/rtp_transceiver.h" #include "pc/rtp_transceiver.h"
@ -32,7 +32,7 @@ using ::testing::ReturnRef;
namespace webrtc { namespace webrtc {
// Checks that a channel cannot be set on a stopped |RtpTransceiver|. // Checks that a channel cannot be set on a stopped `RtpTransceiver`.
TEST(RtpTransceiverTest, CannotSetChannelOnStoppedTransceiver) { TEST(RtpTransceiverTest, CannotSetChannelOnStoppedTransceiver) {
auto cm = cricket::ChannelManager::Create( auto cm = cricket::ChannelManager::Create(
nullptr, true, rtc::Thread::Current(), rtc::Thread::Current()); nullptr, true, rtc::Thread::Current(), rtc::Thread::Current());
@ -58,7 +58,7 @@ TEST(RtpTransceiverTest, CannotSetChannelOnStoppedTransceiver) {
EXPECT_EQ(&channel1, transceiver.channel()); EXPECT_EQ(&channel1, transceiver.channel());
} }
// Checks that a channel can be unset on a stopped |RtpTransceiver| // Checks that a channel can be unset on a stopped `RtpTransceiver`
TEST(RtpTransceiverTest, CanUnsetChannelOnStoppedTransceiver) { TEST(RtpTransceiverTest, CanUnsetChannelOnStoppedTransceiver) {
auto cm = cricket::ChannelManager::Create( auto cm = cricket::ChannelManager::Create(
nullptr, true, rtc::Thread::Current(), rtc::Thread::Current()); nullptr, true, rtc::Thread::Current(), rtc::Thread::Current());
@ -76,7 +76,7 @@ TEST(RtpTransceiverTest, CanUnsetChannelOnStoppedTransceiver) {
transceiver.StopInternal(); transceiver.StopInternal();
EXPECT_EQ(&channel, transceiver.channel()); EXPECT_EQ(&channel, transceiver.channel());
// Set the channel to |nullptr|. // Set the channel to `nullptr`.
transceiver.SetChannel(nullptr); transceiver.SetChannel(nullptr);
EXPECT_EQ(nullptr, transceiver.channel()); EXPECT_EQ(nullptr, transceiver.channel());
} }

View file

@ -156,7 +156,7 @@ class RtpTransmissionManager : public RtpSenderBase::SetStreamsObserver {
cricket::MediaType media_type); cricket::MediaType media_type);
// Triggered when a remote sender has been removed from a remote session // Triggered when a remote sender has been removed from a remote session
// description. It removes the remote sender with id |sender_id| from a remote // description. It removes the remote sender with id `sender_id` from a remote
// MediaStream and triggers DestroyAudioReceiver or DestroyVideoReceiver. // MediaStream and triggers DestroyAudioReceiver or DestroyVideoReceiver.
void OnRemoteSenderRemoved(const RtpSenderInfo& sender_info, void OnRemoteSenderRemoved(const RtpSenderInfo& sender_info,
MediaStreamInterface* stream, MediaStreamInterface* stream,
@ -166,7 +166,7 @@ class RtpTransmissionManager : public RtpSenderBase::SetStreamsObserver {
// session description. // session description.
// This method triggers CreateAudioSender or CreateVideoSender if the rtp // This method triggers CreateAudioSender or CreateVideoSender if the rtp
// streams in the local SessionDescription can be mapped to a MediaStreamTrack // streams in the local SessionDescription can be mapped to a MediaStreamTrack
// in a MediaStream in |local_streams_| // in a MediaStream in `local_streams_`
void OnLocalSenderAdded(const RtpSenderInfo& sender_info, void OnLocalSenderAdded(const RtpSenderInfo& sender_info,
cricket::MediaType media_type); cricket::MediaType media_type);
@ -174,7 +174,7 @@ class RtpTransmissionManager : public RtpSenderBase::SetStreamsObserver {
// description. // description.
// This method triggers DestroyAudioSender or DestroyVideoSender if a stream // This method triggers DestroyAudioSender or DestroyVideoSender if a stream
// has been removed from the local SessionDescription and the stream can be // has been removed from the local SessionDescription and the stream can be
// mapped to a MediaStreamTrack in a MediaStream in |local_streams_|. // mapped to a MediaStreamTrack in a MediaStream in `local_streams_`.
void OnLocalSenderRemoved(const RtpSenderInfo& sender_info, void OnLocalSenderRemoved(const RtpSenderInfo& sender_info,
cricket::MediaType media_type); cricket::MediaType media_type);

View file

@ -69,7 +69,7 @@ class RtpTransportInternal : public sigslot::has_slots<> {
virtual bool IsWritable(bool rtcp) const = 0; virtual bool IsWritable(bool rtcp) const = 0;
// TODO(zhihuang): Pass the |packet| by copy so that the original data // TODO(zhihuang): Pass the `packet` by copy so that the original data
// wouldn't be modified. // wouldn't be modified.
virtual bool SendRtpPacket(rtc::CopyOnWriteBuffer* packet, virtual bool SendRtpPacket(rtc::CopyOnWriteBuffer* packet,
const rtc::PacketOptions& options, const rtc::PacketOptions& options,

View file

@ -64,7 +64,7 @@ class SctpDataChannelProviderInterface {
// a const member. Block access to the 'id' member since it cannot be const. // a const member. Block access to the 'id' member since it cannot be const.
struct InternalDataChannelInit : public DataChannelInit { struct InternalDataChannelInit : public DataChannelInit {
enum OpenHandshakeRole { kOpener, kAcker, kNone }; enum OpenHandshakeRole { kOpener, kAcker, kNone };
// The default role is kOpener because the default |negotiated| is false. // The default role is kOpener because the default `negotiated` is false.
InternalDataChannelInit() : open_handshake_role(kOpener) {} InternalDataChannelInit() : open_handshake_role(kOpener) {}
explicit InternalDataChannelInit(const DataChannelInit& base); explicit InternalDataChannelInit(const DataChannelInit& base);
OpenHandshakeRole open_handshake_role; OpenHandshakeRole open_handshake_role;
@ -73,7 +73,7 @@ struct InternalDataChannelInit : public DataChannelInit {
// Helper class to allocate unique IDs for SCTP DataChannels. // Helper class to allocate unique IDs for SCTP DataChannels.
class SctpSidAllocator { class SctpSidAllocator {
public: public:
// Gets the first unused odd/even id based on the DTLS role. If |role| is // Gets the first unused odd/even id based on the DTLS role. If `role` is
// SSL_CLIENT, the allocated id starts from 0 and takes even numbers; // SSL_CLIENT, the allocated id starts from 0 and takes even numbers;
// otherwise, the id starts from 1 and takes odd numbers. // otherwise, the id starts from 1 and takes odd numbers.
// Returns false if no ID can be allocated. // Returns false if no ID can be allocated.
@ -82,11 +82,11 @@ class SctpSidAllocator {
// Attempts to reserve a specific sid. Returns false if it's unavailable. // Attempts to reserve a specific sid. Returns false if it's unavailable.
bool ReserveSid(int sid); bool ReserveSid(int sid);
// Indicates that |sid| isn't in use any more, and is thus available again. // Indicates that `sid` isn't in use any more, and is thus available again.
void ReleaseSid(int sid); void ReleaseSid(int sid);
private: private:
// Checks if |sid| is available to be assigned to a new SCTP data channel. // Checks if `sid` is available to be assigned to a new SCTP data channel.
bool IsSidAvailable(int sid) const; bool IsSidAvailable(int sid) const;
std::set<int> used_sids_; std::set<int> used_sids_;

View file

@ -73,7 +73,7 @@ class SctpTransport : public SctpTransportInterface,
void OnDtlsStateChange(cricket::DtlsTransportInternal* transport, void OnDtlsStateChange(cricket::DtlsTransportInternal* transport,
DtlsTransportState state); DtlsTransportState state);
// NOTE: |owner_thread_| is the thread that the SctpTransport object is // NOTE: `owner_thread_` is the thread that the SctpTransport object is
// constructed on. In the context of PeerConnection, it's the network thread. // constructed on. In the context of PeerConnection, it's the network thread.
rtc::Thread* const owner_thread_; rtc::Thread* const owner_thread_;
SctpTransportInformation info_ RTC_GUARDED_BY(owner_thread_); SctpTransportInformation info_ RTC_GUARDED_BY(owner_thread_);

View file

@ -181,7 +181,7 @@ std::map<std::string, const cricket::ContentGroup*> GetBundleGroupsByMid(
return bundle_groups_by_mid; return bundle_groups_by_mid;
} }
// Returns true if |new_desc| requests an ICE restart (i.e., new ufrag/pwd). // Returns true if `new_desc` requests an ICE restart (i.e., new ufrag/pwd).
bool CheckForRemoteIceRestart(const SessionDescriptionInterface* old_desc, bool CheckForRemoteIceRestart(const SessionDescriptionInterface* old_desc,
const SessionDescriptionInterface* new_desc, const SessionDescriptionInterface* new_desc,
const std::string& content_name) { const std::string& content_name) {
@ -284,7 +284,7 @@ std::vector<cricket::StreamParams> GetActiveStreams(
// Logic to decide if an m= section can be recycled. This means that the new // Logic to decide if an m= section can be recycled. This means that the new
// m= section is not rejected, but the old local or remote m= section is // m= section is not rejected, but the old local or remote m= section is
// rejected. |old_content_one| and |old_content_two| refer to the m= section // rejected. `old_content_one` and `old_content_two` refer to the m= section
// of the old remote and old local descriptions in no particular order. // of the old remote and old local descriptions in no particular order.
// We need to check both the old local and remote because either // We need to check both the old local and remote because either
// could be the most current from the latest negotation. // could be the most current from the latest negotation.
@ -297,15 +297,15 @@ bool IsMediaSectionBeingRecycled(SdpType type,
(old_content_two && old_content_two->rejected)); (old_content_two && old_content_two->rejected));
} }
// Verify that the order of media sections in |new_desc| matches // Verify that the order of media sections in `new_desc` matches
// |current_desc|. The number of m= sections in |new_desc| should be no // `current_desc`. The number of m= sections in `new_desc` should be no
// less than |current_desc|. In the case of checking an answer's // less than `current_desc`. In the case of checking an answer's
// |new_desc|, the |current_desc| is the last offer that was set as the // `new_desc`, the `current_desc` is the last offer that was set as the
// local or remote. In the case of checking an offer's |new_desc| we // local or remote. In the case of checking an offer's `new_desc` we
// check against the local and remote descriptions stored from the last // check against the local and remote descriptions stored from the last
// negotiation, because either of these could be the most up to date for // negotiation, because either of these could be the most up to date for
// possible rejected m sections. These are the |current_desc| and // possible rejected m sections. These are the `current_desc` and
// |secondary_current_desc|. // `secondary_current_desc`.
bool MediaSectionsInSameOrder(const SessionDescription& current_desc, bool MediaSectionsInSameOrder(const SessionDescription& current_desc,
const SessionDescription* secondary_current_desc, const SessionDescription* secondary_current_desc,
const SessionDescription& new_desc, const SessionDescription& new_desc,
@ -350,7 +350,7 @@ bool MediaSectionsHaveSameCount(const SessionDescription& desc1,
// BUNDLE-tag section (first media section/description in the BUNDLE group) // BUNDLE-tag section (first media section/description in the BUNDLE group)
// needs a ufrag and pwd. Mismatches, such as replying with a DTLS fingerprint // needs a ufrag and pwd. Mismatches, such as replying with a DTLS fingerprint
// to SDES keys, will be caught in JsepTransport negotiation, and backstopped // to SDES keys, will be caught in JsepTransport negotiation, and backstopped
// by Channel's |srtp_required| check. // by Channel's `srtp_required` check.
RTCError VerifyCrypto(const SessionDescription* desc, RTCError VerifyCrypto(const SessionDescription* desc,
bool dtls_enabled, bool dtls_enabled,
const std::map<std::string, const cricket::ContentGroup*>& const std::map<std::string, const cricket::ContentGroup*>&
@ -595,7 +595,7 @@ absl::string_view GetDefaultMidForPlanB(cricket::MediaType media_type) {
return ""; return "";
} }
// Add options to |[audio/video]_media_description_options| from |senders|. // Add options to |[audio/video]_media_description_options| from `senders`.
void AddPlanBRtpSenderOptions( void AddPlanBRtpSenderOptions(
const std::vector<rtc::scoped_refptr< const std::vector<rtc::scoped_refptr<
RtpSenderProxyWithInternal<RtpSenderInternal>>>& senders, RtpSenderProxyWithInternal<RtpSenderInternal>>>& senders,
@ -682,7 +682,7 @@ cricket::MediaDescriptionOptions GetMediaDescriptionOptionsForTransceiver(
return media_description_options; return media_description_options;
} }
// Returns the ContentInfo at mline index |i|, or null if none exists. // Returns the ContentInfo at mline index `i`, or null if none exists.
const ContentInfo* GetContentByIndex(const SessionDescriptionInterface* sdesc, const ContentInfo* GetContentByIndex(const SessionDescriptionInterface* sdesc,
size_t i) { size_t i) {
if (!sdesc) { if (!sdesc) {
@ -692,7 +692,7 @@ const ContentInfo* GetContentByIndex(const SessionDescriptionInterface* sdesc,
return (i < contents.size() ? &contents[i] : nullptr); return (i < contents.size() ? &contents[i] : nullptr);
} }
// From |rtc_options|, fill parts of |session_options| shared by all generated // From `rtc_options`, fill parts of `session_options` shared by all generated
// m= sectionss (in other words, nothing that involves a map/array). // m= sectionss (in other words, nothing that involves a map/array).
void ExtractSharedMediaSessionOptions( void ExtractSharedMediaSessionOptions(
const PeerConnectionInterface::RTCOfferAnswerOptions& rtc_options, const PeerConnectionInterface::RTCOfferAnswerOptions& rtc_options,
@ -713,7 +713,7 @@ std::string GenerateRtcpCname() {
return cname; return cname;
} }
// Check if we can send |new_stream| on a PeerConnection. // Check if we can send `new_stream` on a PeerConnection.
bool CanAddLocalMediaStream(webrtc::StreamCollectionInterface* current_streams, bool CanAddLocalMediaStream(webrtc::StreamCollectionInterface* current_streams,
webrtc::MediaStreamInterface* new_stream) { webrtc::MediaStreamInterface* new_stream) {
if (!new_stream || !current_streams) { if (!new_stream || !current_streams) {
@ -784,13 +784,13 @@ class SdpOfferAnswerHandler::ImplicitCreateSessionDescriptionObserver
std::unique_ptr<SessionDescriptionInterface> desc(desc_ptr); std::unique_ptr<SessionDescriptionInterface> desc(desc_ptr);
was_called_ = true; was_called_ = true;
// Abort early if |pc_| is no longer valid. // Abort early if `pc_` is no longer valid.
if (!sdp_handler_) { if (!sdp_handler_) {
operation_complete_callback_(); operation_complete_callback_();
return; return;
} }
// DoSetLocalDescription() is a synchronous operation that invokes // DoSetLocalDescription() is a synchronous operation that invokes
// |set_local_description_observer_| with the result. // `set_local_description_observer_` with the result.
sdp_handler_->DoSetLocalDescription( sdp_handler_->DoSetLocalDescription(
std::move(desc), std::move(set_local_description_observer_)); std::move(desc), std::move(set_local_description_observer_));
operation_complete_callback_(); operation_complete_callback_();
@ -926,7 +926,7 @@ class SdpOfferAnswerHandler::LocalIceCredentialsToReplace {
// Returns true if we have ICE credentials that need restarting. // Returns true if we have ICE credentials that need restarting.
bool HasIceCredentials() const { return !ice_credentials_.empty(); } bool HasIceCredentials() const { return !ice_credentials_.empty(); }
// Returns true if |local_description| shares no ICE credentials with the // Returns true if `local_description` shares no ICE credentials with the
// ICE credentials that need restarting. // ICE credentials that need restarting.
bool SatisfiesIceRestart( bool SatisfiesIceRestart(
const SessionDescriptionInterface& local_description) const { const SessionDescriptionInterface& local_description) const {
@ -1116,7 +1116,7 @@ void SdpOfferAnswerHandler::CreateOffer(
observer_refptr = observer_refptr =
rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer), rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer),
options](std::function<void()> operations_chain_callback) { options](std::function<void()> operations_chain_callback) {
// Abort early if |this_weak_ptr| is no longer valid. // Abort early if `this_weak_ptr` is no longer valid.
if (!this_weak_ptr) { if (!this_weak_ptr) {
observer_refptr->OnFailure( observer_refptr->OnFailure(
RTCError(RTCErrorType::INTERNAL_ERROR, RTCError(RTCErrorType::INTERNAL_ERROR,
@ -1147,16 +1147,16 @@ void SdpOfferAnswerHandler::SetLocalDescription(
rtc::scoped_refptr<SetSessionDescriptionObserver>(observer), rtc::scoped_refptr<SetSessionDescriptionObserver>(observer),
desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)]( desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)](
std::function<void()> operations_chain_callback) mutable { std::function<void()> operations_chain_callback) mutable {
// Abort early if |this_weak_ptr| is no longer valid. // Abort early if `this_weak_ptr` is no longer valid.
if (!this_weak_ptr) { if (!this_weak_ptr) {
// For consistency with SetSessionDescriptionObserverAdapter whose // For consistency with SetSessionDescriptionObserverAdapter whose
// posted messages doesn't get processed when the PC is destroyed, we // posted messages doesn't get processed when the PC is destroyed, we
// do not inform |observer_refptr| that the operation failed. // do not inform `observer_refptr` that the operation failed.
operations_chain_callback(); operations_chain_callback();
return; return;
} }
// SetSessionDescriptionObserverAdapter takes care of making sure the // SetSessionDescriptionObserverAdapter takes care of making sure the
// |observer_refptr| is invoked in a posted message. // `observer_refptr` is invoked in a posted message.
this_weak_ptr->DoSetLocalDescription( this_weak_ptr->DoSetLocalDescription(
std::move(desc), std::move(desc),
rtc::scoped_refptr<SetLocalDescriptionObserverInterface>( rtc::scoped_refptr<SetLocalDescriptionObserverInterface>(
@ -1182,7 +1182,7 @@ void SdpOfferAnswerHandler::SetLocalDescription(
[this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), observer, [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), observer,
desc = std::move(desc)]( desc = std::move(desc)](
std::function<void()> operations_chain_callback) mutable { std::function<void()> operations_chain_callback) mutable {
// Abort early if |this_weak_ptr| is no longer valid. // Abort early if `this_weak_ptr` is no longer valid.
if (!this_weak_ptr) { if (!this_weak_ptr) {
observer->OnSetLocalDescriptionComplete(RTCError( observer->OnSetLocalDescriptionComplete(RTCError(
RTCErrorType::INTERNAL_ERROR, RTCErrorType::INTERNAL_ERROR,
@ -1192,7 +1192,7 @@ void SdpOfferAnswerHandler::SetLocalDescription(
} }
this_weak_ptr->DoSetLocalDescription(std::move(desc), observer); this_weak_ptr->DoSetLocalDescription(std::move(desc), observer);
// DoSetLocalDescription() is implemented as a synchronous operation. // DoSetLocalDescription() is implemented as a synchronous operation.
// The |observer| will already have been informed that it completed, and // The `observer` will already have been informed that it completed, and
// we can mark this operation as complete without any loose ends. // we can mark this operation as complete without any loose ends.
operations_chain_callback(); operations_chain_callback();
}); });
@ -1209,7 +1209,7 @@ void SdpOfferAnswerHandler::SetLocalDescription(
void SdpOfferAnswerHandler::SetLocalDescription( void SdpOfferAnswerHandler::SetLocalDescription(
rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) { rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) {
RTC_DCHECK_RUN_ON(signaling_thread()); RTC_DCHECK_RUN_ON(signaling_thread());
// The |create_sdp_observer| handles performing DoSetLocalDescription() with // The `create_sdp_observer` handles performing DoSetLocalDescription() with
// the resulting description as well as completing the operation. // the resulting description as well as completing the operation.
rtc::scoped_refptr<ImplicitCreateSessionDescriptionObserver> rtc::scoped_refptr<ImplicitCreateSessionDescriptionObserver>
create_sdp_observer( create_sdp_observer(
@ -1221,11 +1221,11 @@ void SdpOfferAnswerHandler::SetLocalDescription(
operations_chain_->ChainOperation( operations_chain_->ChainOperation(
[this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(),
create_sdp_observer](std::function<void()> operations_chain_callback) { create_sdp_observer](std::function<void()> operations_chain_callback) {
// The |create_sdp_observer| is responsible for completing the // The `create_sdp_observer` is responsible for completing the
// operation. // operation.
create_sdp_observer->SetOperationCompleteCallback( create_sdp_observer->SetOperationCompleteCallback(
std::move(operations_chain_callback)); std::move(operations_chain_callback));
// Abort early if |this_weak_ptr| is no longer valid. This triggers the // Abort early if `this_weak_ptr` is no longer valid. This triggers the
// same code path as if DoCreateOffer() or DoCreateAnswer() failed. // same code path as if DoCreateOffer() or DoCreateAnswer() failed.
if (!this_weak_ptr) { if (!this_weak_ptr) {
create_sdp_observer->OnFailure(RTCError( create_sdp_observer->OnFailure(RTCError(
@ -1277,7 +1277,7 @@ RTCError SdpOfferAnswerHandler::ApplyLocalDescription(
// Take a reference to the old local description since it's used below to // Take a reference to the old local description since it's used below to
// compare against the new local description. When setting the new local // compare against the new local description. When setting the new local
// description, grab ownership of the replaced session description in case it // description, grab ownership of the replaced session description in case it
// is the same as |old_local_description|, to keep it alive for the duration // is the same as `old_local_description`, to keep it alive for the duration
// of the method. // of the method.
const SessionDescriptionInterface* old_local_description = const SessionDescriptionInterface* old_local_description =
local_description(); local_description();
@ -1295,7 +1295,7 @@ RTCError SdpOfferAnswerHandler::ApplyLocalDescription(
pending_local_description_ = std::move(desc); pending_local_description_ = std::move(desc);
} }
// The session description to apply now must be accessed by // The session description to apply now must be accessed by
// |local_description()|. // `local_description()`.
RTC_DCHECK(local_description()); RTC_DCHECK(local_description());
// Report statistics about any use of simulcast. // Report statistics about any use of simulcast.
@ -1500,16 +1500,16 @@ void SdpOfferAnswerHandler::SetRemoteDescription(
rtc::scoped_refptr<SetSessionDescriptionObserver>(observer), rtc::scoped_refptr<SetSessionDescriptionObserver>(observer),
desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)]( desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)](
std::function<void()> operations_chain_callback) mutable { std::function<void()> operations_chain_callback) mutable {
// Abort early if |this_weak_ptr| is no longer valid. // Abort early if `this_weak_ptr` is no longer valid.
if (!this_weak_ptr) { if (!this_weak_ptr) {
// For consistency with SetSessionDescriptionObserverAdapter whose // For consistency with SetSessionDescriptionObserverAdapter whose
// posted messages doesn't get processed when the PC is destroyed, we // posted messages doesn't get processed when the PC is destroyed, we
// do not inform |observer_refptr| that the operation failed. // do not inform `observer_refptr` that the operation failed.
operations_chain_callback(); operations_chain_callback();
return; return;
} }
// SetSessionDescriptionObserverAdapter takes care of making sure the // SetSessionDescriptionObserverAdapter takes care of making sure the
// |observer_refptr| is invoked in a posted message. // `observer_refptr` is invoked in a posted message.
this_weak_ptr->DoSetRemoteDescription( this_weak_ptr->DoSetRemoteDescription(
std::move(desc), std::move(desc),
rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>( rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>(
@ -1535,7 +1535,7 @@ void SdpOfferAnswerHandler::SetRemoteDescription(
[this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), observer, [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), observer,
desc = std::move(desc)]( desc = std::move(desc)](
std::function<void()> operations_chain_callback) mutable { std::function<void()> operations_chain_callback) mutable {
// Abort early if |this_weak_ptr| is no longer valid. // Abort early if `this_weak_ptr` is no longer valid.
if (!this_weak_ptr) { if (!this_weak_ptr) {
observer->OnSetRemoteDescriptionComplete(RTCError( observer->OnSetRemoteDescriptionComplete(RTCError(
RTCErrorType::INTERNAL_ERROR, RTCErrorType::INTERNAL_ERROR,
@ -1546,7 +1546,7 @@ void SdpOfferAnswerHandler::SetRemoteDescription(
this_weak_ptr->DoSetRemoteDescription(std::move(desc), this_weak_ptr->DoSetRemoteDescription(std::move(desc),
std::move(observer)); std::move(observer));
// DoSetRemoteDescription() is implemented as a synchronous operation. // DoSetRemoteDescription() is implemented as a synchronous operation.
// The |observer| will already have been informed that it completed, and // The `observer` will already have been informed that it completed, and
// we can mark this operation as complete without any loose ends. // we can mark this operation as complete without any loose ends.
operations_chain_callback(); operations_chain_callback();
}); });
@ -1567,7 +1567,7 @@ RTCError SdpOfferAnswerHandler::ApplyRemoteDescription(
// Take a reference to the old remote description since it's used below to // Take a reference to the old remote description since it's used below to
// compare against the new remote description. When setting the new remote // compare against the new remote description. When setting the new remote
// description, grab ownership of the replaced session description in case it // description, grab ownership of the replaced session description in case it
// is the same as |old_remote_description|, to keep it alive for the duration // is the same as `old_remote_description`, to keep it alive for the duration
// of the method. // of the method.
const SessionDescriptionInterface* old_remote_description = const SessionDescriptionInterface* old_remote_description =
remote_description(); remote_description();
@ -1585,7 +1585,7 @@ RTCError SdpOfferAnswerHandler::ApplyRemoteDescription(
pending_remote_description_ = std::move(desc); pending_remote_description_ = std::move(desc);
} }
// The session description to apply now must be accessed by // The session description to apply now must be accessed by
// |remote_description()|. // `remote_description()`.
RTC_DCHECK(remote_description()); RTC_DCHECK(remote_description());
// Report statistics about any use of simulcast. // Report statistics about any use of simulcast.
@ -1934,7 +1934,7 @@ void SdpOfferAnswerHandler::DoSetLocalDescription(
const SdpType type = desc->GetType(); const SdpType type = desc->GetType();
error = ApplyLocalDescription(std::move(desc), bundle_groups_by_mid); error = ApplyLocalDescription(std::move(desc), bundle_groups_by_mid);
// |desc| may be destroyed at this point. // `desc` may be destroyed at this point.
if (!error.ok()) { if (!error.ok()) {
// If ApplyLocalDescription fails, the PeerConnection could be in an // If ApplyLocalDescription fails, the PeerConnection could be in an
@ -2052,7 +2052,7 @@ void SdpOfferAnswerHandler::CreateAnswer(
observer_refptr = observer_refptr =
rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer), rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer),
options](std::function<void()> operations_chain_callback) { options](std::function<void()> operations_chain_callback) {
// Abort early if |this_weak_ptr| is no longer valid. // Abort early if `this_weak_ptr` is no longer valid.
if (!this_weak_ptr) { if (!this_weak_ptr) {
observer_refptr->OnFailure(RTCError( observer_refptr->OnFailure(RTCError(
RTCErrorType::INTERNAL_ERROR, RTCErrorType::INTERNAL_ERROR,
@ -2198,7 +2198,7 @@ void SdpOfferAnswerHandler::DoSetRemoteDescription(
const SdpType type = desc->GetType(); const SdpType type = desc->GetType();
error = ApplyRemoteDescription(std::move(desc), bundle_groups_by_mid); error = ApplyRemoteDescription(std::move(desc), bundle_groups_by_mid);
// |desc| may be destroyed at this point. // `desc` may be destroyed at this point.
if (!error.ok()) { if (!error.ok()) {
// If ApplyRemoteDescription fails, the PeerConnection could be in an // If ApplyRemoteDescription fails, the PeerConnection could be in an
@ -2545,7 +2545,7 @@ bool SdpOfferAnswerHandler::ShouldFireNegotiationNeededEvent(
// Since we just suppressed an event that would have been fired, if // Since we just suppressed an event that would have been fired, if
// negotiation is still needed by the time the chain becomes empty again, we // negotiation is still needed by the time the chain becomes empty again, we
// must make sure to generate another event if negotiation is needed then. // must make sure to generate another event if negotiation is needed then.
// This happens when |is_negotiation_needed_| goes from false to true, so we // This happens when `is_negotiation_needed_` goes from false to true, so we
// set it to false until UpdateNegotiationNeeded() is called. // set it to false until UpdateNegotiationNeeded() is called.
is_negotiation_needed_ = false; is_negotiation_needed_ = false;
update_negotiation_needed_on_empty_chain_ = true; update_negotiation_needed_on_empty_chain_ = true;
@ -3556,8 +3556,8 @@ void SdpOfferAnswerHandler::GetOptionsForOffer(
pc_->configuration()->offer_extmap_allow_mixed; pc_->configuration()->offer_extmap_allow_mixed;
// Allow fallback for using obsolete SCTP syntax. // Allow fallback for using obsolete SCTP syntax.
// Note that the default in |session_options| is true, while // Note that the default in `session_options` is true, while
// the default in |options| is false. // the default in `options` is false.
session_options->use_obsolete_sctp_sdp = session_options->use_obsolete_sctp_sdp =
offer_answer_options.use_obsolete_sctp_sdp; offer_answer_options.use_obsolete_sctp_sdp;
} }
@ -3671,7 +3671,7 @@ void SdpOfferAnswerHandler::GetOptionsForUnifiedPlanOffer(
// default, rejected media section here that can be later overwritten. // default, rejected media section here that can be later overwritten.
for (size_t i = 0; for (size_t i = 0;
i < std::max(local_contents.size(), remote_contents.size()); ++i) { i < std::max(local_contents.size(), remote_contents.size()); ++i) {
// Either |local_content| or |remote_content| is non-null. // Either `local_content` or `remote_content` is non-null.
const ContentInfo* local_content = const ContentInfo* local_content =
(i < local_contents.size() ? &local_contents[i] : nullptr); (i < local_contents.size() ? &local_contents[i] : nullptr);
const ContentInfo* current_local_content = const ContentInfo* current_local_content =
@ -4604,8 +4604,8 @@ cricket::VoiceChannel* SdpOfferAnswerHandler::CreateVoiceChannel(
RtpTransportInternal* rtp_transport = pc_->GetRtpTransport(mid); RtpTransportInternal* rtp_transport = pc_->GetRtpTransport(mid);
// TODO(bugs.webrtc.org/11992): CreateVoiceChannel internally switches to the // TODO(bugs.webrtc.org/11992): CreateVoiceChannel internally switches to the
// worker thread. We shouldn't be using the |call_ptr_| hack here but simply // worker thread. We shouldn't be using the `call_ptr_` hack here but simply
// be on the worker thread and use |call_| (update upstream code). // be on the worker thread and use `call_` (update upstream code).
return channel_manager()->CreateVoiceChannel( return channel_manager()->CreateVoiceChannel(
pc_->call_ptr(), pc_->configuration()->media_config, rtp_transport, pc_->call_ptr(), pc_->configuration()->media_config, rtp_transport,
signaling_thread(), mid, pc_->SrtpRequired(), pc_->GetCryptoOptions(), signaling_thread(), mid, pc_->SrtpRequired(), pc_->GetCryptoOptions(),
@ -4624,8 +4624,8 @@ cricket::VideoChannel* SdpOfferAnswerHandler::CreateVideoChannel(
RtpTransportInternal* rtp_transport = pc_->GetRtpTransport(mid); RtpTransportInternal* rtp_transport = pc_->GetRtpTransport(mid);
// TODO(bugs.webrtc.org/11992): CreateVideoChannel internally switches to the // TODO(bugs.webrtc.org/11992): CreateVideoChannel internally switches to the
// worker thread. We shouldn't be using the |call_ptr_| hack here but simply // worker thread. We shouldn't be using the `call_ptr_` hack here but simply
// be on the worker thread and use |call_| (update upstream code). // be on the worker thread and use `call_` (update upstream code).
return channel_manager()->CreateVideoChannel( return channel_manager()->CreateVideoChannel(
pc_->call_ptr(), pc_->configuration()->media_config, rtp_transport, pc_->call_ptr(), pc_->configuration()->media_config, rtp_transport,
signaling_thread(), mid, pc_->SrtpRequired(), pc_->GetCryptoOptions(), signaling_thread(), mid, pc_->SrtpRequired(), pc_->GetCryptoOptions(),

View file

@ -237,7 +237,7 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
bundle_groups_by_mid); bundle_groups_by_mid);
// Implementation of the offer/answer exchange operations. These are chained // Implementation of the offer/answer exchange operations. These are chained
// onto the |operations_chain_| when the public CreateOffer(), CreateAnswer(), // onto the `operations_chain_` when the public CreateOffer(), CreateAnswer(),
// SetLocalDescription() and SetRemoteDescription() methods are invoked. // SetLocalDescription() and SetRemoteDescription() methods are invoked.
void DoCreateOffer( void DoCreateOffer(
const PeerConnectionInterface::RTCOfferAnswerOptions& options, const PeerConnectionInterface::RTCOfferAnswerOptions& options,
@ -361,7 +361,7 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>> rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
FindAvailableTransceiverToReceive(cricket::MediaType media_type) const; FindAvailableTransceiverToReceive(cricket::MediaType media_type) const;
// Returns a MediaSessionOptions struct with options decided by |options|, // Returns a MediaSessionOptions struct with options decided by `options`,
// the local MediaStreams and DataChannels. // the local MediaStreams and DataChannels.
void GetOptionsForOffer(const PeerConnectionInterface::RTCOfferAnswerOptions& void GetOptionsForOffer(const PeerConnectionInterface::RTCOfferAnswerOptions&
offer_answer_options, offer_answer_options,
@ -378,7 +378,7 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
RTC_RUN_ON(signaling_thread()); RTC_RUN_ON(signaling_thread());
// Returns a MediaSessionOptions struct with options decided by // Returns a MediaSessionOptions struct with options decided by
// |constraints|, the local MediaStreams and DataChannels. // `constraints`, the local MediaStreams and DataChannels.
void GetOptionsForAnswer(const PeerConnectionInterface::RTCOfferAnswerOptions& void GetOptionsForAnswer(const PeerConnectionInterface::RTCOfferAnswerOptions&
offer_answer_options, offer_answer_options,
cricket::MediaSessionOptions* session_options); cricket::MediaSessionOptions* session_options);
@ -416,9 +416,9 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
// Runs the algorithm specified in // Runs the algorithm specified in
// https://w3c.github.io/webrtc-pc/#process-remote-track-removal // https://w3c.github.io/webrtc-pc/#process-remote-track-removal
// This method will update the following lists: // This method will update the following lists:
// |remove_list| is the list of transceivers for which the receiving track is // `remove_list` is the list of transceivers for which the receiving track is
// being removed. // being removed.
// |removed_streams| is the list of streams which no longer have a receiving // `removed_streams` is the list of streams which no longer have a receiving
// track so should be removed. // track so should be removed.
void ProcessRemovalOfRemoteTrack( void ProcessRemovalOfRemoteTrack(
const rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>> const rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>>
@ -431,23 +431,23 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
remote_streams, remote_streams,
std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams); std::vector<rtc::scoped_refptr<MediaStreamInterface>>* removed_streams);
// Remove all local and remote senders of type |media_type|. // Remove all local and remote senders of type `media_type`.
// Called when a media type is rejected (m-line set to port 0). // Called when a media type is rejected (m-line set to port 0).
void RemoveSenders(cricket::MediaType media_type); void RemoveSenders(cricket::MediaType media_type);
// Loops through the vector of |streams| and finds added and removed // Loops through the vector of `streams` and finds added and removed
// StreamParams since last time this method was called. // StreamParams since last time this method was called.
// For each new or removed StreamParam, OnLocalSenderSeen or // For each new or removed StreamParam, OnLocalSenderSeen or
// OnLocalSenderRemoved is invoked. // OnLocalSenderRemoved is invoked.
void UpdateLocalSenders(const std::vector<cricket::StreamParams>& streams, void UpdateLocalSenders(const std::vector<cricket::StreamParams>& streams,
cricket::MediaType media_type); cricket::MediaType media_type);
// Makes sure a MediaStreamTrack is created for each StreamParam in |streams|, // Makes sure a MediaStreamTrack is created for each StreamParam in `streams`,
// and existing MediaStreamTracks are removed if there is no corresponding // and existing MediaStreamTracks are removed if there is no corresponding
// StreamParam. If |default_track_needed| is true, a default MediaStreamTrack // StreamParam. If `default_track_needed` is true, a default MediaStreamTrack
// is created if it doesn't exist; if false, it's removed if it exists. // is created if it doesn't exist; if false, it's removed if it exists.
// |media_type| is the type of the |streams| and can be either audio or video. // `media_type` is the type of the `streams` and can be either audio or video.
// If a new MediaStream is created it is added to |new_streams|. // If a new MediaStream is created it is added to `new_streams`.
void UpdateRemoteSendersList( void UpdateRemoteSendersList(
const std::vector<cricket::StreamParams>& streams, const std::vector<cricket::StreamParams>& streams,
bool default_track_needed, bool default_track_needed,
@ -469,8 +469,8 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
SdpType type); SdpType type);
// Helper function to remove stopped transceivers. // Helper function to remove stopped transceivers.
void RemoveStoppedTransceivers(); void RemoveStoppedTransceivers();
// Deletes the corresponding channel of contents that don't exist in |desc|. // Deletes the corresponding channel of contents that don't exist in `desc`.
// |desc| can be null. This means that all channels are deleted. // `desc` can be null. This means that all channels are deleted.
void RemoveUnusedChannels(const cricket::SessionDescription* desc); void RemoveUnusedChannels(const cricket::SessionDescription* desc);
// Report inferred negotiated SDP semantics from a local/remote answer to the // Report inferred negotiated SDP semantics from a local/remote answer to the
@ -478,18 +478,18 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
void ReportNegotiatedSdpSemantics(const SessionDescriptionInterface& answer); void ReportNegotiatedSdpSemantics(const SessionDescriptionInterface& answer);
// Finds remote MediaStreams without any tracks and removes them from // Finds remote MediaStreams without any tracks and removes them from
// |remote_streams_| and notifies the observer that the MediaStreams no longer // `remote_streams_` and notifies the observer that the MediaStreams no longer
// exist. // exist.
void UpdateEndedRemoteMediaStreams(); void UpdateEndedRemoteMediaStreams();
// Uses all remote candidates in |remote_desc| in this session. // Uses all remote candidates in `remote_desc` in this session.
bool UseCandidatesInSessionDescription( bool UseCandidatesInSessionDescription(
const SessionDescriptionInterface* remote_desc); const SessionDescriptionInterface* remote_desc);
// Uses |candidate| in this session. // Uses `candidate` in this session.
bool UseCandidate(const IceCandidateInterface* candidate); bool UseCandidate(const IceCandidateInterface* candidate);
// Returns true if we are ready to push down the remote candidate. // Returns true if we are ready to push down the remote candidate.
// |remote_desc| is the new remote description, or NULL if the current remote // `remote_desc` is the new remote description, or NULL if the current remote
// description should be used. Output |valid| is true if the candidate media // description should be used. Output `valid` is true if the candidate media
// index is valid. // index is valid.
bool ReadyToUseRemoteCandidate(const IceCandidateInterface* candidate, bool ReadyToUseRemoteCandidate(const IceCandidateInterface* candidate,
const SessionDescriptionInterface* remote_desc, const SessionDescriptionInterface* remote_desc,
@ -503,7 +503,7 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
// Note that cricket code uses the term "channel" for what other code // Note that cricket code uses the term "channel" for what other code
// refers to as "transport". // refers to as "transport".
// Allocates media channels based on the |desc|. If |desc| doesn't have // Allocates media channels based on the `desc`. If `desc` doesn't have
// the BUNDLE option, this method will disable BUNDLE in PortAllocator. // the BUNDLE option, this method will disable BUNDLE in PortAllocator.
// This method will also delete any existing media channels before creating. // This method will also delete any existing media channels before creating.
RTCError CreateChannels(const cricket::SessionDescription& desc); RTCError CreateChannels(const cricket::SessionDescription& desc);
@ -526,7 +526,7 @@ class SdpOfferAnswerHandler : public SdpStateProvider,
// Destroys the given ChannelInterface. // Destroys the given ChannelInterface.
// The channel cannot be accessed after this method is called. // The channel cannot be accessed after this method is called.
void DestroyChannelInterface(cricket::ChannelInterface* channel); void DestroyChannelInterface(cricket::ChannelInterface* channel);
// Generates MediaDescriptionOptions for the |session_opts| based on existing // Generates MediaDescriptionOptions for the `session_opts` based on existing
// local description or remote description. // local description or remote description.
void GenerateMediaDescriptionOptions( void GenerateMediaDescriptionOptions(

View file

@ -249,7 +249,7 @@ RTCErrorOr<SimulcastDescription> SdpSerializer::DeserializeSimulcastDescription(
// Set the layers according to which pair is send and which is recv // Set the layers according to which pair is send and which is recv
// At this point if the simulcast is unidirectional then // At this point if the simulcast is unidirectional then
// either |list1| or |list2| will be in 'error' state indicating that // either `list1` or `list2` will be in 'error' state indicating that
// the value should not be used. // the value should not be used.
SimulcastDescription simulcast; SimulcastDescription simulcast;
if (list1.ok()) { if (list1.ok()) {
@ -362,8 +362,8 @@ RTCErrorOr<RidDescription> SdpSerializer::DeserializeRidDescription(
return ParseError("Invalid format for restriction: " + restriction); return ParseError("Invalid format for restriction: " + restriction);
} }
// |parts| contains at least one value and it does not contain a space. // `parts` contains at least one value and it does not contain a space.
// Note: |parts| and other values might still contain tab, newline, // Note: `parts` and other values might still contain tab, newline,
// unprintable characters, etc. which will not generate errors here but // unprintable characters, etc. which will not generate errors here but
// will (most-likely) be ignored by components down stream. // will (most-likely) be ignored by components down stream.
if (parts[0] == kPayloadType) { if (parts[0] == kPayloadType) {
@ -376,7 +376,7 @@ RTCErrorOr<RidDescription> SdpSerializer::DeserializeRidDescription(
continue; continue;
} }
// Parse |parts| as a key=value pair which allows unspecified values. // Parse `parts` as a key=value pair which allows unspecified values.
if (rid_description.restrictions.find(parts[0]) != if (rid_description.restrictions.find(parts[0]) !=
rid_description.restrictions.end()) { rid_description.restrictions.end()) {
return ParseError("Duplicate restriction specified: " + parts[0]); return ParseError("Duplicate restriction specified: " + parts[0]);

View file

@ -28,7 +28,7 @@ namespace webrtc {
// format without knowing about the SDP attribute details (a=simulcast:) // format without knowing about the SDP attribute details (a=simulcast:)
// Usage: // Usage:
// Consider the SDP attribute for simulcast a=simulcast:<configuration>. // Consider the SDP attribute for simulcast a=simulcast:<configuration>.
// The SDP serializtion code (webrtcsdp.h) should use |SdpSerializer| to // The SDP serializtion code (webrtcsdp.h) should use `SdpSerializer` to
// serialize and deserialize the <configuration> section. // serialize and deserialize the <configuration> section.
// This class will allow testing the serialization of components without // This class will allow testing the serialization of components without
// having to serialize the entire SDP while hiding implementation details // having to serialize the entire SDP while hiding implementation details

View file

@ -96,8 +96,8 @@ void ExpectEqual(const RidDescription& expected, const RidDescription& actual) {
class SimulcastSdpSerializerTest : public TestWithParam<const char*> { class SimulcastSdpSerializerTest : public TestWithParam<const char*> {
public: public:
// Runs a test for deserializing Simulcast. // Runs a test for deserializing Simulcast.
// |str| - The serialized Simulcast to parse. // `str` - The serialized Simulcast to parse.
// |expected| - The expected output Simulcast to compare to. // `expected` - The expected output Simulcast to compare to.
void TestDeserialization(const std::string& str, void TestDeserialization(const std::string& str,
const SimulcastDescription& expected) const { const SimulcastDescription& expected) const {
SdpSerializer deserializer; SdpSerializer deserializer;
@ -107,8 +107,8 @@ class SimulcastSdpSerializerTest : public TestWithParam<const char*> {
} }
// Runs a test for serializing Simulcast. // Runs a test for serializing Simulcast.
// |simulcast| - The Simulcast to serialize. // `simulcast` - The Simulcast to serialize.
// |expected| - The expected output string to compare to. // `expected` - The expected output string to compare to.
void TestSerialization(const SimulcastDescription& simulcast, void TestSerialization(const SimulcastDescription& simulcast,
const std::string& expected) const { const std::string& expected) const {
SdpSerializer serializer; SdpSerializer serializer;
@ -280,8 +280,8 @@ TEST_F(SimulcastSdpSerializerTest, Serialize_ComplexSerialization) {
class RidDescriptionSdpSerializerTest : public TestWithParam<const char*> { class RidDescriptionSdpSerializerTest : public TestWithParam<const char*> {
public: public:
// Runs a test for deserializing Rid Descriptions. // Runs a test for deserializing Rid Descriptions.
// |str| - The serialized Rid Description to parse. // `str` - The serialized Rid Description to parse.
// |expected| - The expected output RidDescription to compare to. // `expected` - The expected output RidDescription to compare to.
void TestDeserialization(const std::string& str, void TestDeserialization(const std::string& str,
const RidDescription& expected) const { const RidDescription& expected) const {
SdpSerializer deserializer; SdpSerializer deserializer;
@ -291,8 +291,8 @@ class RidDescriptionSdpSerializerTest : public TestWithParam<const char*> {
} }
// Runs a test for serializing RidDescriptions. // Runs a test for serializing RidDescriptions.
// |rid_description| - The RidDescription to serialize. // `rid_description` - The RidDescription to serialize.
// |expected| - The expected output string to compare to. // `expected` - The expected output string to compare to.
void TestSerialization(const RidDescription& rid_description, void TestSerialization(const RidDescription& rid_description,
const std::string& expected) const { const std::string& expected) const {
SdpSerializer serializer; SdpSerializer serializer;

View file

@ -99,7 +99,7 @@ class MediaContentDescription {
return absl::WrapUnique(CloneInternal()); return absl::WrapUnique(CloneInternal());
} }
// |protocol| is the expected media transport protocol, such as RTP/AVPF, // `protocol` is the expected media transport protocol, such as RTP/AVPF,
// RTP/SAVPF or SCTP/DTLS. // RTP/SAVPF or SCTP/DTLS.
virtual std::string protocol() const { return protocol_; } virtual std::string protocol() const { return protocol_; }
virtual void set_protocol(const std::string& protocol) { virtual void set_protocol(const std::string& protocol) {
@ -443,11 +443,11 @@ class RTC_EXPORT ContentInfo {
ContentInfo(ContentInfo&& o) = default; ContentInfo(ContentInfo&& o) = default;
ContentInfo& operator=(ContentInfo&& o) = default; ContentInfo& operator=(ContentInfo&& o) = default;
// Alias for |name|. // Alias for `name`.
std::string mid() const { return name; } std::string mid() const { return name; }
void set_mid(const std::string& mid) { this->name = mid; } void set_mid(const std::string& mid) { this->name = mid; }
// Alias for |description|. // Alias for `description`.
MediaContentDescription* media_description(); MediaContentDescription* media_description();
const MediaContentDescription* media_description() const; const MediaContentDescription* media_description() const;
@ -470,7 +470,7 @@ typedef std::vector<std::string> ContentNames;
// This class provides a mechanism to aggregate different media contents into a // This class provides a mechanism to aggregate different media contents into a
// group. This group can also be shared with the peers in a pre-defined format. // group. This group can also be shared with the peers in a pre-defined format.
// GroupInfo should be populated only with the |content_name| of the // GroupInfo should be populated only with the `content_name` of the
// MediaDescription. // MediaDescription.
class ContentGroup { class ContentGroup {
public: public:
@ -580,7 +580,7 @@ class SessionDescription {
// Group mutators. // Group mutators.
void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); } void AddGroup(const ContentGroup& group) { content_groups_.push_back(group); }
// Remove the first group with the same semantics specified by |name|. // Remove the first group with the same semantics specified by `name`.
void RemoveGroupByName(const std::string& name); void RemoveGroupByName(const std::string& name);
// Global attributes. // Global attributes.

View file

@ -136,7 +136,7 @@ TEST_F(SrtpSessionTest, TestGetSendStreamPacketIndex) {
int out_len = 0; int out_len = 0;
EXPECT_TRUE(s1_.ProtectRtp(rtp_packet_, rtp_len_, sizeof(rtp_packet_), EXPECT_TRUE(s1_.ProtectRtp(rtp_packet_, rtp_len_, sizeof(rtp_packet_),
&out_len, &index)); &out_len, &index));
// |index| will be shifted by 16. // `index` will be shifted by 16.
int64_t be64_index = static_cast<int64_t>(NetworkToHost64(1 << 16)); int64_t be64_index = static_cast<int64_t>(NetworkToHost64(1 << 16));
EXPECT_EQ(be64_index, index); EXPECT_EQ(be64_index, index);
} }

View file

@ -133,7 +133,7 @@ class SrtpTransportTest : public ::testing::Test, public sigslot::has_slots<> {
memcpy(original_rtp_data, rtp_packet_data, rtp_len); memcpy(original_rtp_data, rtp_packet_data, rtp_len);
rtc::PacketOptions options; rtc::PacketOptions options;
// Send a packet from |srtp_transport1_| to |srtp_transport2_| and verify // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
// that the packet can be successfully received and decrypted. // that the packet can be successfully received and decrypted.
ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
cricket::PF_SRTP_BYPASS)); cricket::PF_SRTP_BYPASS));
@ -181,7 +181,7 @@ class SrtpTransportTest : public ::testing::Test, public sigslot::has_slots<> {
packet_size); packet_size);
rtc::PacketOptions options; rtc::PacketOptions options;
// Send a packet from |srtp_transport1_| to |srtp_transport2_| and verify // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
// that the packet can be successfully received and decrypted. // that the packet can be successfully received and decrypted.
ASSERT_TRUE(srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options, ASSERT_TRUE(srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options,
cricket::PF_SRTP_BYPASS)); cricket::PF_SRTP_BYPASS));
@ -263,7 +263,7 @@ class SrtpTransportTest : public ::testing::Test, public sigslot::has_slots<> {
memcpy(original_rtp_data, rtp_packet_data, rtp_len); memcpy(original_rtp_data, rtp_packet_data, rtp_len);
rtc::PacketOptions options; rtc::PacketOptions options;
// Send a packet from |srtp_transport1_| to |srtp_transport2_| and verify // Send a packet from `srtp_transport1_` to `srtp_transport2_` and verify
// that the packet can be successfully received and decrypted. // that the packet can be successfully received and decrypted.
ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options,
cricket::PF_SRTP_BYPASS)); cricket::PF_SRTP_BYPASS));

View file

@ -552,7 +552,7 @@ double StatsCollector::GetTimeNow() {
return static_cast<double>(rtc::TimeUTCMillis()); return static_cast<double>(rtc::TimeUTCMillis());
} }
// Adds a MediaStream with tracks that can be used as a |selector| in a call // Adds a MediaStream with tracks that can be used as a `selector` in a call
// to GetStats. // to GetStats.
void StatsCollector::AddStream(MediaStreamInterface* stream) { void StatsCollector::AddStream(MediaStreamInterface* stream) {
RTC_DCHECK_RUN_ON(pc_->signaling_thread()); RTC_DCHECK_RUN_ON(pc_->signaling_thread());

View file

@ -197,8 +197,8 @@ StatsReport::Id IdFromCertIdString(const std::string& cert_id) {
return TypedIdFromIdString(StatsReport::kStatsReportTypeCertificate, cert_id); return TypedIdFromIdString(StatsReport::kStatsReportTypeCertificate, cert_id);
} }
// Finds the |n|-th report of type |type| in |reports|. // Finds the `n`-th report of type `type` in `reports`.
// |n| starts from 1 for finding the first report. // `n` starts from 1 for finding the first report.
const StatsReport* FindNthReportByType(const StatsReports& reports, const StatsReport* FindNthReportByType(const StatsReports& reports,
const StatsReport::StatsType& type, const StatsReport::StatsType& type,
int n) { int n) {
@ -212,10 +212,10 @@ const StatsReport* FindNthReportByType(const StatsReports& reports,
return nullptr; return nullptr;
} }
// Returns the value of the stat identified by |name| in the |n|-th report of // Returns the value of the stat identified by `name` in the `n`-th report of
// type |type| in |reports|. // type `type` in `reports`.
// |n| starts from 1 for finding the first report. // `n` starts from 1 for finding the first report.
// If either the |n|-th report is not found, or the stat is not present in that // If either the `n`-th report is not found, or the stat is not present in that
// report, then nullopt is returned. // report, then nullopt is returned.
absl::optional<std::string> GetValueInNthReportByType( absl::optional<std::string> GetValueInNthReportByType(
const StatsReports& reports, const StatsReports& reports,
@ -1101,17 +1101,17 @@ TEST_P(StatsCollectorTrackTest, TrackAndSsrcObjectExistAfterUpdateSsrcStats) {
StatsReports reports; StatsReports reports;
stats->GetStats(nullptr, &reports); stats->GetStats(nullptr, &reports);
// |reports| should contain at least one session report, one track report, // `reports` should contain at least one session report, one track report,
// and one ssrc report. // and one ssrc report.
EXPECT_LE(3u, reports.size()); EXPECT_LE(3u, reports.size());
const StatsReport* track_report = const StatsReport* track_report =
FindNthReportByType(reports, StatsReport::kStatsReportTypeTrack, 1); FindNthReportByType(reports, StatsReport::kStatsReportTypeTrack, 1);
EXPECT_TRUE(track_report); EXPECT_TRUE(track_report);
// Get report for the specific |track|. // Get report for the specific `track`.
reports.clear(); reports.clear();
stats->GetStats(track_, &reports); stats->GetStats(track_, &reports);
// |reports| should contain at least one session report, one track report, // `reports` should contain at least one session report, one track report,
// and one ssrc report. // and one ssrc report.
EXPECT_LE(3u, reports.size()); EXPECT_LE(3u, reports.size());
track_report = track_report =
@ -1248,7 +1248,7 @@ TEST_P(StatsCollectorTrackTest, ReportsFromRemoteTrack) {
StatsReports reports; StatsReports reports;
stats->GetStats(nullptr, &reports); stats->GetStats(nullptr, &reports);
// |reports| should contain at least one session report, one track report, // `reports` should contain at least one session report, one track report,
// and one ssrc report. // and one ssrc report.
EXPECT_LE(3u, reports.size()); EXPECT_LE(3u, reports.size());
const StatsReport* track_report = const StatsReport* track_report =
@ -1508,8 +1508,8 @@ TEST_P(StatsCollectorTrackTest, FilterOutNegativeInitialValues) {
voice_sender_info.packets_lost = -1; voice_sender_info.packets_lost = -1;
voice_sender_info.jitter_ms = -1; voice_sender_info.jitter_ms = -1;
// Some of the contents in |voice_sender_info| needs to be updated from the // Some of the contents in `voice_sender_info` needs to be updated from the
// |audio_track_|. // `audio_track_`.
UpdateVoiceSenderInfoFromAudioTrack(local_track.get(), &voice_sender_info, UpdateVoiceSenderInfoFromAudioTrack(local_track.get(), &voice_sender_info,
true); true);
@ -1669,8 +1669,8 @@ TEST_P(StatsCollectorTrackTest, LocalAndRemoteTracksWithSameSsrc) {
VoiceSenderInfo voice_sender_info; VoiceSenderInfo voice_sender_info;
InitVoiceSenderInfo(&voice_sender_info); InitVoiceSenderInfo(&voice_sender_info);
// Some of the contents in |voice_sender_info| needs to be updated from the // Some of the contents in `voice_sender_info` needs to be updated from the
// |audio_track_|. // `audio_track_`.
UpdateVoiceSenderInfoFromAudioTrack(audio_track_.get(), &voice_sender_info, UpdateVoiceSenderInfoFromAudioTrack(audio_track_.get(), &voice_sender_info,
true); true);

View file

@ -170,12 +170,12 @@ class FakeAudioCaptureModule : public webrtc::AudioDeviceModule,
// Initializes the state of the FakeAudioCaptureModule. This API is called on // Initializes the state of the FakeAudioCaptureModule. This API is called on
// creation by the Create() API. // creation by the Create() API.
bool Initialize(); bool Initialize();
// SetBuffer() sets all samples in send_buffer_ to |value|. // SetBuffer() sets all samples in send_buffer_ to `value`.
void SetSendBuffer(int value); void SetSendBuffer(int value);
// Resets rec_buffer_. I.e., sets all rec_buffer_ samples to 0. // Resets rec_buffer_. I.e., sets all rec_buffer_ samples to 0.
void ResetRecBuffer(); void ResetRecBuffer();
// Returns true if rec_buffer_ contains one or more sample greater than or // Returns true if rec_buffer_ contains one or more sample greater than or
// equal to |value|. // equal to `value`.
bool CheckRecBuffer(int value); bool CheckRecBuffer(int value);
// Returns true/false depending on if recording or playback has been // Returns true/false depending on if recording or playback has been

View file

@ -799,7 +799,7 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
const PeerConnectionInterface::RTCConfiguration* config, const PeerConnectionInterface::RTCConfiguration* config,
webrtc::PeerConnectionDependencies dependencies) { webrtc::PeerConnectionDependencies dependencies) {
PeerConnectionInterface::RTCConfiguration modified_config; PeerConnectionInterface::RTCConfiguration modified_config;
// If |config| is null, this will result in a default configuration being // If `config` is null, this will result in a default configuration being
// used. // used.
if (config) { if (config) {
modified_config = *config; modified_config = *config;
@ -956,7 +956,7 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
} }
} }
// Simulate sending a blob of SDP with delay |signaling_delay_ms_| (0 by // Simulate sending a blob of SDP with delay `signaling_delay_ms_` (0 by
// default). // default).
void SendSdpMessage(SdpType type, const std::string& msg) { void SendSdpMessage(SdpType type, const std::string& msg) {
if (signaling_delay_ms_ == 0) { if (signaling_delay_ms_ == 0) {
@ -977,7 +977,7 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
} }
} }
// Simulate trickling an ICE candidate with delay |signaling_delay_ms_| (0 by // Simulate trickling an ICE candidate with delay `signaling_delay_ms_` (0 by
// default). // default).
void SendIceMessage(const std::string& sdp_mid, void SendIceMessage(const std::string& sdp_mid,
int sdp_mline_index, int sdp_mline_index,
@ -1125,7 +1125,7 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
std::string debug_name_; std::string debug_name_;
std::unique_ptr<rtc::FakeNetworkManager> fake_network_manager_; std::unique_ptr<rtc::FakeNetworkManager> fake_network_manager_;
// Reference to the mDNS responder owned by |fake_network_manager_| after set. // Reference to the mDNS responder owned by `fake_network_manager_` after set.
webrtc::FakeMdnsResponder* mdns_responder_ = nullptr; webrtc::FakeMdnsResponder* mdns_responder_ = nullptr;
rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_;
@ -1153,7 +1153,7 @@ class PeerConnectionIntegrationWrapper : public webrtc::PeerConnectionObserver,
// them, if required. // them, if required.
std::vector<rtc::scoped_refptr<webrtc::VideoTrackSource>> std::vector<rtc::scoped_refptr<webrtc::VideoTrackSource>>
video_track_sources_; video_track_sources_;
// |local_video_renderer_| attached to the first created local video track. // `local_video_renderer_` attached to the first created local video track.
std::unique_ptr<webrtc::FakeVideoTrackRenderer> local_video_renderer_; std::unique_ptr<webrtc::FakeVideoTrackRenderer> local_video_renderer_;
SdpSemantics sdp_semantics_; SdpSemantics sdp_semantics_;
@ -1403,7 +1403,7 @@ class PeerConnectionIntegrationBaseTest : public ::testing::Test {
webrtc::PeerConnectionInterface::kIceConnectionCompleted); webrtc::PeerConnectionInterface::kIceConnectionCompleted);
} }
// When |event_log_factory| is null, the default implementation of the event // When `event_log_factory` is null, the default implementation of the event
// log factory will be used. // log factory will be used.
std::unique_ptr<PeerConnectionIntegrationWrapper> CreatePeerConnectionWrapper( std::unique_ptr<PeerConnectionIntegrationWrapper> CreatePeerConnectionWrapper(
const std::string& debug_name, const std::string& debug_name,
@ -1654,8 +1654,8 @@ class PeerConnectionIntegrationBaseTest : public ::testing::Test {
PeerConnectionIntegrationWrapper* caller() { return caller_.get(); } PeerConnectionIntegrationWrapper* caller() { return caller_.get(); }
// Set the |caller_| to the |wrapper| passed in and return the // Set the `caller_` to the `wrapper` passed in and return the
// original |caller_|. // original `caller_`.
PeerConnectionIntegrationWrapper* SetCallerPcWrapperAndReturnCurrent( PeerConnectionIntegrationWrapper* SetCallerPcWrapperAndReturnCurrent(
PeerConnectionIntegrationWrapper* wrapper) { PeerConnectionIntegrationWrapper* wrapper) {
PeerConnectionIntegrationWrapper* old = caller_.release(); PeerConnectionIntegrationWrapper* old = caller_.release();
@ -1665,8 +1665,8 @@ class PeerConnectionIntegrationBaseTest : public ::testing::Test {
PeerConnectionIntegrationWrapper* callee() { return callee_.get(); } PeerConnectionIntegrationWrapper* callee() { return callee_.get(); }
// Set the |callee_| to the |wrapper| passed in and return the // Set the `callee_` to the `wrapper` passed in and return the
// original |callee_|. // original `callee_`.
PeerConnectionIntegrationWrapper* SetCalleePcWrapperAndReturnCurrent( PeerConnectionIntegrationWrapper* SetCalleePcWrapperAndReturnCurrent(
PeerConnectionIntegrationWrapper* wrapper) { PeerConnectionIntegrationWrapper* wrapper) {
PeerConnectionIntegrationWrapper* old = callee_.release(); PeerConnectionIntegrationWrapper* old = callee_.release();
@ -1687,7 +1687,7 @@ class PeerConnectionIntegrationBaseTest : public ::testing::Test {
// Expects the provided number of new frames to be received within // Expects the provided number of new frames to be received within
// kMaxWaitForFramesMs. The new expected frames are specified in // kMaxWaitForFramesMs. The new expected frames are specified in
// |media_expectations|. Returns false if any of the expectations were // `media_expectations`. Returns false if any of the expectations were
// not met. // not met.
bool ExpectNewFrames(const MediaExpectations& media_expectations) { bool ExpectNewFrames(const MediaExpectations& media_expectations) {
// Make sure there are no bogus tracks confusing the issue. // Make sure there are no bogus tracks confusing the issue.
@ -1841,11 +1841,11 @@ class PeerConnectionIntegrationBaseTest : public ::testing::Test {
SdpSemantics sdp_semantics_; SdpSemantics sdp_semantics_;
private: private:
// |ss_| is used by |network_thread_| so it must be destroyed later. // `ss_` is used by `network_thread_` so it must be destroyed later.
std::unique_ptr<rtc::VirtualSocketServer> ss_; std::unique_ptr<rtc::VirtualSocketServer> ss_;
std::unique_ptr<rtc::FirewallSocketServer> fss_; std::unique_ptr<rtc::FirewallSocketServer> fss_;
// |network_thread_| and |worker_thread_| are used by both // `network_thread_` and `worker_thread_` are used by both
// |caller_| and |callee_| so they must be destroyed // `caller_` and `callee_` so they must be destroyed
// later. // later.
std::unique_ptr<rtc::Thread> network_thread_; std::unique_ptr<rtc::Thread> network_thread_;
std::unique_ptr<rtc::Thread> worker_thread_; std::unique_ptr<rtc::Thread> worker_thread_;

View file

@ -188,7 +188,7 @@ void PeerConnectionTestWrapper::OnDataChannel(
} }
void PeerConnectionTestWrapper::OnSuccess(SessionDescriptionInterface* desc) { void PeerConnectionTestWrapper::OnSuccess(SessionDescriptionInterface* desc) {
// This callback should take the ownership of |desc|. // This callback should take the ownership of `desc`.
std::unique_ptr<SessionDescriptionInterface> owned_desc(desc); std::unique_ptr<SessionDescriptionInterface> owned_desc(desc);
std::string sdp; std::string sdp;
EXPECT_TRUE(desc->ToString(&sdp)); EXPECT_TRUE(desc->ToString(&sdp));

View file

@ -56,7 +56,7 @@ void GetAudioAndVideoTrackBySsrc(
if (!track) { if (!track) {
continue; continue;
} }
// TODO(deadbeef): |ssrc| should be removed in favor of |GetParameters|. // TODO(deadbeef): `ssrc` should be removed in favor of `GetParameters`.
uint32_t ssrc = rtp_sender->ssrc(); uint32_t ssrc = rtp_sender->ssrc();
if (ssrc != 0) { if (ssrc != 0) {
if (media_type == cricket::MEDIA_TYPE_AUDIO) { if (media_type == cricket::MEDIA_TYPE_AUDIO) {

View file

@ -112,7 +112,7 @@ class TrackMediaInfoMapTest : public ::testing::Test {
~TrackMediaInfoMapTest() { ~TrackMediaInfoMapTest() {
// If we have a map the ownership has been passed to the map, only delete if // If we have a map the ownership has been passed to the map, only delete if
// |CreateMap| has not been called. // `CreateMap` has not been called.
if (!map_) { if (!map_) {
delete voice_media_info_; delete voice_media_info_;
delete video_media_info_; delete video_media_info_;

View file

@ -25,14 +25,14 @@ enum class UsageEvent : int {
DATA_ADDED = 0x04, DATA_ADDED = 0x04,
AUDIO_ADDED = 0x08, AUDIO_ADDED = 0x08,
VIDEO_ADDED = 0x10, VIDEO_ADDED = 0x10,
// |SetLocalDescription| returns successfully. // `SetLocalDescription` returns successfully.
SET_LOCAL_DESCRIPTION_SUCCEEDED = 0x20, SET_LOCAL_DESCRIPTION_SUCCEEDED = 0x20,
// |SetRemoteDescription| returns successfully. // `SetRemoteDescription` returns successfully.
SET_REMOTE_DESCRIPTION_SUCCEEDED = 0x40, SET_REMOTE_DESCRIPTION_SUCCEEDED = 0x40,
// A local candidate (with type host, server-reflexive, or relay) is // A local candidate (with type host, server-reflexive, or relay) is
// collected. // collected.
CANDIDATE_COLLECTED = 0x80, CANDIDATE_COLLECTED = 0x80,
// A remote candidate is successfully added via |AddIceCandidate|. // A remote candidate is successfully added via `AddIceCandidate`.
ADD_ICE_CANDIDATE_SUCCEEDED = 0x100, ADD_ICE_CANDIDATE_SUCCEEDED = 0x100,
ICE_STATE_CONNECTED = 0x200, ICE_STATE_CONNECTED = 0x200,
CLOSE_CALLED = 0x400, CLOSE_CALLED = 0x400,

View file

@ -28,7 +28,7 @@ class UsedIds {
next_id_(max_allowed_id) {} next_id_(max_allowed_id) {}
virtual ~UsedIds() {} virtual ~UsedIds() {}
// Loops through all Id in |ids| and changes its id if it is // Loops through all Id in `ids` and changes its id if it is
// already in use by another IdStruct. Call this methods with all Id // already in use by another IdStruct. Call this methods with all Id
// in a session description to make sure no duplicate ids exists. // in a session description to make sure no duplicate ids exists.
// Note that typename Id must be a type of IdStruct. // Note that typename Id must be a type of IdStruct.
@ -39,7 +39,7 @@ class UsedIds {
} }
} }
// Finds and sets an unused id if the |idstruct| id is already in use. // Finds and sets an unused id if the `idstruct` id is already in use.
void FindAndSetIdUsed(IdStruct* idstruct) { void FindAndSetIdUsed(IdStruct* idstruct) {
const int original_id = idstruct->id; const int original_id = idstruct->id;
int new_id = idstruct->id; int new_id = idstruct->id;
@ -141,7 +141,7 @@ class UsedRtpHeaderExtensionIds : public UsedIds<webrtc::RtpExtension> {
// header extensions. This hopefully reduce the risk of more collisions. We // header extensions. This hopefully reduce the risk of more collisions. We
// want to change the default ids as little as possible. If no unused id is // want to change the default ids as little as possible. If no unused id is
// found and two byte header extensions are enabled (i.e., // found and two byte header extensions are enabled (i.e.,
// |extmap_allow_mixed_| is true), search for unused ids from 15 to 255. // `extmap_allow_mixed_` is true), search for unused ids from 15 to 255.
int FindUnusedId() override { int FindUnusedId() override {
if (next_extension_id_ <= if (next_extension_id_ <=
webrtc::RtpExtension::kOneByteHeaderExtensionMaxId) { webrtc::RtpExtension::kOneByteHeaderExtensionMaxId) {

View file

@ -146,7 +146,7 @@ class VideoRtpReceiver : public RtpReceiverInternal {
cricket::VideoMediaChannel* media_channel_ RTC_GUARDED_BY(worker_thread_) = cricket::VideoMediaChannel* media_channel_ RTC_GUARDED_BY(worker_thread_) =
nullptr; nullptr;
absl::optional<uint32_t> ssrc_ RTC_GUARDED_BY(worker_thread_); absl::optional<uint32_t> ssrc_ RTC_GUARDED_BY(worker_thread_);
// |source_| is held here to be able to change the state of the source when // `source_` is held here to be able to change the state of the source when
// the VideoRtpReceiver is stopped. // the VideoRtpReceiver is stopped.
const rtc::scoped_refptr<VideoRtpTrackSource> source_; const rtc::scoped_refptr<VideoRtpTrackSource> source_;
const rtc::scoped_refptr<VideoTrackProxyWithInternal<VideoTrack>> track_; const rtc::scoped_refptr<VideoTrackProxyWithInternal<VideoTrack>> track_;
@ -173,10 +173,10 @@ class VideoRtpReceiver : public RtpReceiverInternal {
rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_ rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_
RTC_GUARDED_BY(worker_thread_); RTC_GUARDED_BY(worker_thread_);
// Stores the minimum jitter buffer delay. Handles caching cases // Stores the minimum jitter buffer delay. Handles caching cases
// if |SetJitterBufferMinimumDelay| is called before start. // if `SetJitterBufferMinimumDelay` is called before start.
JitterBufferDelay delay_ RTC_GUARDED_BY(worker_thread_); JitterBufferDelay delay_ RTC_GUARDED_BY(worker_thread_);
// Records if we should generate a keyframe when |media_channel_| gets set up // Records if we should generate a keyframe when `media_channel_` gets set up
// or switched. // or switched.
bool saved_generate_keyframe_ RTC_GUARDED_BY(worker_thread_) = false; bool saved_generate_keyframe_ RTC_GUARDED_BY(worker_thread_) = false;
bool saved_encoded_sink_enabled_ RTC_GUARDED_BY(worker_thread_) = false; bool saved_encoded_sink_enabled_ RTC_GUARDED_BY(worker_thread_) = false;

View file

@ -75,7 +75,7 @@ class VideoRtpTrackSource : public VideoTrackSource {
private: private:
RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_sequence_checker_; RTC_NO_UNIQUE_ADDRESS SequenceChecker worker_sequence_checker_;
// |broadcaster_| is needed since the decoder can only handle one sink. // `broadcaster_` is needed since the decoder can only handle one sink.
// It might be better if the decoder can handle multiple sinks and consider // It might be better if the decoder can handle multiple sinks and consider
// the VideoSinkWants. // the VideoSinkWants.
rtc::VideoBroadcaster broadcaster_; rtc::VideoBroadcaster broadcaster_;

View file

@ -54,7 +54,7 @@ class VideoTrack : public MediaStreamTrack<VideoTrackInterface>,
~VideoTrack(); ~VideoTrack();
private: private:
// Implements ObserverInterface. Observes |video_source_| state. // Implements ObserverInterface. Observes `video_source_` state.
void OnChanged() override; void OnChanged() override;
RTC_NO_UNIQUE_ADDRESS webrtc::SequenceChecker signaling_thread_; RTC_NO_UNIQUE_ADDRESS webrtc::SequenceChecker signaling_thread_;

View file

@ -54,14 +54,14 @@ TEST_F(VideoTrackTest, SourceStateChangeTrackState) {
// Test adding renderers to a video track and render to them by providing // Test adding renderers to a video track and render to them by providing
// frames to the source. // frames to the source.
TEST_F(VideoTrackTest, RenderVideo) { TEST_F(VideoTrackTest, RenderVideo) {
// FakeVideoTrackRenderer register itself to |video_track_| // FakeVideoTrackRenderer register itself to `video_track_`
std::unique_ptr<FakeVideoTrackRenderer> renderer_1( std::unique_ptr<FakeVideoTrackRenderer> renderer_1(
new FakeVideoTrackRenderer(video_track_.get())); new FakeVideoTrackRenderer(video_track_.get()));
video_track_source_->InjectFrame(frame_source_.GetFrame()); video_track_source_->InjectFrame(frame_source_.GetFrame());
EXPECT_EQ(1, renderer_1->num_rendered_frames()); EXPECT_EQ(1, renderer_1->num_rendered_frames());
// FakeVideoTrackRenderer register itself to |video_track_| // FakeVideoTrackRenderer register itself to `video_track_`
std::unique_ptr<FakeVideoTrackRenderer> renderer_2( std::unique_ptr<FakeVideoTrackRenderer> renderer_2(
new FakeVideoTrackRenderer(video_track_.get())); new FakeVideoTrackRenderer(video_track_.get()));
video_track_source_->InjectFrame(frame_source_.GetFrame()); video_track_source_->InjectFrame(frame_source_.GetFrame());

View file

@ -388,19 +388,19 @@ static void RemoveInvalidRidsFromSimulcast(
// Helper functions // Helper functions
// Below ParseFailed*** functions output the line that caused the parsing // Below ParseFailed*** functions output the line that caused the parsing
// failure and the detailed reason (|description|) of the failure to |error|. // failure and the detailed reason (`description`) of the failure to `error`.
// The functions always return false so that they can be used directly in the // The functions always return false so that they can be used directly in the
// following way when error happens: // following way when error happens:
// "return ParseFailed***(...);" // "return ParseFailed***(...);"
// The line starting at |line_start| of |message| is the failing line. // The line starting at `line_start` of `message` is the failing line.
// The reason for the failure should be provided in the |description|. // The reason for the failure should be provided in the `description`.
// An example of a description could be "unknown character". // An example of a description could be "unknown character".
static bool ParseFailed(const std::string& message, static bool ParseFailed(const std::string& message,
size_t line_start, size_t line_start,
const std::string& description, const std::string& description,
SdpParseError* error) { SdpParseError* error) {
// Get the first line of |message| from |line_start|. // Get the first line of `message` from `line_start`.
std::string first_line; std::string first_line;
size_t line_end = message.find(kNewLine, line_start); size_t line_end = message.find(kNewLine, line_start);
if (line_end != std::string::npos) { if (line_end != std::string::npos) {
@ -421,8 +421,8 @@ static bool ParseFailed(const std::string& message,
return false; return false;
} }
// |line| is the failing line. The reason for the failure should be // `line` is the failing line. The reason for the failure should be
// provided in the |description|. // provided in the `description`.
static bool ParseFailed(const std::string& line, static bool ParseFailed(const std::string& line,
const std::string& description, const std::string& description,
SdpParseError* error) { SdpParseError* error) {
@ -435,8 +435,8 @@ static bool ParseFailed(const std::string& description, SdpParseError* error) {
return ParseFailed("", description, error); return ParseFailed("", description, error);
} }
// |line| is the failing line. The failure is due to the fact that |line| // `line` is the failing line. The failure is due to the fact that `line`
// doesn't have |expected_fields| fields. // doesn't have `expected_fields` fields.
static bool ParseFailedExpectFieldNum(const std::string& line, static bool ParseFailedExpectFieldNum(const std::string& line,
int expected_fields, int expected_fields,
SdpParseError* error) { SdpParseError* error) {
@ -445,8 +445,8 @@ static bool ParseFailedExpectFieldNum(const std::string& line,
return ParseFailed(line, description.str(), error); return ParseFailed(line, description.str(), error);
} }
// |line| is the failing line. The failure is due to the fact that |line| has // `line` is the failing line. The failure is due to the fact that `line` has
// less than |expected_min_fields| fields. // less than `expected_min_fields` fields.
static bool ParseFailedExpectMinFieldNum(const std::string& line, static bool ParseFailedExpectMinFieldNum(const std::string& line,
int expected_min_fields, int expected_min_fields,
SdpParseError* error) { SdpParseError* error) {
@ -455,8 +455,8 @@ static bool ParseFailedExpectMinFieldNum(const std::string& line,
return ParseFailed(line, description.str(), error); return ParseFailed(line, description.str(), error);
} }
// |line| is the failing line. The failure is due to the fact that it failed to // `line` is the failing line. The failure is due to the fact that it failed to
// get the value of |attribute|. // get the value of `attribute`.
static bool ParseFailedGetValue(const std::string& line, static bool ParseFailedGetValue(const std::string& line,
const std::string& attribute, const std::string& attribute,
SdpParseError* error) { SdpParseError* error) {
@ -465,10 +465,10 @@ static bool ParseFailedGetValue(const std::string& line,
return ParseFailed(line, description.str(), error); return ParseFailed(line, description.str(), error);
} }
// The line starting at |line_start| of |message| is the failing line. The // The line starting at `line_start` of `message` is the failing line. The
// failure is due to the line type (e.g. the "m" part of the "m-line") // failure is due to the line type (e.g. the "m" part of the "m-line")
// not matching what is expected. The expected line type should be // not matching what is expected. The expected line type should be
// provided as |line_type|. // provided as `line_type`.
static bool ParseFailedExpectLine(const std::string& message, static bool ParseFailedExpectLine(const std::string& message,
size_t line_start, size_t line_start,
const char line_type, const char line_type,
@ -527,7 +527,7 @@ static bool GetLine(const std::string& message,
return true; return true;
} }
// Init |os| to "|type|=|value|". // Init `os` to "`type`=`value`".
static void InitLine(const char type, static void InitLine(const char type,
const std::string& value, const std::string& value,
rtc::StringBuilder* os) { rtc::StringBuilder* os) {
@ -535,12 +535,12 @@ static void InitLine(const char type,
*os << std::string(1, type) << kSdpDelimiterEqual << value; *os << std::string(1, type) << kSdpDelimiterEqual << value;
} }
// Init |os| to "a=|attribute|". // Init `os` to "a=`attribute`".
static void InitAttrLine(const std::string& attribute, rtc::StringBuilder* os) { static void InitAttrLine(const std::string& attribute, rtc::StringBuilder* os) {
InitLine(kLineTypeAttributes, attribute, os); InitLine(kLineTypeAttributes, attribute, os);
} }
// Writes a SDP attribute line based on |attribute| and |value| to |message|. // Writes a SDP attribute line based on `attribute` and `value` to `message`.
static void AddAttributeLine(const std::string& attribute, static void AddAttributeLine(const std::string& attribute,
int value, int value,
std::string* message) { std::string* message) {
@ -690,7 +690,7 @@ void CreateTrackWithNoSsrcs(const std::vector<std::string>& msid_stream_ids,
} }
// Creates the StreamParams tracks, for the case when SSRC lines are signaled. // Creates the StreamParams tracks, for the case when SSRC lines are signaled.
// |msid_stream_ids| and |msid_track_id| represent the stream/track ID from the // `msid_stream_ids` and `msid_track_id` represent the stream/track ID from the
// "a=msid" attribute, if it exists. They are empty if the attribute does not // "a=msid" attribute, if it exists. They are empty if the attribute does not
// exist. We prioritize getting stream_ids/track_ids signaled in a=msid lines. // exist. We prioritize getting stream_ids/track_ids signaled in a=msid lines.
void CreateTracksFromSsrcInfos(const SsrcInfoVec& ssrc_infos, void CreateTracksFromSsrcInfos(const SsrcInfoVec& ssrc_infos,
@ -784,11 +784,11 @@ static int GetCandidatePreferenceFromType(const std::string& type) {
return preference; return preference;
} }
// Get ip and port of the default destination from the |candidates| with the // Get ip and port of the default destination from the `candidates` with the
// given value of |component_id|. The default candidate should be the one most // given value of `component_id`. The default candidate should be the one most
// likely to work, typically IPv4 relay. // likely to work, typically IPv4 relay.
// RFC 5245 // RFC 5245
// The value of |component_id| currently supported are 1 (RTP) and 2 (RTCP). // The value of `component_id` currently supported are 1 (RTP) and 2 (RTCP).
// TODO(deadbeef): Decide the default destination in webrtcsession and // TODO(deadbeef): Decide the default destination in webrtcsession and
// pass it down via SessionDescription. // pass it down via SessionDescription.
static void GetDefaultDestination(const std::vector<Candidate>& candidates, static void GetDefaultDestination(const std::vector<Candidate>& candidates,
@ -831,7 +831,7 @@ static void GetDefaultDestination(const std::vector<Candidate>& candidates,
} }
} }
// Gets "a=rtcp" line if found default RTCP candidate from |candidates|. // Gets "a=rtcp" line if found default RTCP candidate from `candidates`.
static std::string GetRtcpLine(const std::vector<Candidate>& candidates) { static std::string GetRtcpLine(const std::vector<Candidate>& candidates) {
std::string rtcp_line, rtcp_port, rtcp_ip, addr_type; std::string rtcp_line, rtcp_port, rtcp_ip, addr_type;
GetDefaultDestination(candidates, ICE_CANDIDATE_COMPONENT_RTCP, &rtcp_port, GetDefaultDestination(candidates, ICE_CANDIDATE_COMPONENT_RTCP, &rtcp_port,
@ -1046,12 +1046,12 @@ bool ParseCandidate(const std::string& message,
bool is_raw) { bool is_raw) {
RTC_DCHECK(candidate != NULL); RTC_DCHECK(candidate != NULL);
// Get the first line from |message|. // Get the first line from `message`.
std::string first_line = message; std::string first_line = message;
size_t pos = 0; size_t pos = 0;
GetLine(message, &pos, &first_line); GetLine(message, &pos, &first_line);
// Makes sure |message| contains only one line. // Makes sure `message` contains only one line.
if (message.size() > first_line.size()) { if (message.size() > first_line.size()) {
std::string left, right; std::string left, right;
if (rtc::tokenize_first(message, kNewLineChar, &left, &right) && if (rtc::tokenize_first(message, kNewLineChar, &left, &right) &&
@ -1071,7 +1071,7 @@ bool ParseCandidate(const std::string& message,
std::string attribute_candidate; std::string attribute_candidate;
std::string candidate_value; std::string candidate_value;
// |first_line| must be in the form of "candidate:<value>". // `first_line` must be in the form of "candidate:<value>".
if (!rtc::tokenize_first(first_line, kSdpDelimiterColonChar, if (!rtc::tokenize_first(first_line, kSdpDelimiterColonChar,
&attribute_candidate, &candidate_value) || &attribute_candidate, &candidate_value) ||
attribute_candidate != kAttributeCandidate) { attribute_candidate != kAttributeCandidate) {
@ -1772,23 +1772,23 @@ void BuildRtpContentAttributes(const MediaContentDescription* media_desc,
} }
void WriteFmtpHeader(int payload_type, rtc::StringBuilder* os) { void WriteFmtpHeader(int payload_type, rtc::StringBuilder* os) {
// fmtp header: a=fmtp:|payload_type| <parameters> // fmtp header: a=fmtp:`payload_type` <parameters>
// Add a=fmtp // Add a=fmtp
InitAttrLine(kAttributeFmtp, os); InitAttrLine(kAttributeFmtp, os);
// Add :|payload_type| // Add :`payload_type`
*os << kSdpDelimiterColon << payload_type; *os << kSdpDelimiterColon << payload_type;
} }
void WritePacketizationHeader(int payload_type, rtc::StringBuilder* os) { void WritePacketizationHeader(int payload_type, rtc::StringBuilder* os) {
// packetization header: a=packetization:|payload_type| <packetization_format> // packetization header: a=packetization:`payload_type` <packetization_format>
// Add a=packetization // Add a=packetization
InitAttrLine(kAttributePacketization, os); InitAttrLine(kAttributePacketization, os);
// Add :|payload_type| // Add :`payload_type`
*os << kSdpDelimiterColon << payload_type; *os << kSdpDelimiterColon << payload_type;
} }
void WriteRtcpFbHeader(int payload_type, rtc::StringBuilder* os) { void WriteRtcpFbHeader(int payload_type, rtc::StringBuilder* os) {
// rtcp-fb header: a=rtcp-fb:|payload_type| // rtcp-fb header: a=rtcp-fb:`payload_type`
// <parameters>/<ccm <ccm_parameters>> // <parameters>/<ccm <ccm_parameters>>
// Add a=rtcp-fb // Add a=rtcp-fb
InitAttrLine(kAttributeRtcpFb, os); InitAttrLine(kAttributeRtcpFb, os);
@ -1808,7 +1808,7 @@ void WriteFmtpParameter(const std::string& parameter_name,
// RFC 2198 and RFC 4733 don't use key-value pairs. // RFC 2198 and RFC 4733 don't use key-value pairs.
*os << parameter_value; *os << parameter_value;
} else { } else {
// fmtp parameters: |parameter_name|=|parameter_value| // fmtp parameters: `parameter_name`=`parameter_value`
*os << parameter_name << kSdpDelimiterEqual << parameter_value; *os << parameter_name << kSdpDelimiterEqual << parameter_value;
} }
} }
@ -2469,7 +2469,7 @@ static SimulcastLayerList RemoveRidsFromSimulcastLayerList(
// Will remove Simulcast Layers if: // Will remove Simulcast Layers if:
// 1. They appear in both send and receive directions. // 1. They appear in both send and receive directions.
// 2. They do not appear in the list of |valid_rids|. // 2. They do not appear in the list of `valid_rids`.
static void RemoveInvalidRidsFromSimulcast( static void RemoveInvalidRidsFromSimulcast(
const std::vector<RidDescription>& valid_rids, const std::vector<RidDescription>& valid_rids,
SimulcastDescription* simulcast) { SimulcastDescription* simulcast) {
@ -2668,7 +2668,7 @@ bool ParseMediaDescription(
} }
} }
// Make a temporary TransportDescription based on |session_td|. // Make a temporary TransportDescription based on `session_td`.
// Some of this gets overwritten by ParseContent. // Some of this gets overwritten by ParseContent.
TransportDescription transport( TransportDescription transport(
session_td.transport_options, session_td.ice_ufrag, session_td.ice_pwd, session_td.transport_options, session_td.ice_ufrag, session_td.ice_pwd,
@ -2848,7 +2848,7 @@ void AddFeedbackParameters(const cricket::FeedbackParams& feedback_params,
} }
} }
// Gets the current codec setting associated with |payload_type|. If there // Gets the current codec setting associated with `payload_type`. If there
// is no Codec associated with that payload type it returns an empty codec // is no Codec associated with that payload type it returns an empty codec
// with that payload type. // with that payload type.
template <class T> template <class T>
@ -2856,7 +2856,7 @@ T GetCodecWithPayloadType(const std::vector<T>& codecs, int payload_type) {
const T* codec = FindCodecById(codecs, payload_type); const T* codec = FindCodecById(codecs, payload_type);
if (codec) if (codec)
return *codec; return *codec;
// Return empty codec with |payload_type|. // Return empty codec with `payload_type`.
T ret_val; T ret_val;
ret_val.id = payload_type; ret_val.id = payload_type;
return ret_val; return ret_val;
@ -2883,8 +2883,8 @@ void AddOrReplaceCodec(MediaContentDescription* content_desc, const U& codec) {
desc->set_codecs(codecs); desc->set_codecs(codecs);
} }
// Adds or updates existing codec corresponding to |payload_type| according // Adds or updates existing codec corresponding to `payload_type` according
// to |parameters|. // to `parameters`.
template <class T, class U> template <class T, class U>
void UpdateCodec(MediaContentDescription* content_desc, void UpdateCodec(MediaContentDescription* content_desc,
int payload_type, int payload_type,
@ -2896,8 +2896,8 @@ void UpdateCodec(MediaContentDescription* content_desc,
AddOrReplaceCodec<T, U>(content_desc, new_codec); AddOrReplaceCodec<T, U>(content_desc, new_codec);
} }
// Adds or updates existing codec corresponding to |payload_type| according // Adds or updates existing codec corresponding to `payload_type` according
// to |feedback_param|. // to `feedback_param`.
template <class T, class U> template <class T, class U>
void UpdateCodec(MediaContentDescription* content_desc, void UpdateCodec(MediaContentDescription* content_desc,
int payload_type, int payload_type,
@ -2909,8 +2909,8 @@ void UpdateCodec(MediaContentDescription* content_desc,
AddOrReplaceCodec<T, U>(content_desc, new_codec); AddOrReplaceCodec<T, U>(content_desc, new_codec);
} }
// Adds or updates existing video codec corresponding to |payload_type| // Adds or updates existing video codec corresponding to `payload_type`
// according to |packetization|. // according to `packetization`.
void UpdateVideoCodecPacketization(VideoContentDescription* video_desc, void UpdateVideoCodecPacketization(VideoContentDescription* video_desc,
int payload_type, int payload_type,
const std::string& packetization) { const std::string& packetization) {
@ -3322,7 +3322,7 @@ bool ParseContent(const std::string& message,
media_desc->set_receive_rids(receive_rids); media_desc->set_receive_rids(receive_rids);
// Create tracks from the |ssrc_infos|. // Create tracks from the `ssrc_infos`.
// If the stream_id/track_id for all SSRCS are identical, one StreamParams // If the stream_id/track_id for all SSRCS are identical, one StreamParams
// will be created in CreateTracksFromSsrcInfos, containing all the SSRCs from // will be created in CreateTracksFromSsrcInfos, containing all the SSRCs from
// the m= section. // the m= section.
@ -3351,7 +3351,7 @@ bool ParseContent(const std::string& message,
} }
} }
// Add the new tracks to the |media_desc|. // Add the new tracks to the `media_desc`.
for (StreamParams& track : tracks) { for (StreamParams& track : tracks) {
media_desc->AddStream(track); media_desc->AddStream(track);
} }
@ -3429,7 +3429,7 @@ bool ParseSsrcAttribute(const std::string& line,
return ParseFailed(line, description.str(), error); return ParseFailed(line, description.str(), error);
} }
// Check if there's already an item for this |ssrc_id|. Create a new one if // Check if there's already an item for this `ssrc_id`. Create a new one if
// there isn't. // there isn't.
auto ssrc_info_it = auto ssrc_info_it =
absl::c_find_if(*ssrc_infos, [ssrc_id](const SsrcInfo& ssrc_info) { absl::c_find_if(*ssrc_infos, [ssrc_id](const SsrcInfo& ssrc_info) {
@ -3443,7 +3443,7 @@ bool ParseSsrcAttribute(const std::string& line,
} }
SsrcInfo& ssrc_info = *ssrc_info_it; SsrcInfo& ssrc_info = *ssrc_info_it;
// Store the info to the |ssrc_info|. // Store the info to the `ssrc_info`.
if (attribute == kSsrcAttributeCname) { if (attribute == kSsrcAttributeCname) {
// RFC 5576 // RFC 5576
// cname:<value> // cname:<value>
@ -3533,7 +3533,7 @@ bool ParseCryptoAttribute(const std::string& line,
} }
// Updates or creates a new codec entry in the audio description with according // Updates or creates a new codec entry in the audio description with according
// to |name|, |clockrate|, |bitrate|, and |channels|. // to `name`, `clockrate`, `bitrate`, and `channels`.
void UpdateCodec(int payload_type, void UpdateCodec(int payload_type,
const std::string& name, const std::string& name,
int clockrate, int clockrate,
@ -3553,7 +3553,7 @@ void UpdateCodec(int payload_type,
} }
// Updates or creates a new codec entry in the video description according to // Updates or creates a new codec entry in the video description according to
// |name|, |width|, |height|, and |framerate|. // `name`, `width`, `height`, and `framerate`.
void UpdateCodec(int payload_type, void UpdateCodec(int payload_type,
const std::string& name, const std::string& name,
VideoContentDescription* video_desc) { VideoContentDescription* video_desc) {

View file

@ -94,18 +94,18 @@ RTC_EXPORT bool SdpDeserializeCandidate(const std::string& transport_name,
cricket::Candidate* candidate, cricket::Candidate* candidate,
SdpParseError* error); SdpParseError* error);
// Parses |message| according to the grammar defined in RFC 5245, Section 15.1 // Parses `message` according to the grammar defined in RFC 5245, Section 15.1
// and, if successful, stores the result in |candidate| and returns true. // and, if successful, stores the result in `candidate` and returns true.
// If unsuccessful, returns false and stores error information in |error| if // If unsuccessful, returns false and stores error information in `error` if
// |error| is not null. // `error` is not null.
// If |is_raw| is false, |message| is expected to be prefixed with "a=". // If `is_raw` is false, `message` is expected to be prefixed with "a=".
// If |is_raw| is true, no prefix is expected in |messaage|. // If `is_raw` is true, no prefix is expected in `messaage`.
RTC_EXPORT bool ParseCandidate(const std::string& message, RTC_EXPORT bool ParseCandidate(const std::string& message,
cricket::Candidate* candidate, cricket::Candidate* candidate,
SdpParseError* error, SdpParseError* error,
bool is_raw); bool is_raw);
// Generates an FMTP line based on |parameters|. Please note that some // Generates an FMTP line based on `parameters`. Please note that some
// parameters are not considered to be part of the FMTP line, see the function // parameters are not considered to be part of the FMTP line, see the function
// IsFmtpParam(). Returns true if the set of FMTP parameters is nonempty, false // IsFmtpParam(). Returns true if the set of FMTP parameters is nonempty, false
// otherwise. // otherwise.

View file

@ -907,7 +907,7 @@ static bool SdpDeserializeCandidate(const std::string& message,
return webrtc::SdpDeserializeCandidate(message, candidate, NULL); return webrtc::SdpDeserializeCandidate(message, candidate, NULL);
} }
// Add some extra |newlines| to the |message| after |line|. // Add some extra `newlines` to the `message` after `line`.
static void InjectAfter(const std::string& line, static void InjectAfter(const std::string& line,
const std::string& newlines, const std::string& newlines,
std::string* message) { std::string* message) {
@ -920,8 +920,8 @@ static void Replace(const std::string& line,
absl::StrReplaceAll({{line, newlines}}, message); absl::StrReplaceAll({{line, newlines}}, message);
} }
// Expect a parse failure on the line containing |bad_part| when attempting to // Expect a parse failure on the line containing `bad_part` when attempting to
// parse |bad_sdp|. // parse `bad_sdp`.
static void ExpectParseFailure(const std::string& bad_sdp, static void ExpectParseFailure(const std::string& bad_sdp,
const std::string& bad_part) { const std::string& bad_part) {
JsepSessionDescription desc(kDummyType); JsepSessionDescription desc(kDummyType);
@ -932,14 +932,14 @@ static void ExpectParseFailure(const std::string& bad_sdp,
<< "Did not find " << bad_part << " in " << error.line; << "Did not find " << bad_part << " in " << error.line;
} }
// Expect fail to parse kSdpFullString if replace |good_part| with |bad_part|. // Expect fail to parse kSdpFullString if replace `good_part` with `bad_part`.
static void ExpectParseFailure(const char* good_part, const char* bad_part) { static void ExpectParseFailure(const char* good_part, const char* bad_part) {
std::string bad_sdp = kSdpFullString; std::string bad_sdp = kSdpFullString;
Replace(good_part, bad_part, &bad_sdp); Replace(good_part, bad_part, &bad_sdp);
ExpectParseFailure(bad_sdp, bad_part); ExpectParseFailure(bad_sdp, bad_part);
} }
// Expect fail to parse kSdpFullString if add |newlines| after |injectpoint|. // Expect fail to parse kSdpFullString if add `newlines` after `injectpoint`.
static void ExpectParseFailureWithNewLines(const std::string& injectpoint, static void ExpectParseFailureWithNewLines(const std::string& injectpoint,
const std::string& newlines, const std::string& newlines,
const std::string& bad_part) { const std::string& bad_part) {
@ -1583,7 +1583,7 @@ class WebRtcSdpTest : public ::testing::Test {
return true; return true;
} }
// Disable the ice-ufrag and ice-pwd in given |sdp| message by replacing // Disable the ice-ufrag and ice-pwd in given `sdp` message by replacing
// them with invalid keywords so that the parser will just ignore them. // them with invalid keywords so that the parser will just ignore them.
bool RemoveCandidateUfragPwd(std::string* sdp) { bool RemoveCandidateUfragPwd(std::string* sdp) {
absl::StrReplaceAll( absl::StrReplaceAll(
@ -1591,7 +1591,7 @@ class WebRtcSdpTest : public ::testing::Test {
return true; return true;
} }
// Update the candidates in |jdesc| to use the given |ufrag| and |pwd|. // Update the candidates in `jdesc` to use the given `ufrag` and `pwd`.
bool UpdateCandidateUfragPwd(JsepSessionDescription* jdesc, bool UpdateCandidateUfragPwd(JsepSessionDescription* jdesc,
int mline_index, int mline_index,
const std::string& ufrag, const std::string& ufrag,
@ -2396,7 +2396,7 @@ TEST_F(WebRtcSdpTest, SerializeSessionDescriptionWithH264) {
ASSERT_NE(before_pt, std::string::npos); ASSERT_NE(before_pt, std::string::npos);
before_pt += strlen("a=rtpmap:"); before_pt += strlen("a=rtpmap:");
std::string pt = message.substr(before_pt, after_pt - before_pt); std::string pt = message.substr(before_pt, after_pt - before_pt);
// TODO(hta): Check if payload type |pt| occurs in the m=video line. // TODO(hta): Check if payload type `pt` occurs in the m=video line.
std::string to_find = "a=fmtp:" + pt + " "; std::string to_find = "a=fmtp:" + pt + " ";
size_t fmtp_pos = message.find(to_find); size_t fmtp_pos = message.find(to_find);
ASSERT_NE(std::string::npos, fmtp_pos) << "Failed to find " << to_find; ASSERT_NE(std::string::npos, fmtp_pos) << "Failed to find " << to_find;
@ -3670,7 +3670,7 @@ TEST_F(WebRtcSdpTest, SerializeDtlsSetupAttribute) {
// Fingerprint attribute is necessary to add DTLS setup attribute. // Fingerprint attribute is necessary to add DTLS setup attribute.
InjectAfter(kAttributeIcePwdVoice, kFingerprint, &sdp_with_dtlssetup); InjectAfter(kAttributeIcePwdVoice, kFingerprint, &sdp_with_dtlssetup);
InjectAfter(kAttributeIcePwdVideo, kFingerprint, &sdp_with_dtlssetup); InjectAfter(kAttributeIcePwdVideo, kFingerprint, &sdp_with_dtlssetup);
// Now adding |setup| attribute. // Now adding `setup` attribute.
InjectAfter(kFingerprint, "a=setup:active\r\n", &sdp_with_dtlssetup); InjectAfter(kFingerprint, "a=setup:active\r\n", &sdp_with_dtlssetup);
EXPECT_EQ(sdp_with_dtlssetup, message); EXPECT_EQ(sdp_with_dtlssetup, message);
} }

View file

@ -142,7 +142,7 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
// RFC 4566 suggested a Network Time Protocol (NTP) format timestamp // RFC 4566 suggested a Network Time Protocol (NTP) format timestamp
// as the session id and session version. To simplify, it should be fine // as the session id and session version. To simplify, it should be fine
// to just use a random number as session id and start version from // to just use a random number as session id and start version from
// |kInitSessionVersion|. // `kInitSessionVersion`.
session_version_(kInitSessionVersion), session_version_(kInitSessionVersion),
cert_generator_(dtls_enabled ? std::move(cert_generator) : nullptr), cert_generator_(dtls_enabled ? std::move(cert_generator) : nullptr),
sdp_info_(sdp_info), sdp_info_(sdp_info),
@ -160,13 +160,13 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
// SRTP-SDES is disabled if DTLS is on. // SRTP-SDES is disabled if DTLS is on.
SetSdesPolicy(cricket::SEC_DISABLED); SetSdesPolicy(cricket::SEC_DISABLED);
if (certificate) { if (certificate) {
// Use |certificate|. // Use `certificate`.
certificate_request_state_ = CERTIFICATE_WAITING; certificate_request_state_ = CERTIFICATE_WAITING;
RTC_LOG(LS_VERBOSE) << "DTLS-SRTP enabled; has certificate parameter."; RTC_LOG(LS_VERBOSE) << "DTLS-SRTP enabled; has certificate parameter.";
// We already have a certificate but we wait to do |SetIdentity|; if we do // We already have a certificate but we wait to do `SetIdentity`; if we do
// it in the constructor then the caller has not had a chance to connect to // it in the constructor then the caller has not had a chance to connect to
// |SignalCertificateReady|. // `SignalCertificateReady`.
signaling_thread_->Post( signaling_thread_->Post(
RTC_FROM_HERE, this, MSG_USE_CONSTRUCTOR_CERTIFICATE, RTC_FROM_HERE, this, MSG_USE_CONSTRUCTOR_CERTIFICATE,
new rtc::ScopedRefMessageData<rtc::RTCCertificate>(certificate)); new rtc::ScopedRefMessageData<rtc::RTCCertificate>(certificate));
@ -186,7 +186,7 @@ WebRtcSessionDescriptionFactory::WebRtcSessionDescriptionFactory(
<< key_params.type() << ")."; << key_params.type() << ").";
// Request certificate. This happens asynchronously, so that the caller gets // Request certificate. This happens asynchronously, so that the caller gets
// a chance to connect to |SignalCertificateReady|. // a chance to connect to `SignalCertificateReady`.
cert_generator_->GenerateCertificateAsync(key_params, absl::nullopt, cert_generator_->GenerateCertificateAsync(key_params, absl::nullopt,
callback); callback);
} }
@ -361,7 +361,7 @@ void WebRtcSessionDescriptionFactory::InternalCreateOffer(
// Just increase the version number by one each time when a new offer // Just increase the version number by one each time when a new offer
// is created regardless if it's identical to the previous one or not. // is created regardless if it's identical to the previous one or not.
// The |session_version_| is a uint64_t, the wrap around should not happen. // The `session_version_` is a uint64_t, the wrap around should not happen.
RTC_DCHECK(session_version_ + 1 > session_version_); RTC_DCHECK(session_version_ + 1 > session_version_);
auto offer = std::make_unique<JsepSessionDescription>( auto offer = std::make_unique<JsepSessionDescription>(
SdpType::kOffer, std::move(desc), session_id_, SdpType::kOffer, std::move(desc), session_id_,
@ -419,8 +419,8 @@ void WebRtcSessionDescriptionFactory::InternalCreateAnswer(
// addresses, ports, etc.), the origin line MUST be different in the answer. // addresses, ports, etc.), the origin line MUST be different in the answer.
// In that case, the version number in the "o=" line of the answer is // In that case, the version number in the "o=" line of the answer is
// unrelated to the version number in the o line of the offer. // unrelated to the version number in the o line of the offer.
// Get a new version number by increasing the |session_version_answer_|. // Get a new version number by increasing the `session_version_answer_`.
// The |session_version_| is a uint64_t, the wrap around should not happen. // The `session_version_` is a uint64_t, the wrap around should not happen.
RTC_DCHECK(session_version_ + 1 > session_version_); RTC_DCHECK(session_version_ + 1 > session_version_);
auto answer = std::make_unique<JsepSessionDescription>( auto answer = std::make_unique<JsepSessionDescription>(
SdpType::kAnswer, std::move(desc), session_id_, SdpType::kAnswer, std::move(desc), session_id_,

View file

@ -75,7 +75,7 @@ struct CreateSessionDescriptionRequest {
class WebRtcSessionDescriptionFactory : public rtc::MessageHandler, class WebRtcSessionDescriptionFactory : public rtc::MessageHandler,
public sigslot::has_slots<> { public sigslot::has_slots<> {
public: public:
// Can specify either a |cert_generator| or |certificate| to enable DTLS. If // Can specify either a `cert_generator` or `certificate` to enable DTLS. If
// a certificate generator is given, starts generating the certificate // a certificate generator is given, starts generating the certificate
// asynchronously. If a certificate is given, will use that for identifying // asynchronously. If a certificate is given, will use that for identifying
// over DTLS. If neither is specified, DTLS is disabled. // over DTLS. If neither is specified, DTLS is disabled.