Reland "Use backticks not vertical bars to denote variables in comments for /pc" Original change's description: > Revert "Use backticks not vertical bars to denote variables in comments for /pc" > > This reverts commit 37ee0f5e594dd772ec6d620b5e5ea8a751b684f0. > > Reason for revert: Revert in order to be able to revert https://webrtc-review.googlesource.com/c/src/+/225642 > > Original change's description: > > 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} > > TBR=hta@webrtc.org,titovartem@webrtc.org,webrtc-scoped@luci-project-accounts.iam.gserviceaccount.com > > Change-Id: I5eddd3a14e1f664bf831e5c294fbc4de5f6a88af > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: webrtc:12338 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227082 > Reviewed-by: Björn Terelius <terelius@webrtc.org> > Commit-Queue: Björn Terelius <terelius@webrtc.org> > Cr-Commit-Position: refs/heads/master@{#34577} Bug: webrtc:12338 Change-Id: I96bd229b73613c162d11d75fa4f5934e1b4295c7 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/227087 Commit-Queue: Artem Titov <titovartem@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/master@{#34611}
diff --git a/pc/audio_rtp_receiver.h b/pc/audio_rtp_receiver.h index c346872..aef497d 100644 --- a/pc/audio_rtp_receiver.h +++ b/pc/audio_rtp_receiver.h
@@ -144,7 +144,7 @@ rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_ RTC_GUARDED_BY(&signaling_thread_checker_); // 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_); rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_ RTC_GUARDED_BY(worker_thread_);
diff --git a/pc/channel.cc b/pc/channel.cc index 8630703..9e717208f 100644 --- a/pc/channel.cc +++ b/pc/channel.cc
@@ -610,13 +610,13 @@ std::string* error_desc) { // In the case of RIDs (where SSRCs are not negotiated), this method will // generate an SSRC for each layer in StreamParams. That representation will - // be stored internally in |local_streams_|. - // In subsequent offers, the same stream can appear in |streams| again + // be stored internally in `local_streams_`. + // In subsequent offers, the same stream can appear in `streams` again // (without the SSRCs), so it should be looked up using RIDs (if available) // and then by primary SSRC. // 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 - // 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. // Check for streams that have been removed.
diff --git a/pc/channel.h b/pc/channel.h index d1dbe2c..4628c86 100644 --- a/pc/channel.h +++ b/pc/channel.h
@@ -99,7 +99,7 @@ public MediaChannel::NetworkInterface, public webrtc::RtpPacketSinkInterface { 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). // The BaseChannel does not own the UniqueRandomIdGenerator so it is the // responsibility of the user to ensure it outlives this object. @@ -141,7 +141,7 @@ // Set an RTP level transport which could be an RtpTransport without // 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 - // 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; webrtc::RtpTransportInternal* rtp_transport() const { @@ -279,7 +279,7 @@ RtpHeaderExtensions GetDeduplicatedRtpHeaderExtensions( 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. void MaybeAddHandledPayloadType(int payload_type) RTC_RUN_ON(worker_thread()); @@ -350,7 +350,7 @@ // MediaChannel related members that should be accessed from the worker // thread. 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 // call to the worker thread, so it should be safe. bool enabled_ RTC_GUARDED_BY(worker_thread()) = false;
diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc index 581f6de..b38ab94 100644 --- a/pc/channel_unittest.cc +++ b/pc/channel_unittest.cc
@@ -513,7 +513,7 @@ } // 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. bool IsSrtpActive(std::unique_ptr<typename T::Channel>& channel) { RTC_DCHECK(channel.get()); @@ -637,7 +637,7 @@ stream2.ssrcs.push_back(kSsrc2); 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); typename T::Content content1; CreateContent(0, kPcmuCodec, kH264Codec, &content1); @@ -663,7 +663,7 @@ WaitForThreads(); 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; CreateContent(0, kPcmuCodec, kH264Codec, &content3); content3.AddStream(stream2); @@ -755,7 +755,7 @@ CreateContent(0, kPcmuCodec, kH264Codec, &content1); typename T::Content content2; CreateContent(0, kPcmuCodec, kH264Codec, &content2); - // Set |content2| to be InActive. + // Set `content2` to be InActive. content2.set_direction(RtpTransceiverDirection::kInactive); channel1_->Enable(true); @@ -787,7 +787,7 @@ } EXPECT_FALSE(media_channel2()->sending()); // local InActive - // Update |content2| to be RecvOnly. + // Update `content2` to be RecvOnly. content2.set_direction(RtpTransceiverDirection::kRecvOnly); EXPECT_TRUE( channel2_->SetLocalContent(&content2, SdpType::kPrAnswer, NULL)); @@ -803,7 +803,7 @@ } EXPECT_FALSE(media_channel2()->sending()); // local RecvOnly - // Update |content2| to be SendRecv. + // Update `content2` to be SendRecv. content2.set_direction(RtpTransceiverDirection::kSendRecv); EXPECT_TRUE(channel2_->SetLocalContent(&content2, SdpType::kAnswer, NULL)); EXPECT_TRUE(channel1_->SetRemoteContent(&content2, SdpType::kAnswer, NULL)); @@ -836,7 +836,7 @@ ASSERT_TRUE(media_channel1); // 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. WaitForThreads(); media_channel1->set_num_network_route_changes(0); @@ -1067,8 +1067,8 @@ bool secure) { ASSERT_EQ(2, len); int sequence_number1_1 = 0, sequence_number2_2 = 0; - // Only pl_type1 was added to the bundle filter for both |channel1_| - // and |channel2_|. + // Only pl_type1 was added to the bundle filter for both `channel1_` + // and `channel2_`. int pl_type1 = pl_types[0]; int pl_type2 = pl_types[1]; int flags = SSRC_MUX; @@ -1259,7 +1259,7 @@ } // 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. // For example, audio and video may use separate socket options, but initially @@ -1359,7 +1359,7 @@ rtc::Thread::Current()->ProcessMessages(0); } 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) { thread->Invoke<void>(RTC_FROM_HERE, [thread] { ProcessThreadQueue(thread); });
diff --git a/pc/connection_context.cc b/pc/connection_context.cc index 1bb7908..6fdcac3 100644 --- a/pc/connection_context.cc +++ b/pc/connection_context.cc
@@ -145,8 +145,8 @@ worker_thread_->Invoke<void>(RTC_FROM_HERE, [&]() { channel_manager_.reset(nullptr); }); - // Make sure |worker_thread()| and |signaling_thread()| outlive - // |default_socket_factory_| and |default_network_manager_|. + // Make sure `worker_thread()` and `signaling_thread()` outlive + // `default_socket_factory_` and `default_network_manager_`. default_socket_factory_ = nullptr; default_network_manager_ = nullptr;
diff --git a/pc/data_channel_controller.cc b/pc/data_channel_controller.cc index 7a6fd3c..e11647f 100644 --- a/pc/data_channel_controller.cc +++ b/pc/data_channel_controller.cc
@@ -176,7 +176,7 @@ RTC_DCHECK_RUN_ON(network_thread()); // 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. NotifyDataChannelsOfTransportCreated(); } @@ -194,7 +194,7 @@ RTC_DCHECK_RUN_ON(network_thread()); if (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). data_channel_transport()->SetDataSink(nullptr); set_data_channel_transport(new_data_channel_transport); @@ -202,7 +202,7 @@ new_data_channel_transport->SetDataSink(this); // 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. NotifyDataChannelsOfTransportCreated(); }
diff --git a/pc/data_channel_controller.h b/pc/data_channel_controller.h index 7b1ff26..af0e063 100644 --- a/pc/data_channel_controller.h +++ b/pc/data_channel_controller.h
@@ -161,7 +161,7 @@ std::vector<rtc::scoped_refptr<SctpDataChannel>> sctp_data_channels_to_free_ 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. // TODO(bugs.webrtc.org/11547): These '_s' signals likely all belong on the // network thread.
diff --git a/pc/dtls_srtp_transport.cc b/pc/dtls_srtp_transport.cc index ac091c6..1b9d1a0 100644 --- a/pc/dtls_srtp_transport.cc +++ b/pc/dtls_srtp_transport.cc
@@ -42,7 +42,7 @@ // When using DTLS-SRTP, we must reset the SrtpTransport every time the // DtlsTransport changes and wait until the DTLS handshake is complete to set // 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. if (IsSrtpActive() && (rtp_dtls_transport != rtp_dtls_transport_ || active_reset_srtp_params_)) {
diff --git a/pc/dtls_srtp_transport.h b/pc/dtls_srtp_transport.h index 9c52dcf..da068c9 100644 --- a/pc/dtls_srtp_transport.h +++ b/pc/dtls_srtp_transport.h
@@ -34,7 +34,7 @@ explicit DtlsSrtpTransport(bool rtcp_mux_enabled); // 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, cricket::DtlsTransportInternal* rtcp_dtls_transport); @@ -58,7 +58,7 @@ "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. void SetActiveResetSrtpParams(bool active_reset_srtp_params) { active_reset_srtp_params_ = active_reset_srtp_params;
diff --git a/pc/dtls_srtp_transport_unittest.cc b/pc/dtls_srtp_transport_unittest.cc index 6952159..b2ae14f 100644 --- a/pc/dtls_srtp_transport_unittest.cc +++ b/pc/dtls_srtp_transport_unittest.cc
@@ -127,7 +127,7 @@ packet_size); 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. int prev_received_packets = transport_observer2_.rtp_count(); ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, @@ -157,7 +157,7 @@ rtc::CopyOnWriteBuffer rtcp_packet2to1(kRtcpReport, rtcp_len, packet_size); 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. int prev_received_packets = transport_observer2_.rtcp_count(); ASSERT_TRUE(dtls_srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options, @@ -202,7 +202,7 @@ memcpy(original_rtp_data, rtp_packet_data, rtp_len); 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. ASSERT_TRUE(dtls_srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, cricket::PF_SRTP_BYPASS)); @@ -518,7 +518,7 @@ } // 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) { auto rtp_dtls1 = std::make_unique<FakeDtlsTransport>( "audio", cricket::ICE_CANDIDATE_COMPONENT_RTP); @@ -537,7 +537,7 @@ // Send some RTCP packets, causing the SRTCP index to be incremented. 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); // Set RTCP transport to null to trigger the SRTP parameters update. dtls_srtp_transport1_->SetDtlsTransports(rtp_dtls1.get(), nullptr);
diff --git a/pc/dtmf_sender.cc b/pc/dtmf_sender.cc index 67c3fac..69ef2fb 100644 --- a/pc/dtmf_sender.cc +++ b/pc/dtmf_sender.cc
@@ -192,7 +192,7 @@ } else { char tone = tones_[first_tone_pos]; 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. RTC_NOTREACHED(); } @@ -216,7 +216,7 @@ RTC_LOG(LS_ERROR) << "The DtmfProvider can no longer send DTMF."; return; } - // Wait for the number of milliseconds specified by |duration_|. + // Wait for the number of milliseconds specified by `duration_`. tone_gap += duration_; }
diff --git a/pc/dtmf_sender.h b/pc/dtmf_sender.h index b64b50e..5f20054 100644 --- a/pc/dtmf_sender.h +++ b/pc/dtmf_sender.h
@@ -38,8 +38,8 @@ // Returns true if the audio sender is capable of sending DTMF. Otherwise // returns false. virtual bool CanInsertDtmf() = 0; - // Sends DTMF |code|. - // The |duration| indicates the length of the DTMF tone in ms. + // Sends DTMF `code`. + // The `duration` indicates the length of the DTMF tone in ms. // Returns true on success and false on failure. virtual bool InsertDtmf(int code, int duration) = 0; // Returns a |sigslot::signal0<>| signal. The signal should fire before
diff --git a/pc/dtmf_sender_unittest.cc b/pc/dtmf_sender_unittest.cc index 261cbd0..270b3e2 100644 --- a/pc/dtmf_sender_unittest.cc +++ b/pc/dtmf_sender_unittest.cc
@@ -129,8 +129,8 @@ } } - // Constructs a list of DtmfInfo from |tones|, |duration| and - // |inter_tone_gap|. + // Constructs a list of DtmfInfo from `tones`, `duration` and + // `inter_tone_gap`. void GetDtmfInfoFromString( const std::string& tones, int duration,
diff --git a/pc/external_hmac.cc b/pc/external_hmac.cc index 99021f8..27b5d0e 100644 --- a/pc/external_hmac.cc +++ b/pc/external_hmac.cc
@@ -77,8 +77,8 @@ // Set pointers *a = reinterpret_cast<srtp_auth_t*>(pointer); - // |external_hmac| is const and libsrtp expects |type| to be non-const. - // const conversion is required. |external_hmac| is constant because we don't + // `external_hmac` is const and libsrtp expects `type` to be non-const. + // const conversion is required. `external_hmac` is constant because we don't // want to increase global count in Chrome. (*a)->type = const_cast<srtp_auth_type_t*>(&external_hmac); (*a)->state = pointer + sizeof(srtp_auth_t); @@ -130,7 +130,7 @@ } 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. srtp_err_status_t status = srtp_replace_auth_type( const_cast<srtp_auth_type_t*>(&external_hmac), EXTERNAL_HMAC_SHA1);
diff --git a/pc/ice_server_parsing.cc b/pc/ice_server_parsing.cc index 0daf8e4..c1c8557 100644 --- a/pc/ice_server_parsing.cc +++ b/pc/ice_server_parsing.cc
@@ -59,7 +59,7 @@ "kValidIceServiceTypes must have as many strings as ServiceType " "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., // stunURI = scheme ":" host [ ":" port ] // scheme = "stun" / "stuns" / "turn" / "turns" @@ -105,7 +105,7 @@ // standard hostname:port format. // Consider following formats as correct. // |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, std::string* host, int* port) { @@ -145,7 +145,7 @@ } // 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( const PeerConnectionInterface::IceServer& server, const std::string& url,
diff --git a/pc/ice_server_parsing.h b/pc/ice_server_parsing.h index 8cdd31a..da5de10 100644 --- a/pc/ice_server_parsing.h +++ b/pc/ice_server_parsing.h
@@ -21,9 +21,9 @@ namespace webrtc { -// 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 -// INVALID_PARAMETER if a TURN server is missing |username| or |password|. +// 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 +// INVALID_PARAMETER if a TURN server is missing `username` or `password`. // // Intended to be used to convert/validate the servers passed into a // PeerConnection through RTCConfiguration.
diff --git a/pc/ice_server_parsing_unittest.cc b/pc/ice_server_parsing_unittest.cc index e4dbd3a..1cb3686 100644 --- a/pc/ice_server_parsing_unittest.cc +++ b/pc/ice_server_parsing_unittest.cc
@@ -23,7 +23,7 @@ class IceServerParsingTest : public ::testing::Test { public: // 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) { return ParseUrl(url, std::string(), std::string()); }
diff --git a/pc/jsep_session_description.cc b/pc/jsep_session_description.cc index ccba75b..4c1a4e7 100644 --- a/pc/jsep_session_description.cc +++ b/pc/jsep_session_description.cc
@@ -102,7 +102,7 @@ // (draft-ietf-mmusic-trickle-ice-sip), and in particular 0.0.0.0 has been // widely deployed for this use without outstanding compatibility issues. // 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 // |media_desc->connection_address()|. connection_addr = rtc::SocketAddress(kDummyAddress, kDummyPort);
diff --git a/pc/jsep_transport.cc b/pc/jsep_transport.cc index f0a062e..791bf7f 100644 --- a/pc/jsep_transport.cc +++ b/pc/jsep_transport.cc
@@ -111,7 +111,7 @@ TRACE_EVENT0("webrtc", "JsepTransport::JsepTransport"); RTC_DCHECK(ice_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. RTC_DCHECK_EQ((rtcp_ice_transport_ != nullptr), (rtcp_dtls_transport_ != nullptr)); @@ -528,9 +528,9 @@ } else { RTC_LOG(LS_INFO) << "No crypto keys are provided for SDES."; if (type == SdpType::kAnswer) { - // Explicitly reset the |sdes_transport_| if no crypto param is - // provided in the answer. No need to call |ResetParams()| for - // |sdes_negotiator_| because it resets the params inside |SetAnswer|. + // Explicitly reset the `sdes_transport_` if no crypto param is + // provided in the answer. No need to call `ResetParams()` for + // `sdes_negotiator_` because it resets the params inside `SetAnswer`. sdes_transport_->ResetParams(); } }
diff --git a/pc/jsep_transport.h b/pc/jsep_transport.h index fe6f582..5593122 100644 --- a/pc/jsep_transport.h +++ b/pc/jsep_transport.h
@@ -88,8 +88,8 @@ // so its methods should only be called on the network thread. class JsepTransport { public: - // |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 + // `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 // description may be set before a local certificate is generated. JsepTransport( const std::string& mid, @@ -138,7 +138,7 @@ // set, offers should generate new ufrags/passwords until an ICE restart // 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(); // Returns true if the ICE restart flag above was set, and no ICE restart has
diff --git a/pc/jsep_transport_collection.cc b/pc/jsep_transport_collection.cc index c7364b0..df44a9c 100644 --- a/pc/jsep_transport_collection.cc +++ b/pc/jsep_transport_collection.cc
@@ -94,7 +94,7 @@ RTC_DCHECK_RUN_ON(&sequence_checker_); RTC_LOG(LS_VERBOSE) << "Deleting mid " << mid << " from bundle group " << 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 // it before we use it to make a modification. auto bundle_group_it = std::find_if(
diff --git a/pc/jsep_transport_controller.cc b/pc/jsep_transport_controller.cc index 1b554eb..bf24990 100644 --- a/pc/jsep_transport_controller.cc +++ b/pc/jsep_transport_controller.cc
@@ -57,7 +57,7 @@ config_(config), active_reset_srtp_params_(config.active_reset_srtp_params), 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_.rtcp_handler); RTC_DCHECK(config_.ice_transport_factory); @@ -674,7 +674,7 @@ std::vector<const cricket::ContentGroup*> new_bundle_groups = 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; for (const cricket::ContentGroup* new_bundle_group : new_bundle_groups) { for (const std::string& content_name : new_bundle_group->content_names()) { @@ -829,7 +829,7 @@ "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. if (bundled_content->rejected) { for (const auto& content_name : bundle_group->content_names()) { @@ -878,7 +878,7 @@ } else { transports_.RemoveTransportForMid(content_info.name); 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); } }
diff --git a/pc/jsep_transport_controller.h b/pc/jsep_transport_controller.h index 4161f6a..fb42009 100644 --- a/pc/jsep_transport_controller.h +++ b/pc/jsep_transport_controller.h
@@ -84,20 +84,20 @@ public: virtual ~Observer() {} - // Returns true if media associated with |mid| was successfully set up to be - // demultiplexed on |rtp_transport|. Could return false if two bundled m= + // Returns true if media associated with `mid` was successfully set up to be + // demultiplexed on `rtp_transport`. Could return false if two bundled m= // sections use the same SSRC, for example. // - // If a data channel transport must be negotiated, |data_channel_transport| - // and |negotiation_state| indicate negotiation status. If - // |data_channel_transport| is null, the data channel transport should not + // If a data channel transport must be negotiated, `data_channel_transport` + // and `negotiation_state` indicate negotiation status. If + // `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 - // 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 - // |negotiation_state| is provisional or final. It should not delete - // |data_channel_transport| or any fallback transport until - // |negotiation_state| is final. + // The observer should not send data on `data_channel_transport` until + // `negotiation_state` is provisional or final. It should not delete + // `data_channel_transport` or any fallback transport until + // `negotiation_state` is final. virtual bool OnTransportChanged( const std::string& mid, RtpTransportInternal* rtp_transport, @@ -106,12 +106,12 @@ }; 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 // restart. bool redetermine_role_on_ice_restart = true; 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. webrtc::CryptoOptions crypto_options; PeerConnectionInterface::BundlePolicy bundle_policy = @@ -139,10 +139,10 @@ std::function<void(const rtc::SSLHandshakeError)> on_dtls_handshake_error_; }; - // The ICE related events are fired on the |network_thread|. - // All the transport related methods are called 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` // and destruction of the JsepTransportController must occur on the - // |network_thread|. + // `network_thread`. JsepTransportController( rtc::Thread* network_thread, cricket::PortAllocator* port_allocator, @@ -160,7 +160,7 @@ RTCError SetRemoteDescription(SdpType type, 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. RtpTransportInternal* GetRtpTransport(const std::string& mid) const; cricket::DtlsTransportInternal* GetDtlsTransport(const std::string& mid); @@ -366,8 +366,8 @@ const std::string& transport_name) RTC_RUN_ON(network_thread_); // Creates jsep transport. Noop if transport is already created. - // Transport is created either during SetLocalDescription (|local| == true) or - // during SetRemoteDescription (|local| == false). Passing |local| helps to + // Transport is created either during SetLocalDescription (`local` == true) or + // during SetRemoteDescription (`local` == false). Passing `local` helps to // differentiate initiator (caller) from answerer (callee). RTCError MaybeCreateJsepTransport( bool local,
diff --git a/pc/jsep_transport_controller_unittest.cc b/pc/jsep_transport_controller_unittest.cc index 88fda75..4c2ee2a 100644 --- a/pc/jsep_transport_controller_unittest.cc +++ b/pc/jsep_transport_controller_unittest.cc
@@ -349,7 +349,7 @@ int gathering_state_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<FakeIceTransportFactory> fake_ice_transport_factory_; std::unique_ptr<FakeDtlsTransportFactory> fake_dtls_transport_factory_; @@ -966,14 +966,14 @@ } // 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. TEST_F(JsepTransportControllerTest, IceRoleNotRedetermined) { JsepTransportController::Config config; config.redetermine_role_on_ice_restart = false; 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>(); AddAudioSection(remote_offer.get(), kAudioMid1, kIceUfrag1, kIcePwd1, cricket::ICEMODE_FULL, cricket::CONNECTIONROLE_ACTPASS, @@ -2057,7 +2057,7 @@ ->SetRemoteDescription(SdpType::kAnswer, remote_answer.get()) .ok()); - // Verifiy that only |kAudio1| and |kVideo1| are bundled. + // Verifiy that only `kAudio1` and `kVideo1` are bundled. auto transport1 = transport_controller_->GetRtpTransport(kAudioMid1); auto transport2 = transport_controller_->GetRtpTransport(kAudioMid2); auto transport3 = transport_controller_->GetRtpTransport(kVideoMid1); @@ -2231,7 +2231,7 @@ EXPECT_TRUE(bundle_group.RemoveContentName(kAudioMid1)); bundle_group.AddContentName(kAudioMid1); // 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->AddGroup(bundle_group); EXPECT_TRUE(transport_controller_
diff --git a/pc/jsep_transport_unittest.cc b/pc/jsep_transport_unittest.cc index 8c526a9..a511cd3 100644 --- a/pc/jsep_transport_unittest.cc +++ b/pc/jsep_transport_unittest.cc
@@ -157,7 +157,7 @@ std::unique_ptr<JsepTransport> jsep_transport_; 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. webrtc::SrtpTransport* sdes_transport_ = nullptr; };
diff --git a/pc/media_session.cc b/pc/media_session.cc index 0944a7a..b66d7f6 100644 --- a/pc/media_session.cc +++ b/pc/media_session.cc
@@ -421,9 +421,9 @@ 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. -// |current_params| - All currently known StreamParams of any media type. +// `current_params` - All currently known StreamParams of any media type. template <class C> static bool AddStreamParams( const std::vector<SenderOptions>& sender_options, @@ -476,10 +476,10 @@ return true; } -// Updates the transport infos of the |sdesc| according to the given -// |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 -// first content within the |bundle_group|. +// Updates the transport infos of the `sdesc` according to the given +// `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 +// first content within the `bundle_group`. static bool UpdateTransportInfoForBundle(const ContentGroup& bundle_group, SessionDescription* sdesc) { // The bundle should not be empty. @@ -513,8 +513,8 @@ return true; } -// Gets the CryptoParamsVec of the given |content_name| from |sdesc|, and -// sets it to |cryptos|. +// Gets the CryptoParamsVec of the given `content_name` from `sdesc`, and +// sets it to `cryptos`. static bool GetCryptosByName(const SessionDescription* sdesc, const std::string& content_name, CryptoParamsVec* cryptos) { @@ -529,8 +529,8 @@ return true; } -// Prunes the |target_cryptos| by removing the crypto params (cipher_suite) -// which are not available in |filter|. +// Prunes the `target_cryptos` by removing the crypto params (cipher_suite) +// which are not available in `filter`. static void PruneCryptos(const CryptoParamsVec& filter, CryptoParamsVec* target_cryptos) { if (!target_cryptos) { @@ -539,8 +539,8 @@ target_cryptos->erase( std::remove_if(target_cryptos->begin(), target_cryptos->end(), - // Returns true if the |crypto|'s cipher_suite is not - // found in |filter|. + // Returns true if the `crypto`'s cipher_suite is not + // found in `filter`. [&filter](const CryptoParams& crypto) { for (const CryptoParams& entry : filter) { if (entry.cipher_suite == crypto.cipher_suite) @@ -561,9 +561,9 @@ return is_rtp; } -// Updates the crypto parameters of the |sdesc| according to the given -// |bundle_group|. The crypto parameters of all the contents within the -// |bundle_group| should be updated to use the common subset of the +// Updates the crypto parameters of the `sdesc` according to the given +// `bundle_group`. The crypto parameters of all the contents within the +// `bundle_group` should be updated to use the common subset of the // available cryptos. static bool UpdateCryptoParamsForBundle(const ContentGroup& bundle_group, SessionDescription* sdesc) { @@ -673,7 +673,7 @@ 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, // 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 @@ -828,15 +828,15 @@ } } -// 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 +// 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 // the codecs themselves and their associated codecs must match. template <class C> static bool FindMatchingCodec(const std::vector<C>& codecs1, const std::vector<C>& codecs2, const C& codec_to_match, 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. RTC_DCHECK(absl::c_any_of(codecs1, [&codec_to_match](const C& codec) { return &codec == &codec_to_match; @@ -867,7 +867,7 @@ 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> static const C* GetAssociatedCodec(const std::vector<C>& codec_list, const C& rtx_codec) { @@ -897,8 +897,8 @@ return associated_codec; } -// Adds all codecs from |reference_codecs| to |offered_codecs| that don't -// already exist in |offered_codecs| and ensure the payload types 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 // collide. template <class C> static void MergeCodecs(const std::vector<C>& reference_codecs, @@ -989,13 +989,13 @@ return filtered_codecs; } -// Adds all extensions from |reference_extensions| to |offered_extensions| that -// 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 -// |encrypted_extensions|, and if the extension is in |regular_extensions| or -// |encrypted_extensions|, its ID is marked as used in |used_ids|. -// |offered_extensions| is for either audio or video while |regular_extensions| -// and |encrypted_extensions| are used for both audio and video. There could be +// Adds all extensions from `reference_extensions` to `offered_extensions` that +// 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 +// `encrypted_extensions`, and if the extension is in `regular_extensions` or +// `encrypted_extensions`, its ID is marked as used in `used_ids`. +// `offered_extensions` is for either audio or video while `regular_extensions` +// and `encrypted_extensions` are used for both audio and video. There could be // overlap between audio extensions and video extensions. static void MergeRtpHdrExts(const RtpHeaderExtensions& reference_extensions, RtpHeaderExtensions* offered_extensions, @@ -1226,7 +1226,7 @@ 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, // 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 @@ -1290,7 +1290,7 @@ const std::string& protocol, bool secure_transport) { // 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()) { return true; } @@ -1327,8 +1327,8 @@ desc->set_protocol(kMediaProtocolAvpf); } -// Gets the TransportInfo of the given |content_name| from the -// |current_description|. If doesn't exist, returns a new one. +// Gets the TransportInfo of the given `content_name` from the +// `current_description`. If doesn't exist, returns a new one. static const TransportDescription* GetTransportDescription( const std::string& content_name, const SessionDescription* current_description) { @@ -1523,7 +1523,7 @@ auto offer = std::make_unique<SessionDescription>(); // Iterate through the media description options, matching with existing media - // descriptions in |current_description|. + // descriptions in `current_description`. size_t msection_index = 0; for (const MediaDescriptionOptions& media_description_options : session_options.media_description_options) { @@ -1667,8 +1667,8 @@ std::vector<const ContentGroup*> offer_bundles = offer->GetGroupsByName(GROUP_TYPE_BUNDLE); // There are as many answer BUNDLE groups as offer BUNDLE groups (even if - // rejected, we respond with an empty group). |offer_bundles|, - // |answer_bundles| and |bundle_transports| share the same size and indices. + // rejected, we respond with an empty group). `offer_bundles`, + // `answer_bundles` and `bundle_transports` share the same size and indices. std::vector<ContentGroup> answer_bundles; std::vector<std::unique_ptr<TransportInfo>> bundle_transports; answer_bundles.reserve(offer_bundles.size()); @@ -1681,7 +1681,7 @@ answer->set_extmap_allow_mixed(offer->extmap_allow_mixed()); // Iterate through the media description options, matching with existing - // media descriptions in |current_description|. + // media descriptions in `current_description`. size_t msection_index = 0; for (const MediaDescriptionOptions& media_description_options : session_options.media_description_options) { @@ -1755,7 +1755,7 @@ ContentInfo& added = answer->contents().back(); if (!added.rejected && session_options.bundle_enabled && 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); answer_bundles[bundle_index.value()].AddContentName(added.name); bundle_transports[bundle_index.value()].reset( @@ -1926,7 +1926,7 @@ AudioCodecs* audio_codecs, VideoCodecs* video_codecs) const { // 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. UsedPayloadTypes used_pltypes; MergeCodecsFromDescription(current_active_contents, audio_codecs, @@ -1950,7 +1950,7 @@ AudioCodecs* audio_codecs, VideoCodecs* video_codecs) const { // 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. UsedPayloadTypes used_pltypes; MergeCodecsFromDescription(current_active_contents, audio_codecs, @@ -1988,7 +1988,7 @@ } // Add codecs that are not in the current description but were in - // |remote_offer|. + // `remote_offer`. MergeCodecs<AudioCodec>(filtered_offered_audio_codecs, audio_codecs, &used_pltypes); MergeCodecs<VideoCodec>(filtered_offered_video_codecs, video_codecs, @@ -2017,7 +2017,7 @@ AudioVideoRtpHeaderExtensions offered_extensions; // First - get all extensions from the current description if the media type // 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. for (const ContentInfo* content : current_active_contents) { if (IsMediaContentOfType(content, MEDIA_TYPE_AUDIO)) { @@ -2112,10 +2112,10 @@ 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 // -// |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 // // acd->codecs() = set of previously negotiated codecs for this m= section @@ -2168,7 +2168,7 @@ codec, &found_codec) && !FindMatchingCodec<AudioCodec>(supported_audio_codecs, 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. filtered_codecs.push_back(found_codec); } @@ -2257,7 +2257,7 @@ codec, &found_codec) && !FindMatchingCodec<VideoCodec>(supported_video_codecs, 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. filtered_codecs.push_back(found_codec); } @@ -2375,10 +2375,10 @@ 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 // -// |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 // // acd->codecs() = set of previously negotiated codecs for this m= section @@ -2448,7 +2448,7 @@ !FindMatchingCodec<AudioCodec>(supported_audio_codecs, filtered_codecs, codec, nullptr)) { // 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); } } @@ -2563,7 +2563,7 @@ !FindMatchingCodec<VideoCodec>(supported_video_codecs, filtered_codecs, codec, nullptr)) { // 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); } }
diff --git a/pc/media_session.h b/pc/media_session.h index d4c8025..bb97f42 100644 --- a/pc/media_session.h +++ b/pc/media_session.h
@@ -50,7 +50,7 @@ // Use RIDs and Simulcast Layers to indicate spec-compliant Simulcast. std::vector<RidDescription> rids; SimulcastLayerList simulcast_layers; - // Use |num_sim_layers| to indicate legacy simulcast. + // Use `num_sim_layers` to indicate legacy simulcast. int num_sim_layers; }; @@ -84,7 +84,7 @@ std::vector<webrtc::RtpHeaderExtensionCapability> header_extensions; private: - // Doesn't DCHECK on |type|. + // Doesn't DCHECK on `type`. void AddSenderInternal(const std::string& track_id, const std::vector<std::string>& stream_ids, const std::vector<RidDescription>& rids,
diff --git a/pc/media_session_unittest.cc b/pc/media_session_unittest.cc index c808d94..fa08f40 100644 --- a/pc/media_session_unittest.cc +++ b/pc/media_session_unittest.cc
@@ -321,7 +321,7 @@ [&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, const std::string& mid, RtpTransceiverDirection direction, @@ -632,8 +632,8 @@ } // 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 - // to |direction_in_offer| and the answer is willing to both send and receive. + // `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. void TestMediaDirectionInAnswer( RtpTransceiverDirection direction_in_offer, RtpTransceiverDirection expected_direction_in_answer) { @@ -2716,9 +2716,9 @@ f2_.CreateOffer(opts, answer.get())); // 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. - // 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. const AudioCodec kUpdatedAudioCodecOffer[] = { kAudioCodecsAnswer[0], @@ -2727,7 +2727,7 @@ }; // 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. const VideoCodec kUpdatedVideoCodecOffer[] = { kVideoCodecsAnswer[0], @@ -2803,8 +2803,8 @@ f1_.set_video_codecs({}, {}); f2_.set_video_codecs({}, {}); - // Perform initial offer/answer in reverse (|f2_| as offerer) so that the - // second offer/answer is forward (|f1_| as offerer). + // Perform initial offer/answer in reverse (`f2_` as offerer) so that the + // second offer/answer is forward (`f1_` as offerer). MediaSessionOptions opts; AddMediaDescriptionOptions(MEDIA_TYPE_AUDIO, "a0", RtpTransceiverDirection::kSendRecv, kActive, @@ -2834,8 +2834,8 @@ f1_.set_audio_codecs({}, {}); f2_.set_audio_codecs({}, {}); - // Perform initial offer/answer in reverse (|f2_| as offerer) so that the - // second offer/answer is forward (|f1_| as offerer). + // Perform initial offer/answer in reverse (`f2_` as offerer) so that the + // second offer/answer is forward (`f1_` as offerer). MediaSessionOptions opts; AddMediaDescriptionOptions(MEDIA_TYPE_VIDEO, "v0", RtpTransceiverDirection::kSendRecv, kActive, @@ -2868,12 +2868,12 @@ RtpTransceiverDirection::kRecvOnly, kActive, &opts); 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); f1_.set_video_codecs(f1_codecs, f1_codecs); 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); f2_.set_video_codecs(f2_codecs, f2_codecs); @@ -2891,9 +2891,9 @@ EXPECT_EQ(expected_codecs, vcd->codecs()); - // 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 - // |f2_| are different. + // 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 + // `f2_` are different. std::unique_ptr<SessionDescription> updated_offer( f2_.CreateOffer(opts, answer.get())); ASSERT_TRUE(updated_offer); @@ -2968,7 +2968,7 @@ TEST_F(MediaSessionDescriptionFactoryTest, RespondentCreatesOfferWithVideoAndRtxAfterCreatingAudioAnswer) { 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); f1_.set_video_codecs(f1_codecs, f1_codecs); @@ -2985,7 +2985,7 @@ GetFirstAudioContentDescription(answer.get()); 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 // first offer/answer exchange. opts.media_description_options.clear(); @@ -3029,7 +3029,7 @@ AddAudioVideoSections(RtpTransceiverDirection::kRecvOnly, &opts); 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); f2_.set_video_codecs(f2_codecs, f2_codecs); @@ -3044,9 +3044,9 @@ std::vector<VideoCodec> expected_codecs = MAKE_VECTOR(kVideoCodecsAnswer); 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 - // those of |f1_|. + // those of `f1_`. std::unique_ptr<SessionDescription> updated_offer( f2_.CreateOffer(opts, answer.get())); ASSERT_TRUE(updated_offer); @@ -3073,7 +3073,7 @@ f1_.set_video_codecs(f1_codecs, f1_codecs); 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); f2_.set_video_codecs(f2_codecs, f2_codecs); @@ -3363,17 +3363,17 @@ // The expected RTP header extensions in the new offer are the resulting // extensions from the first offer/answer exchange plus the extensions only - // |f2_| offer. - // Since the default local extension id |f2_| uses has already been used by - // |f1_| for another extensions, it is changed to 13. + // `f2_` offer. + // Since the default local extension id `f2_` uses has already been used by + // `f1_` for another extensions, it is changed to 13. const RtpExtension kUpdatedAudioRtpExtensions[] = { kAudioRtpExtensionAnswer[0], RtpExtension(kAudioRtpExtension2[1].uri, 13), kAudioRtpExtension2[2], }; - // Since the default local extension id |f2_| uses has already been used by - // |f1_| for another extensions, is is changed to 12. + // Since the default local extension id `f2_` uses has already been used by + // `f1_` for another extensions, is is changed to 12. const RtpExtension kUpdatedVideoRtpExtensions[] = { kVideoRtpExtensionAnswer[0], RtpExtension(kVideoRtpExtension2[1].uri, 12),
diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 8ddf42c..5bcd940 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc
@@ -276,7 +276,7 @@ bool default_enabled = (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); } @@ -499,7 +499,7 @@ call_ptr_(call_.get()), // RFC 3264: The numeric value of the session id and version in the // 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. session_id_(rtc::ToString(rtc::CreateRandomId64() & LLONG_MAX)), dtls_enabled_(dtls_enabled), @@ -1195,7 +1195,7 @@ 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 // PeerConnection). This means that "all the stats objects representing the // selector" is an empty set. Invoking GetStatsReport() with a null selector @@ -1225,7 +1225,7 @@ 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 // the PeerConnection). This means that "all the stats objects representing // the selector" is an empty set. Invoking GetStatsReport() with a null @@ -2418,7 +2418,7 @@ void PeerConnection::TeardownDataChannelTransport_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. RTC_LOG(LS_INFO) << "Tearing down data channel transport for mid=" << *sctp_mid_n_;
diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 4476c5d..6e86668 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h
@@ -404,7 +404,7 @@ void ResetSctpDataMid(); // 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, int remote_port, int max_message_size); @@ -415,7 +415,7 @@ CryptoOptions GetCryptoOptions(); // 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( cricket::MediaType media_type, rtc::scoped_refptr<MediaStreamTrackInterface> track, @@ -531,8 +531,8 @@ // This function should only be called from the worker thread. void StopRtcEventLog_w(); - // Returns true and the TransportInfo of the given |content_name| - // from |description|. Returns false if it's not available. + // Returns true and the TransportInfo of the given `content_name` + // from `description`. Returns false if it's not available. static bool GetTransportDescription( const cricket::SessionDescription* description, const std::string& content_name, @@ -540,7 +540,7 @@ // 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 - // content called |content_name|. + // content called `content_name`. bool GetLocalCandidateMediaIndex(const std::string& content_name, int* sdp_mline_index) RTC_RUN_ON(signaling_thread()); @@ -585,7 +585,7 @@ // 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 // changed (as a result of BUNDLE negotiation, or m= sections being // rejected). @@ -606,7 +606,7 @@ 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()); // Points to the same thing as `event_log_`. Since it's const, we may read the @@ -634,7 +634,7 @@ ice_transport_factory_; // TODO(bugs.webrtc.org/9987): Accessed on the // signaling thread but the underlying raw // pointer is given to - // |jsep_transport_controller_| and used on the + // `jsep_transport_controller_` and used on the // network thread. const std::unique_ptr<rtc::SSLCertificateVerifier> tls_cert_verifier_ RTC_GUARDED_BY(network_thread()); @@ -663,7 +663,7 @@ transport_controller_; // TODO(bugs.webrtc.org/9987): Accessed on both // 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 // transports. It is set when either transport is initialized and unset when // both transports are deleted.
diff --git a/pc/peer_connection_end_to_end_unittest.cc b/pc/peer_connection_end_to_end_unittest.cc index b29371c..4ef4c83 100644 --- a/pc/peer_connection_end_to_end_unittest.cc +++ b/pc/peer_connection_end_to_end_unittest.cc
@@ -132,7 +132,7 @@ 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, DataChannelInterface* dc2, size_t size = 6) {
diff --git a/pc/peer_connection_factory.cc b/pc/peer_connection_factory.cc index 50755a3..f8393f6 100644 --- a/pc/peer_connection_factory.cc +++ b/pc/peer_connection_factory.cc
@@ -248,7 +248,7 @@ } // 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. - // 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 // worker_thread()). All such methods have thread checks though, so the code // should still be clear (outside of macro expansion).
diff --git a/pc/peer_connection_histogram_unittest.cc b/pc/peer_connection_histogram_unittest.cc index fa46ce9..8a1aa60 100644 --- a/pc/peer_connection_histogram_unittest.cc +++ b/pc/peer_connection_histogram_unittest.cc
@@ -651,7 +651,7 @@ EXPECT_TRUE(caller->observer()->candidate_gathered()); // 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 // particular, not copying the ICE candidates. // TODO(qingsi): Technically, this is a bug. Fix it.
diff --git a/pc/peer_connection_ice_unittest.cc b/pc/peer_connection_ice_unittest.cc index 7971547..8726afb 100644 --- a/pc/peer_connection_ice_unittest.cc +++ b/pc/peer_connection_ice_unittest.cc
@@ -233,7 +233,7 @@ } // 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( const SessionDescriptionInterface* description) { std::vector<std::pair<std::string, std::string>> ice_credentials; @@ -589,7 +589,7 @@ ASSERT_TRUE( caller->SetRemoteDescription(callee->CreateAnswerAndSetAsLocal())); - // Add one candidate via |AddIceCandidate|. + // Add one candidate via `AddIceCandidate`. cricket::Candidate candidate1 = CreateLocalUdpCandidate(kCallerAddress1); ASSERT_TRUE(callee->AddIceCandidate(&candidate1)); @@ -1005,7 +1005,7 @@ ASSERT_TRUE(callee->SetRemoteDescription(caller->CreateOfferAndSetAsLocal())); auto initial_ice_credentials = 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. caller->pc()->RestartIce(); ASSERT_TRUE( @@ -1025,7 +1025,7 @@ auto initial_ice_credentials = GetIceCredentials(caller->pc()->local_description()); 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. caller->pc()->RestartIce(); ASSERT_TRUE( @@ -1044,7 +1044,7 @@ auto initial_ice_credentials = 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. callee->pc()->RestartIce(); ASSERT_TRUE(callee->ExchangeOfferAnswerWith(caller.get())); @@ -1082,7 +1082,7 @@ auto callee = CreatePeerConnectionWithAudioVideo(); 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. caller->observer()->clear_legacy_renegotiation_needed(); caller->observer()->clear_latest_negotiation_needed_event(); @@ -1105,7 +1105,7 @@ // Establish initial credentials as the caller. ASSERT_TRUE(caller->ExchangeOfferAnswerWith(callee.get())); 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. caller->observer()->clear_legacy_renegotiation_needed(); caller->observer()->clear_latest_negotiation_needed_event(); @@ -1130,7 +1130,7 @@ caller->pc()->RestartIce(); caller->observer()->clear_legacy_renegotiation_needed(); 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. callee->pc()->RestartIce(); ASSERT_TRUE(callee->ExchangeOfferAnswerWith(caller.get()));
diff --git a/pc/peer_connection_integrationtest.cc b/pc/peer_connection_integrationtest.cc index 4ec86b3..b8b302c 100644 --- a/pc/peer_connection_integrationtest.cc +++ b/pc/peer_connection_integrationtest.cc
@@ -203,7 +203,7 @@ 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. void TestDtmfFromSenderToReceiver(PeerConnectionIntegrationWrapper* sender, PeerConnectionIntegrationWrapper* receiver) { @@ -288,7 +288,7 @@ 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 // unencrypted versions. TEST_P(PeerConnectionIntegrationTest,
diff --git a/pc/peer_connection_interface_unittest.cc b/pc/peer_connection_interface_unittest.cc index fcea842..2105c78 100644 --- a/pc/peer_connection_interface_unittest.cc +++ b/pc/peer_connection_interface_unittest.cc
@@ -504,7 +504,7 @@ } } -// Check if |streams| contains the specified track. +// Check if `streams` contains the specified track. bool ContainsTrack(const std::vector<cricket::StreamParams>& streams, const std::string& stream_id, const std::string& track_id) { @@ -516,7 +516,7 @@ return false; } -// Check if |senders| contains the specified sender, by id. +// Check if `senders` contains the specified sender, by id. bool ContainsSender( const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders, const std::string& id) { @@ -528,7 +528,7 @@ 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( const std::vector<rtc::scoped_refptr<RtpSenderInterface>>& senders, const std::string& id, @@ -1096,10 +1096,10 @@ } // 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 // is returned and the MediaStream is stored in - // |reference_collection_| + // `reference_collection_` std::unique_ptr<SessionDescriptionInterface> CreateSessionDescriptionAndReference(size_t number_of_audio_tracks, size_t number_of_video_tracks) { @@ -3217,7 +3217,7 @@ // Tests that it won't crash when calling StartRtcEventLog or StopRtcEventLog // after the PeerConnection is closed. // This version tests the StartRtcEventLog version that receives an object -// of type |RtcEventLogOutput|. +// of type `RtcEventLogOutput`. TEST_P(PeerConnectionInterfaceTest, StartAndStopLoggingToOutputAfterPeerConnectionClosed) { CreatePeerConnection(); @@ -3473,7 +3473,7 @@ } // 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) { RTCOfferAnswerOptions rtc_options; rtc_options.offer_to_receive_audio = 1; @@ -3488,7 +3488,7 @@ } // 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) { RTCOfferAnswerOptions rtc_options; rtc_options.offer_to_receive_audio = 1; @@ -3502,7 +3502,7 @@ 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. TEST_P(PeerConnectionInterfaceTest, CreateOfferWithVideoOnlyOptions) { RTCOfferAnswerOptions rtc_options; @@ -3530,7 +3530,7 @@ 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. TEST_P(PeerConnectionInterfaceTest, CreateOfferWithIceRestart) { CreatePeerConnection(); @@ -3547,14 +3547,14 @@ auto pwd1 = 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); auto ufrag2 = offer->description()->GetTransportInfoByName(mid)->description.ice_ufrag; auto pwd2 = 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; CreateOfferWithOptionsAsLocalDescription(&offer, rtc_options); auto ufrag3 = @@ -3568,7 +3568,7 @@ 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. TEST_P(PeerConnectionInterfaceTest, CreateOfferWithRtpMux) { RTCOfferAnswerOptions rtc_options;
diff --git a/pc/peer_connection_rampup_tests.cc b/pc/peer_connection_rampup_tests.cc index d50d488..5cf30d8 100644 --- a/pc/peer_connection_rampup_tests.cc +++ b/pc/peer_connection_rampup_tests.cc
@@ -298,7 +298,7 @@ if (ice_candidate_pair_stats.available_outgoing_bitrate.is_defined()) { 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. return 0; } @@ -307,7 +307,7 @@ // 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. 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. // TODO(bugs.webrtc.org/7668): We would like to update the virtual network we // use for this test. VirtualSocketServer isn't ideal because: @@ -325,7 +325,7 @@ std::unique_ptr<rtc::FirewallSocketServer> firewall_socket_server_; std::unique_ptr<rtc::Thread> network_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. std::vector<std::unique_ptr<rtc::FakeNetworkManager>> fake_network_managers_; rtc::scoped_refptr<PeerConnectionFactoryInterface> pc_factory_;
diff --git a/pc/peer_connection_signaling_unittest.cc b/pc/peer_connection_signaling_unittest.cc index 1c94570..d20dc70 100644 --- a/pc/peer_connection_signaling_unittest.cc +++ b/pc/peer_connection_signaling_unittest.cc
@@ -208,7 +208,7 @@ // methods on PeerConnection will succeed/fail depending on what is the // PeerConnection's signaling state. Note that the test tries many different // 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 // state the PeerConnection was created in before it was closed.
diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc index 1fdc736..c2b453e 100644 --- a/pc/rtc_stats_collector.cc +++ b/pc/rtc_stats_collector.cc
@@ -377,7 +377,7 @@ inbound_audio->total_audio_energy = voice_receiver_info.total_output_energy; inbound_audio->total_samples_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. if (voice_receiver_info.last_packet_received_timestamp_ms) { inbound_audio->last_packet_received_timestamp = static_cast<double>( @@ -491,7 +491,7 @@ inbound_video->estimated_playout_timestamp = static_cast<double>( *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. if (video_receiver_info.content_type == VideoContentType::SCREENSHARE) inbound_video->content_type = RTCContentType::kScreenshare; @@ -532,7 +532,7 @@ outbound_audio->codec_id = RTCCodecStatsIDFromMidDirectionAndPayload( 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. } @@ -585,7 +585,7 @@ video_sender_info.quality_limitation_durations_ms); outbound_video->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. if (video_sender_info.content_type == VideoContentType::SCREENSHARE) outbound_video->content_type = RTCContentType::kScreenshare; @@ -629,7 +629,7 @@ std::string local_id = 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); if (local_id_it != outbound_rtps.end()) { remote_inbound->local_id = local_id; @@ -780,7 +780,7 @@ voice_sender_info.apm_statistics); auto audio_processor(audio_track.GetAudioProcessor()); 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. AudioProcessorInterface::AudioProcessorStatistics ap_stats = audio_processor->GetStats(/*has_remote_tracks=*/false); @@ -1213,7 +1213,7 @@ this, cached_report_, std::move(requests))); } else if (!num_pending_partial_reports_) { // 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. // "Now" using a system clock, relative to the UNIX epoch (Jan 1, 1970, @@ -1224,13 +1224,13 @@ num_pending_partial_reports_ = 2; partial_report_timestamp_us_ = cache_now_us; - // Prepare |transceiver_stats_infos_| and |call_stats_| for use in - // |ProducePartialResultsOnNetworkThread| and - // |ProducePartialResultsOnSignalingThread|. + // Prepare `transceiver_stats_infos_` and `call_stats_` for use in + // `ProducePartialResultsOnNetworkThread` and + // `ProducePartialResultsOnSignalingThread`. 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 - // |network_report_event_|. + // `network_report_event_`. network_report_event_.Reset(); rtc::scoped_refptr<RTCStatsCollector> collector(this); network_thread_->PostTask( @@ -1251,7 +1251,7 @@ void RTCStatsCollector::WaitForPendingRequest() { 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. MergeNetworkReport_s(); } @@ -1295,8 +1295,8 @@ RTC_DCHECK_RUN_ON(network_thread_); rtc::Thread::ScopedDisallowBlockingCalls no_blocking_calls; - // Touching |network_report_| on this thread is safe by this method because - // |network_report_event_| is reset before this method is invoked. + // Touching `network_report_` on this thread is safe by this method because + // `network_report_event_` is reset before this method is invoked. network_report_ = RTCStatsReport::Create(timestamp_us); std::set<std::string> transport_names; @@ -1318,7 +1318,7 @@ timestamp_us, transport_stats_by_name, transport_cert_stats, 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. network_report_event_.Set(); rtc::scoped_refptr<RTCStatsCollector> collector(this); @@ -1347,16 +1347,16 @@ void RTCStatsCollector::MergeNetworkReport_s() { RTC_DCHECK_RUN_ON(signaling_thread_); - // The |network_report_event_| must be signaled for it to be safe to touch - // |network_report_|. This is normally not blocking, but if + // The `network_report_event_` must be signaled for it to be safe to touch + // `network_report_`. This is normally not blocking, but if // 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); if (!network_report_) { // Normally, MergeNetworkReport_s() is executed because it is posted from // the network thread. But if WaitForPendingRequest() is called while a // 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 // already null and nothing needs to be done here. return; @@ -1366,8 +1366,8 @@ partial_report_->TakeMembersFrom(network_report_); network_report_ = nullptr; --num_pending_partial_reports_; - // |network_report_| is currently the only partial report collected - // asynchronously, so |num_pending_partial_reports_| must now be 0 and we are + // `network_report_` is currently the only partial report collected + // asynchronously, so `num_pending_partial_reports_` must now be 0 and we are // ready to deliver the result. RTC_DCHECK_EQ(num_pending_partial_reports_, 0); cache_timestamp_us_ = partial_report_timestamp_us_; @@ -1380,7 +1380,7 @@ TRACE_EVENT_INSTANT1("webrtc_stats", "webrtc_stats", "report", cached_report_->ToJson()); - // Deliver report and clear |requests_|. + // Deliver report and clear `requests_`. std::vector<RequestInfo> requests; requests.swap(requests_); DeliverCachedReport(cached_report_, std::move(requests)); @@ -1704,7 +1704,7 @@ // stream, so look in both places. auto audio_processor(audio_track->GetAudioProcessor()); 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. AudioProcessorInterface::AudioProcessorStatistics ap_stats = audio_processor->GetStats(/*has_remote_tracks=*/false); @@ -2218,7 +2218,7 @@ void RTCStatsCollector::OnDataChannelClosed(DataChannelInterface* channel) { RTC_DCHECK_RUN_ON(signaling_thread_); // 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( reinterpret_cast<uintptr_t>(channel))) { ++internal_record_.data_channels_closed;
diff --git a/pc/rtc_stats_collector.h b/pc/rtc_stats_collector.h index 5f13f54..c84e6d3 100644 --- a/pc/rtc_stats_collector.h +++ b/pc/rtc_stats_collector.h
@@ -52,7 +52,7 @@ // All public methods of the collector are to be called on the signaling thread. // Stats are gathered on the signaling, worker and network threads // 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, public sigslot::has_slots<> { public: @@ -62,25 +62,25 @@ // 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 - // 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. // If the optional selector argument is used, stats are filtered according to // stats selection algorithm before delivery. // https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm 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. void GetStatsReport(rtc::scoped_refptr<RtpSenderInternal> selector, 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. void GetStatsReport(rtc::scoped_refptr<RtpReceiverInternal> selector, rtc::scoped_refptr<RTCStatsCollectorCallback> callback); // Clears the cache's reference to the most recent stats report. Subsequently - // calling |GetStatsReport| guarantees fresh stats. + // calling `GetStatsReport` guarantees fresh stats. 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. void WaitForPendingRequest(); @@ -113,11 +113,11 @@ explicit RequestInfo( rtc::scoped_refptr<RTCStatsCollectorCallback> callback); // 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, rtc::scoped_refptr<RTCStatsCollectorCallback> callback); // 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, rtc::scoped_refptr<RTCStatsCollectorCallback> callback); @@ -154,7 +154,7 @@ // Some fields are copied from the RtpTransceiver/BaseChannel object so that // 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), - // then |mid| and |transport_name| will be null. + // then `mid` and `transport_name` will be null. struct RtpTransceiverStatsInfo { rtc::scoped_refptr<RtpTransceiver> transceiver; cricket::MediaType media_type; @@ -167,40 +167,40 @@ rtc::scoped_refptr<const RTCStatsReport> cached_report, std::vector<RequestInfo> requests); - // Produces |RTCCertificateStats|. + // Produces `RTCCertificateStats`. void ProduceCertificateStats_n( int64_t timestamp_us, const std::map<std::string, CertificateStatsPair>& transport_cert_stats, RTCStatsReport* report) const; - // Produces |RTCCodecStats|. + // Produces `RTCCodecStats`. void ProduceCodecStats_n( int64_t timestamp_us, const std::vector<RtpTransceiverStatsInfo>& transceiver_stats_infos, RTCStatsReport* report) const; - // Produces |RTCDataChannelStats|. + // Produces `RTCDataChannelStats`. void ProduceDataChannelStats_s(int64_t timestamp_us, RTCStatsReport* report) const; - // Produces |RTCIceCandidatePairStats| and |RTCIceCandidateStats|. + // Produces `RTCIceCandidatePairStats` and `RTCIceCandidateStats`. void ProduceIceCandidateAndPairStats_n( int64_t timestamp_us, const std::map<std::string, cricket::TransportStats>& transport_stats_by_name, const Call::Stats& call_stats, RTCStatsReport* report) const; - // Produces |RTCMediaStreamStats|. + // Produces `RTCMediaStreamStats`. void ProduceMediaStreamStats_s(int64_t timestamp_us, RTCStatsReport* report) const; - // Produces |RTCMediaStreamTrackStats|. + // Produces `RTCMediaStreamTrackStats`. void ProduceMediaStreamTrackStats_s(int64_t timestamp_us, RTCStatsReport* report) const; // Produces RTCMediaSourceStats, including RTCAudioSourceStats and // RTCVideoSourceStats. void ProduceMediaSourceStats_s(int64_t timestamp_us, RTCStatsReport* report) const; - // Produces |RTCPeerConnectionStats|. + // Produces `RTCPeerConnectionStats`. void ProducePeerConnectionStats_s(int64_t timestamp_us, RTCStatsReport* report) const; - // Produces |RTCInboundRTPStreamStats| and |RTCOutboundRTPStreamStats|. + // Produces `RTCInboundRTPStreamStats` and `RTCOutboundRTPStreamStats`. // This has to be invoked after codecs and transport stats have been created // because some metrics are calculated through lookup of other metrics. void ProduceRTPStreamStats_n( @@ -213,7 +213,7 @@ void ProduceVideoRTPStreamStats_n(int64_t timestamp_us, const RtpTransceiverStatsInfo& stats, RTCStatsReport* report) const; - // Produces |RTCTransportStats|. + // Produces `RTCTransportStats`. void ProduceTransportStats_n( int64_t timestamp_us, const std::map<std::string, cricket::TransportStats>& @@ -226,7 +226,7 @@ PrepareTransportCertificateStats_n( const std::map<std::string, cricket::TransportStats>& 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(); // Stats gathering on a particular thread. @@ -234,13 +234,13 @@ void ProducePartialResultsOnNetworkThread( int64_t timestamp_us, absl::optional<std::string> sctp_transport_name); - // Merges |network_report_| into |partial_report_| and completes the request. - // This is a NO-OP if |network_report_| is null. + // Merges `network_report_` into `partial_report_` and completes the request. + // This is a NO-OP if `network_report_` is null. 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); - // 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 OnDataChannelClosed(DataChannelInterface* channel); @@ -257,14 +257,14 @@ rtc::scoped_refptr<RTCStatsReport> partial_report_; std::vector<RequestInfo> requests_; // 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 - // |network_report_event_|. + // `network_report_event_`. 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() // 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_; // Cleared and set in `PrepareTransceiverStatsInfosAndCallStats_s_w_n`,
diff --git a/pc/rtc_stats_collector_unittest.cc b/pc/rtc_stats_collector_unittest.cc index 44cafbc..3fc8b8e 100644 --- a/pc/rtc_stats_collector_unittest.cc +++ b/pc/rtc_stats_collector_unittest.cc
@@ -55,7 +55,7 @@ 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) { *os << stats.ToJson(); } @@ -916,7 +916,7 @@ } 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> b = stats_->GetStatsReport(); EXPECT_EQ(a.get(), b.get()); @@ -942,8 +942,8 @@ EXPECT_TRUE_WAIT(b, kGetStatsReportTimeoutMs); EXPECT_TRUE_WAIT(c, kGetStatsReportTimeoutMs); EXPECT_EQ(a.get(), b.get()); - // The act of doing |AdvanceTime| processes all messages. If this was not the - // case we might not require |c| to be fresher than |b|. + // The act of doing `AdvanceTime` processes all messages. If this was not the + // case we might not require `c` to be fresher than `b`. EXPECT_NE(c.get(), b.get()); } @@ -2807,7 +2807,7 @@ } // 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( std::string transport_name, const std::vector<ReportBlockData>& report_block_datas, @@ -2881,7 +2881,7 @@ for (auto ssrc : ssrcs) { RTCPReportBlock report_block; // 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.packets_lost = 7; report_block.fraction_lost = kFractionLost; @@ -2916,7 +2916,7 @@ expected_remote_inbound_rtp.total_round_trip_time = kRoundTripTimeSample1Seconds + kRoundTripTimeSample2Seconds; 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. ASSERT_TRUE(report->Get(expected_remote_inbound_rtp.id())); @@ -2940,7 +2940,7 @@ RTCPReportBlock report_block; // 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; ReportBlockData report_block_data; report_block_data.SetReportBlock(report_block, kReportBlockTimestampUtcUs); @@ -2972,7 +2972,7 @@ RTCPReportBlock report_block; // 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.jitter = 5000; ReportBlockData report_block_data; @@ -3009,7 +3009,7 @@ RTCPReportBlock report_block; // 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; ReportBlockData report_block_data; report_block_data.SetReportBlock(report_block, kReportBlockTimestampUtcUs);
diff --git a/pc/rtc_stats_integrationtest.cc b/pc/rtc_stats_integrationtest.cc index df7b8a3..afa50d8 100644 --- a/pc/rtc_stats_integrationtest.cc +++ b/pc/rtc_stats_integrationtest.cc
@@ -192,7 +192,7 @@ 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. rtc::VirtualSocketServer virtual_socket_server_; std::unique_ptr<rtc::Thread> network_thread_; @@ -405,13 +405,13 @@ } else if (stats.type() == RTCAudioSourceStats::kType) { // RTCAudioSourceStats::kType and RTCVideoSourceStats::kType both have // 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 &= VerifyRTCAudioSourceStats(stats.cast_to<RTCAudioSourceStats>()); } else if (stats.type() == RTCVideoSourceStats::kType) { // RTCAudioSourceStats::kType and RTCVideoSourceStats::kType both have // 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 &= VerifyRTCVideoSourceStats(stats.cast_to<RTCVideoSourceStats>()); } else if (stats.type() == RTCTransportStats::kType) { @@ -749,7 +749,7 @@ verifier.TestMemberIsUndefined( media_stream_track.sum_squared_frame_durations); // 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 // test run until available or is there a way to have it always be // defined? crbug.com/627816 @@ -1086,7 +1086,7 @@ verifier.TestMemberIsNonNegative<double>(audio_source.audio_level); verifier.TestMemberIsPositive<double>(audio_source.total_audio_energy); 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 // test run until available or is there a way to have it always be // defined? crbug.com/627816 @@ -1100,7 +1100,7 @@ VerifyRTCMediaSourceStats(video_source, &verifier); // TODO(hbos): This integration test uses fakes that doesn't support // 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. verifier.TestMemberIsUndefined(video_source.width); verifier.TestMemberIsUndefined(video_source.height);
diff --git a/pc/rtc_stats_traversal.cc b/pc/rtc_stats_traversal.cc index e579072..49e79fe 100644 --- a/pc/rtc_stats_traversal.cc +++ b/pc/rtc_stats_traversal.cc
@@ -25,8 +25,8 @@ void TraverseAndTakeVisitedStats(RTCStatsReport* report, RTCStatsReport* visited_report, const std::string& current_id) { - // Mark current stats object as visited by moving it |report| to - // |visited_report|. + // Mark current stats object as visited by moving it `report` to + // `visited_report`. std::unique_ptr<const RTCStats> current = report->Take(current_id); if (!current) { // This node has already been visited (or it is an invalid id).
diff --git a/pc/rtc_stats_traversal.h b/pc/rtc_stats_traversal.h index 062a665..ec4d51c 100644 --- a/pc/rtc_stats_traversal.h +++ b/pc/rtc_stats_traversal.h
@@ -22,16 +22,16 @@ // Traverses the stats graph, taking all stats objects that are directly or // 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. // https://w3c.github.io/webrtc-pc/#dfn-stats-selection-algorithm rtc::scoped_refptr<RTCStatsReport> TakeReferencedStats( rtc::scoped_refptr<RTCStatsReport> report, 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 -// 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. // // For example, RTCCodecStats contains "transportId"
diff --git a/pc/rtp_media_utils.h b/pc/rtp_media_utils.h index d45cc74..6f7986f 100644 --- a/pc/rtp_media_utils.h +++ b/pc/rtp_media_utils.h
@@ -32,12 +32,12 @@ RtpTransceiverDirection RtpTransceiverDirectionReversed( 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 direction, 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 direction, bool recv = true);
diff --git a/pc/rtp_parameters_conversion.h b/pc/rtp_parameters_conversion.h index 35a3725..62e4685 100644 --- a/pc/rtp_parameters_conversion.h +++ b/pc/rtp_parameters_conversion.h
@@ -75,7 +75,7 @@ // 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. absl::optional<RtcpFeedback> ToRtcpFeedback( const cricket::FeedbackParam& cricket_feedback);
diff --git a/pc/rtp_sender.cc b/pc/rtp_sender.cc index aa268ce..9883945 100644 --- a/pc/rtp_sender.cc +++ b/pc/rtp_sender.cc
@@ -642,7 +642,7 @@ RTC_LOG(LS_WARNING) << "SetVideoSend: No video channel exists."; 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 // deleted. worker_thread_->Invoke<bool>(RTC_FROM_HERE, [&] {
diff --git a/pc/rtp_sender.h b/pc/rtp_sender.h index 0b4c204..4bc16c7 100644 --- a/pc/rtp_sender.h +++ b/pc/rtp_sender.h
@@ -56,7 +56,7 @@ virtual void SetMediaChannel(cricket::MediaChannel* media_channel) = 0; // 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 // description). virtual void SetSsrc(uint32_t ssrc) = 0; @@ -69,7 +69,7 @@ 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. virtual RtpParameters GetParametersInternal() const = 0; virtual RTCError SetParametersInternal(const RtpParameters& parameters) = 0; @@ -110,13 +110,13 @@ RtpParameters GetParameters() const 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. RtpParameters GetParametersInternal() const override; RTCError SetParametersInternal(const RtpParameters& parameters) override; // 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 // description). void SetSsrc(uint32_t ssrc) override; @@ -171,8 +171,8 @@ void SetTransceiverAsStopped() override { is_transceiver_stopped_ = true; } protected: - // 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 + // 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 // null, it must be valid at least until this sender becomes stopped. RtpSenderBase(rtc::Thread* worker_thread, const std::string& id, @@ -210,10 +210,10 @@ rtc::scoped_refptr<DtlsTransportInterface> dtls_transport_; rtc::scoped_refptr<FrameEncryptorInterface> frame_encryptor_; - // |last_transaction_id_| is used to verify that |SetParameters| is receiving - // the parameters object that was last returned from |GetParameters|. + // `last_transaction_id_` is used to verify that `SetParameters` is receiving + // the parameters object that was last returned from `GetParameters`. // 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. mutable absl::optional<std::string> last_transaction_id_; std::vector<std::string> disabled_rids_; @@ -258,7 +258,7 @@ void SetSink(cricket::AudioSource::Sink* sink) override; cricket::AudioSource::Sink* sink_; - // Critical section protecting |sink_|. + // Critical section protecting `sink_`. Mutex lock_; int num_preferred_channels_ = -1; }; @@ -269,8 +269,8 @@ // The sender is initialized with no track to send and no associated streams. // StatsCollector provided so that Add/RemoveLocalAudioTrack can be called // at the appropriate times. - // 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 + // 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 // null, it must be valid at least until this sender becomes stopped. static rtc::scoped_refptr<AudioRtpSender> Create( rtc::Thread* worker_thread, @@ -325,7 +325,7 @@ rtc::scoped_refptr<DtmfSenderInterface> dtmf_sender_proxy_; 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. std::unique_ptr<LocalAudioSinkAdapter> sink_adapter_; }; @@ -334,8 +334,8 @@ public: // Construct an RtpSender for video with the given sender ID. // 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() - // is called. |set_streams_observer| is not owned by this object. If not + // 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 // null, it must be valid at least until this sender becomes stopped. static rtc::scoped_refptr<VideoRtpSender> Create( rtc::Thread* worker_thread,
diff --git a/pc/rtp_sender_receiver_unittest.cc b/pc/rtp_sender_receiver_unittest.cc index 10dc894..a8140e8 100644 --- a/pc/rtp_sender_receiver_unittest.cc +++ b/pc/rtp_sender_receiver_unittest.cc
@@ -494,7 +494,7 @@ } // Check that minimum Jitter Buffer delay is propagated to the underlying - // |media_channel|. + // `media_channel`. void VerifyRtpReceiverDelayBehaviour(cricket::Delayable* media_channel, RtpReceiverInterface* receiver, uint32_t ssrc) { @@ -509,13 +509,13 @@ rtc::Thread* const network_thread_; rtc::Thread* const worker_thread_; webrtc::RtcEventLogNull event_log_; - // The |rtp_dtls_transport_| and |rtp_transport_| should be destroyed after - // the |channel_manager|. + // The `rtp_dtls_transport_` and `rtp_transport_` should be destroyed after + // the `channel_manager`. std::unique_ptr<cricket::DtlsTransportInternal> rtp_dtls_transport_; std::unique_ptr<webrtc::RtpTransportInternal> rtp_transport_; std::unique_ptr<webrtc::VideoBitrateAllocatorFactory> video_bitrate_allocator_factory_; - // |media_engine_| is actually owned by |channel_manager_|. + // `media_engine_` is actually owned by `channel_manager_`. cricket::FakeMediaEngine* media_engine_; std::unique_ptr<cricket::ChannelManager> channel_manager_; cricket::FakeCall fake_call_; @@ -534,28 +534,28 @@ 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. TEST_F(RtpSenderReceiverTest, AddAndDestroyAudioRtpSender) { CreateAudioRtpSender(); 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. TEST_F(RtpSenderReceiverTest, AddAndDestroyVideoRtpSender) { CreateVideoRtpSender(); 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. TEST_F(RtpSenderReceiverTest, AddAndDestroyAudioRtpReceiver) { CreateAudioRtpReceiver(); 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. TEST_F(RtpSenderReceiverTest, AddAndDestroyVideoRtpReceiver) { CreateVideoRtpReceiver(); @@ -1423,7 +1423,7 @@ 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); // No content hint should be set by default. EXPECT_EQ(VideoTrackInterface::ContentHint::kNone, @@ -1453,7 +1453,7 @@ 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); // No content hint should be set by default. EXPECT_EQ(VideoTrackInterface::ContentHint::kNone, @@ -1518,8 +1518,8 @@ EXPECT_EQ(nullptr, video_rtp_sender_->GetDtmfSender()); } -// Test that the DTMF sender is really using |voice_channel_|, and thus returns -// true/false from CanSendDtmf based on what |voice_channel_| returns. +// Test that the DTMF sender is really using `voice_channel_`, and thus returns +// true/false from CanSendDtmf based on what `voice_channel_` returns. TEST_F(RtpSenderReceiverTest, CanInsertDtmf) { AddDtmfCodec(); CreateAudioRtpSender();
diff --git a/pc/rtp_transceiver.h b/pc/rtp_transceiver.h index 6b1307b..c995329 100644 --- a/pc/rtp_transceiver.h +++ b/pc/rtp_transceiver.h
@@ -77,14 +77,14 @@ public: // Construct a Plan B-style RtpTransceiver with no senders, receivers, or // 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. RtpTransceiver(cricket::MediaType media_type, cricket::ChannelManager* channel_manager); // 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 // 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(). RtpTransceiver( rtc::scoped_refptr<RtpSenderProxyWithInternal<RtpSenderInternal>> sender, @@ -275,7 +275,7 @@ std::vector<RtpCodecCapability> codec_preferences_; 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. // PushdownMediaDescription(). cricket::RtpHeaderExtensions negotiated_header_extensions_
diff --git a/pc/rtp_transceiver_unittest.cc b/pc/rtp_transceiver_unittest.cc index 0128e91..35d9265 100644 --- a/pc/rtp_transceiver_unittest.cc +++ b/pc/rtp_transceiver_unittest.cc
@@ -8,7 +8,7 @@ * 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" @@ -32,7 +32,7 @@ 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) { auto cm = cricket::ChannelManager::Create( nullptr, true, rtc::Thread::Current(), rtc::Thread::Current()); @@ -58,7 +58,7 @@ 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) { auto cm = cricket::ChannelManager::Create( nullptr, true, rtc::Thread::Current(), rtc::Thread::Current()); @@ -76,7 +76,7 @@ transceiver.StopInternal(); EXPECT_EQ(&channel, transceiver.channel()); - // Set the channel to |nullptr|. + // Set the channel to `nullptr`. transceiver.SetChannel(nullptr); EXPECT_EQ(nullptr, transceiver.channel()); }
diff --git a/pc/rtp_transmission_manager.h b/pc/rtp_transmission_manager.h index fe0e3ab..f616d9d 100644 --- a/pc/rtp_transmission_manager.h +++ b/pc/rtp_transmission_manager.h
@@ -156,7 +156,7 @@ cricket::MediaType media_type); // 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. void OnRemoteSenderRemoved(const RtpSenderInfo& sender_info, MediaStreamInterface* stream, @@ -166,7 +166,7 @@ // session description. // This method triggers CreateAudioSender or CreateVideoSender if the rtp // 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, cricket::MediaType media_type); @@ -174,7 +174,7 @@ // description. // This method triggers DestroyAudioSender or DestroyVideoSender if a stream // 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, cricket::MediaType media_type);
diff --git a/pc/rtp_transport_internal.h b/pc/rtp_transport_internal.h index dfcdbbf..ea1f537 100644 --- a/pc/rtp_transport_internal.h +++ b/pc/rtp_transport_internal.h
@@ -69,7 +69,7 @@ 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. virtual bool SendRtpPacket(rtc::CopyOnWriteBuffer* packet, const rtc::PacketOptions& options,
diff --git a/pc/sctp_data_channel.h b/pc/sctp_data_channel.h index b0df487..0c3b95a 100644 --- a/pc/sctp_data_channel.h +++ b/pc/sctp_data_channel.h
@@ -64,7 +64,7 @@ // a const member. Block access to the 'id' member since it cannot be const. struct InternalDataChannelInit : public DataChannelInit { 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) {} explicit InternalDataChannelInit(const DataChannelInit& base); OpenHandshakeRole open_handshake_role; @@ -73,7 +73,7 @@ // Helper class to allocate unique IDs for SCTP DataChannels. class SctpSidAllocator { 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; // otherwise, the id starts from 1 and takes odd numbers. // Returns false if no ID can be allocated. @@ -82,11 +82,11 @@ // Attempts to reserve a specific sid. Returns false if it's unavailable. 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); 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; std::set<int> used_sids_;
diff --git a/pc/sctp_transport.h b/pc/sctp_transport.h index 87fde53..16b9840 100644 --- a/pc/sctp_transport.h +++ b/pc/sctp_transport.h
@@ -73,7 +73,7 @@ void OnDtlsStateChange(cricket::DtlsTransportInternal* transport, 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. rtc::Thread* const owner_thread_; SctpTransportInformation info_ RTC_GUARDED_BY(owner_thread_);
diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc index 929736e..eaf5f70 100644 --- a/pc/sdp_offer_answer.cc +++ b/pc/sdp_offer_answer.cc
@@ -181,7 +181,7 @@ 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, const SessionDescriptionInterface* new_desc, const std::string& content_name) { @@ -284,7 +284,7 @@ // 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 -// 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. // We need to check both the old local and remote because either // could be the most current from the latest negotation. @@ -297,15 +297,15 @@ (old_content_two && old_content_two->rejected)); } -// Verify that the order of media sections in |new_desc| matches -// |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 -// |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 +// Verify that the order of media sections in `new_desc` matches +// `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 +// `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 // check against the local and remote descriptions stored from the last // negotiation, because either of these could be the most up to date for -// possible rejected m sections. These are the |current_desc| and -// |secondary_current_desc|. +// possible rejected m sections. These are the `current_desc` and +// `secondary_current_desc`. bool MediaSectionsInSameOrder(const SessionDescription& current_desc, const SessionDescription* secondary_current_desc, const SessionDescription& new_desc, @@ -350,7 +350,7 @@ // BUNDLE-tag section (first media section/description in the BUNDLE group) // needs a ufrag and pwd. Mismatches, such as replying with a DTLS fingerprint // 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, bool dtls_enabled, const std::map<std::string, const cricket::ContentGroup*>& @@ -595,7 +595,7 @@ return ""; } -// Add options to |[audio/video]_media_description_options| from |senders|. +// Add options to |[audio/video]_media_description_options| from `senders`. void AddPlanBRtpSenderOptions( const std::vector<rtc::scoped_refptr< RtpSenderProxyWithInternal<RtpSenderInternal>>>& senders, @@ -682,7 +682,7 @@ 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, size_t i) { if (!sdesc) { @@ -692,7 +692,7 @@ 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). void ExtractSharedMediaSessionOptions( const PeerConnectionInterface::RTCOfferAnswerOptions& rtc_options, @@ -713,7 +713,7 @@ 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, webrtc::MediaStreamInterface* new_stream) { if (!new_stream || !current_streams) { @@ -784,13 +784,13 @@ std::unique_ptr<SessionDescriptionInterface> desc(desc_ptr); was_called_ = true; - // Abort early if |pc_| is no longer valid. + // Abort early if `pc_` is no longer valid. if (!sdp_handler_) { operation_complete_callback_(); return; } // DoSetLocalDescription() is a synchronous operation that invokes - // |set_local_description_observer_| with the result. + // `set_local_description_observer_` with the result. sdp_handler_->DoSetLocalDescription( std::move(desc), std::move(set_local_description_observer_)); operation_complete_callback_(); @@ -926,7 +926,7 @@ // Returns true if we have ICE credentials that need restarting. 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. bool SatisfiesIceRestart( const SessionDescriptionInterface& local_description) const { @@ -1116,7 +1116,7 @@ observer_refptr = rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer), 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) { observer_refptr->OnFailure( RTCError(RTCErrorType::INTERNAL_ERROR, @@ -1147,16 +1147,16 @@ rtc::scoped_refptr<SetSessionDescriptionObserver>(observer), desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)]( 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) { // For consistency with SetSessionDescriptionObserverAdapter whose // 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(); return; } // 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( std::move(desc), rtc::scoped_refptr<SetLocalDescriptionObserverInterface>( @@ -1182,7 +1182,7 @@ [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), observer, desc = std::move(desc)]( 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) { observer->OnSetLocalDescriptionComplete(RTCError( RTCErrorType::INTERNAL_ERROR, @@ -1192,7 +1192,7 @@ } this_weak_ptr->DoSetLocalDescription(std::move(desc), observer); // 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. operations_chain_callback(); }); @@ -1209,7 +1209,7 @@ void SdpOfferAnswerHandler::SetLocalDescription( rtc::scoped_refptr<SetLocalDescriptionObserverInterface> observer) { 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. rtc::scoped_refptr<ImplicitCreateSessionDescriptionObserver> create_sdp_observer( @@ -1221,11 +1221,11 @@ operations_chain_->ChainOperation( [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), 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. create_sdp_observer->SetOperationCompleteCallback( 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. if (!this_weak_ptr) { create_sdp_observer->OnFailure(RTCError( @@ -1277,7 +1277,7 @@ // 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 // 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. const SessionDescriptionInterface* old_local_description = local_description(); @@ -1295,7 +1295,7 @@ pending_local_description_ = std::move(desc); } // The session description to apply now must be accessed by - // |local_description()|. + // `local_description()`. RTC_DCHECK(local_description()); // Report statistics about any use of simulcast. @@ -1500,16 +1500,16 @@ rtc::scoped_refptr<SetSessionDescriptionObserver>(observer), desc = std::unique_ptr<SessionDescriptionInterface>(desc_ptr)]( 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) { // For consistency with SetSessionDescriptionObserverAdapter whose // 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(); return; } // 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( std::move(desc), rtc::scoped_refptr<SetRemoteDescriptionObserverInterface>( @@ -1535,7 +1535,7 @@ [this_weak_ptr = weak_ptr_factory_.GetWeakPtr(), observer, desc = std::move(desc)]( 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) { observer->OnSetRemoteDescriptionComplete(RTCError( RTCErrorType::INTERNAL_ERROR, @@ -1546,7 +1546,7 @@ this_weak_ptr->DoSetRemoteDescription(std::move(desc), std::move(observer)); // 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. operations_chain_callback(); }); @@ -1567,7 +1567,7 @@ // 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 // 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. const SessionDescriptionInterface* old_remote_description = remote_description(); @@ -1585,7 +1585,7 @@ pending_remote_description_ = std::move(desc); } // The session description to apply now must be accessed by - // |remote_description()|. + // `remote_description()`. RTC_DCHECK(remote_description()); // Report statistics about any use of simulcast. @@ -1934,7 +1934,7 @@ const SdpType type = desc->GetType(); 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 ApplyLocalDescription fails, the PeerConnection could be in an @@ -2052,7 +2052,7 @@ observer_refptr = rtc::scoped_refptr<CreateSessionDescriptionObserver>(observer), 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) { observer_refptr->OnFailure(RTCError( RTCErrorType::INTERNAL_ERROR, @@ -2198,7 +2198,7 @@ const SdpType type = desc->GetType(); 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 ApplyRemoteDescription fails, the PeerConnection could be in an @@ -2545,7 +2545,7 @@ // 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 // 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. is_negotiation_needed_ = false; update_negotiation_needed_on_empty_chain_ = true; @@ -3556,8 +3556,8 @@ pc_->configuration()->offer_extmap_allow_mixed; // Allow fallback for using obsolete SCTP syntax. - // Note that the default in |session_options| is true, while - // the default in |options| is false. + // Note that the default in `session_options` is true, while + // the default in `options` is false. session_options->use_obsolete_sctp_sdp = offer_answer_options.use_obsolete_sctp_sdp; } @@ -3671,7 +3671,7 @@ // default, rejected media section here that can be later overwritten. for (size_t i = 0; 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 = (i < local_contents.size() ? &local_contents[i] : nullptr); const ContentInfo* current_local_content = @@ -4604,8 +4604,8 @@ RtpTransportInternal* rtp_transport = pc_->GetRtpTransport(mid); // TODO(bugs.webrtc.org/11992): CreateVoiceChannel internally switches to the - // 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). + // 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). return channel_manager()->CreateVoiceChannel( pc_->call_ptr(), pc_->configuration()->media_config, rtp_transport, signaling_thread(), mid, pc_->SrtpRequired(), pc_->GetCryptoOptions(), @@ -4624,8 +4624,8 @@ RtpTransportInternal* rtp_transport = pc_->GetRtpTransport(mid); // TODO(bugs.webrtc.org/11992): CreateVideoChannel internally switches to the - // 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). + // 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). return channel_manager()->CreateVideoChannel( pc_->call_ptr(), pc_->configuration()->media_config, rtp_transport, signaling_thread(), mid, pc_->SrtpRequired(), pc_->GetCryptoOptions(),
diff --git a/pc/sdp_offer_answer.h b/pc/sdp_offer_answer.h index f86b900b..c89ffd2 100644 --- a/pc/sdp_offer_answer.h +++ b/pc/sdp_offer_answer.h
@@ -237,7 +237,7 @@ bundle_groups_by_mid); // 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. void DoCreateOffer( const PeerConnectionInterface::RTCOfferAnswerOptions& options, @@ -361,7 +361,7 @@ rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>> 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. void GetOptionsForOffer(const PeerConnectionInterface::RTCOfferAnswerOptions& offer_answer_options, @@ -378,7 +378,7 @@ RTC_RUN_ON(signaling_thread()); // 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& offer_answer_options, cricket::MediaSessionOptions* session_options); @@ -416,9 +416,9 @@ // Runs the algorithm specified in // https://w3c.github.io/webrtc-pc/#process-remote-track-removal // 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. - // |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. void ProcessRemovalOfRemoteTrack( const rtc::scoped_refptr<RtpTransceiverProxyWithInternal<RtpTransceiver>> @@ -431,23 +431,23 @@ remote_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). 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. // For each new or removed StreamParam, OnLocalSenderSeen or // OnLocalSenderRemoved is invoked. void UpdateLocalSenders(const std::vector<cricket::StreamParams>& streams, 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 - // 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. - // |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|. + // `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`. void UpdateRemoteSendersList( const std::vector<cricket::StreamParams>& streams, bool default_track_needed, @@ -469,8 +469,8 @@ SdpType type); // Helper function to remove stopped transceivers. void RemoveStoppedTransceivers(); - // Deletes the corresponding channel of contents that don't exist in |desc|. - // |desc| can be null. This means that all channels are deleted. + // Deletes the corresponding channel of contents that don't exist in `desc`. + // `desc` can be null. This means that all channels are deleted. void RemoveUnusedChannels(const cricket::SessionDescription* desc); // Report inferred negotiated SDP semantics from a local/remote answer to the @@ -478,18 +478,18 @@ void ReportNegotiatedSdpSemantics(const SessionDescriptionInterface& answer); // 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. void UpdateEndedRemoteMediaStreams(); - // Uses all remote candidates in |remote_desc| in this session. + // Uses all remote candidates in `remote_desc` in this session. bool UseCandidatesInSessionDescription( const SessionDescriptionInterface* remote_desc); - // Uses |candidate| in this session. + // Uses `candidate` in this session. bool UseCandidate(const IceCandidateInterface* 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 - // description should be used. Output |valid| is true if the candidate media + // `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 // index is valid. bool ReadyToUseRemoteCandidate(const IceCandidateInterface* candidate, const SessionDescriptionInterface* remote_desc, @@ -503,7 +503,7 @@ // Note that cricket code uses the term "channel" for what other code // 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. // This method will also delete any existing media channels before creating. RTCError CreateChannels(const cricket::SessionDescription& desc); @@ -526,7 +526,7 @@ // Destroys the given ChannelInterface. // The channel cannot be accessed after this method is called. 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. void GenerateMediaDescriptionOptions(
diff --git a/pc/sdp_serializer.cc b/pc/sdp_serializer.cc index 1074316..e0847d6 100644 --- a/pc/sdp_serializer.cc +++ b/pc/sdp_serializer.cc
@@ -249,7 +249,7 @@ // Set the layers according to which pair is send and which is recv // 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. SimulcastDescription simulcast; if (list1.ok()) { @@ -362,8 +362,8 @@ return ParseError("Invalid format for restriction: " + restriction); } - // |parts| contains at least one value and it does not contain a space. - // Note: |parts| and other values might still contain tab, newline, + // `parts` contains at least one value and it does not contain a space. + // Note: `parts` and other values might still contain tab, newline, // unprintable characters, etc. which will not generate errors here but // will (most-likely) be ignored by components down stream. if (parts[0] == kPayloadType) { @@ -376,7 +376,7 @@ 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]) != rid_description.restrictions.end()) { return ParseError("Duplicate restriction specified: " + parts[0]);
diff --git a/pc/sdp_serializer.h b/pc/sdp_serializer.h index 1223cd1..559fac0 100644 --- a/pc/sdp_serializer.h +++ b/pc/sdp_serializer.h
@@ -28,7 +28,7 @@ // format without knowing about the SDP attribute details (a=simulcast:) // Usage: // 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. // This class will allow testing the serialization of components without // having to serialize the entire SDP while hiding implementation details
diff --git a/pc/sdp_serializer_unittest.cc b/pc/sdp_serializer_unittest.cc index b50f4f9..68d4c2a 100644 --- a/pc/sdp_serializer_unittest.cc +++ b/pc/sdp_serializer_unittest.cc
@@ -96,8 +96,8 @@ class SimulcastSdpSerializerTest : public TestWithParam<const char*> { public: // Runs a test for deserializing Simulcast. - // |str| - The serialized Simulcast to parse. - // |expected| - The expected output Simulcast to compare to. + // `str` - The serialized Simulcast to parse. + // `expected` - The expected output Simulcast to compare to. void TestDeserialization(const std::string& str, const SimulcastDescription& expected) const { SdpSerializer deserializer; @@ -107,8 +107,8 @@ } // Runs a test for serializing Simulcast. - // |simulcast| - The Simulcast to serialize. - // |expected| - The expected output string to compare to. + // `simulcast` - The Simulcast to serialize. + // `expected` - The expected output string to compare to. void TestSerialization(const SimulcastDescription& simulcast, const std::string& expected) const { SdpSerializer serializer; @@ -280,8 +280,8 @@ class RidDescriptionSdpSerializerTest : public TestWithParam<const char*> { public: // Runs a test for deserializing Rid Descriptions. - // |str| - The serialized Rid Description to parse. - // |expected| - The expected output RidDescription to compare to. + // `str` - The serialized Rid Description to parse. + // `expected` - The expected output RidDescription to compare to. void TestDeserialization(const std::string& str, const RidDescription& expected) const { SdpSerializer deserializer; @@ -291,8 +291,8 @@ } // Runs a test for serializing RidDescriptions. - // |rid_description| - The RidDescription to serialize. - // |expected| - The expected output string to compare to. + // `rid_description` - The RidDescription to serialize. + // `expected` - The expected output string to compare to. void TestSerialization(const RidDescription& rid_description, const std::string& expected) const { SdpSerializer serializer;
diff --git a/pc/session_description.h b/pc/session_description.h index a20caf6..fed0839 100644 --- a/pc/session_description.h +++ b/pc/session_description.h
@@ -99,7 +99,7 @@ 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. virtual std::string protocol() const { return protocol_; } virtual void set_protocol(const std::string& protocol) { @@ -443,11 +443,11 @@ ContentInfo(ContentInfo&& o) = default; ContentInfo& operator=(ContentInfo&& o) = default; - // Alias for |name|. + // Alias for `name`. std::string mid() const { return name; } void set_mid(const std::string& mid) { this->name = mid; } - // Alias for |description|. + // Alias for `description`. MediaContentDescription* media_description(); const MediaContentDescription* media_description() const; @@ -470,7 +470,7 @@ // 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. -// GroupInfo should be populated only with the |content_name| of the +// GroupInfo should be populated only with the `content_name` of the // MediaDescription. class ContentGroup { public: @@ -580,7 +580,7 @@ // Group mutators. 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); // Global attributes.
diff --git a/pc/srtp_session_unittest.cc b/pc/srtp_session_unittest.cc index c492c63..dc08c2e 100644 --- a/pc/srtp_session_unittest.cc +++ b/pc/srtp_session_unittest.cc
@@ -136,7 +136,7 @@ int out_len = 0; EXPECT_TRUE(s1_.ProtectRtp(rtp_packet_, rtp_len_, sizeof(rtp_packet_), &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)); EXPECT_EQ(be64_index, index); }
diff --git a/pc/srtp_transport_unittest.cc b/pc/srtp_transport_unittest.cc index cb8d836..46e7397 100644 --- a/pc/srtp_transport_unittest.cc +++ b/pc/srtp_transport_unittest.cc
@@ -133,7 +133,7 @@ memcpy(original_rtp_data, rtp_packet_data, rtp_len); 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. ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, cricket::PF_SRTP_BYPASS)); @@ -181,7 +181,7 @@ packet_size); 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. ASSERT_TRUE(srtp_transport1_->SendRtcpPacket(&rtcp_packet1to2, options, cricket::PF_SRTP_BYPASS)); @@ -263,7 +263,7 @@ memcpy(original_rtp_data, rtp_packet_data, rtp_len); 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. ASSERT_TRUE(srtp_transport1_->SendRtpPacket(&rtp_packet1to2, options, cricket::PF_SRTP_BYPASS));
diff --git a/pc/stats_collector.cc b/pc/stats_collector.cc index c915661..cad9cf6 100644 --- a/pc/stats_collector.cc +++ b/pc/stats_collector.cc
@@ -552,7 +552,7 @@ 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. void StatsCollector::AddStream(MediaStreamInterface* stream) { RTC_DCHECK_RUN_ON(pc_->signaling_thread());
diff --git a/pc/stats_collector_unittest.cc b/pc/stats_collector_unittest.cc index a42ed86..07df5a8 100644 --- a/pc/stats_collector_unittest.cc +++ b/pc/stats_collector_unittest.cc
@@ -197,8 +197,8 @@ return TypedIdFromIdString(StatsReport::kStatsReportTypeCertificate, cert_id); } -// Finds the |n|-th report of type |type| in |reports|. -// |n| starts from 1 for finding the first report. +// Finds the `n`-th report of type `type` in `reports`. +// `n` starts from 1 for finding the first report. const StatsReport* FindNthReportByType(const StatsReports& reports, const StatsReport::StatsType& type, int n) { @@ -212,10 +212,10 @@ return nullptr; } -// Returns the value of the stat identified by |name| in the |n|-th report of -// type |type| in |reports|. -// |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 +// Returns the value of the stat identified by `name` in the `n`-th report of +// type `type` in `reports`. +// `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 // report, then nullopt is returned. absl::optional<std::string> GetValueInNthReportByType( const StatsReports& reports, @@ -1101,17 +1101,17 @@ StatsReports 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. EXPECT_LE(3u, reports.size()); const StatsReport* track_report = FindNthReportByType(reports, StatsReport::kStatsReportTypeTrack, 1); EXPECT_TRUE(track_report); - // Get report for the specific |track|. + // Get report for the specific `track`. reports.clear(); 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. EXPECT_LE(3u, reports.size()); track_report = @@ -1248,7 +1248,7 @@ StatsReports 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. EXPECT_LE(3u, reports.size()); const StatsReport* track_report = @@ -1508,8 +1508,8 @@ voice_sender_info.packets_lost = -1; voice_sender_info.jitter_ms = -1; - // Some of the contents in |voice_sender_info| needs to be updated from the - // |audio_track_|. + // Some of the contents in `voice_sender_info` needs to be updated from the + // `audio_track_`. UpdateVoiceSenderInfoFromAudioTrack(local_track.get(), &voice_sender_info, true); @@ -1669,8 +1669,8 @@ VoiceSenderInfo voice_sender_info; InitVoiceSenderInfo(&voice_sender_info); - // Some of the contents in |voice_sender_info| needs to be updated from the - // |audio_track_|. + // Some of the contents in `voice_sender_info` needs to be updated from the + // `audio_track_`. UpdateVoiceSenderInfoFromAudioTrack(audio_track_.get(), &voice_sender_info, true);
diff --git a/pc/test/fake_audio_capture_module.h b/pc/test/fake_audio_capture_module.h index d2db3d6..fd13a85 100644 --- a/pc/test/fake_audio_capture_module.h +++ b/pc/test/fake_audio_capture_module.h
@@ -170,12 +170,12 @@ // Initializes the state of the FakeAudioCaptureModule. This API is called on // creation by the Create() API. bool Initialize(); - // SetBuffer() sets all samples in send_buffer_ to |value|. + // SetBuffer() sets all samples in send_buffer_ to `value`. void SetSendBuffer(int value); // Resets rec_buffer_. I.e., sets all rec_buffer_ samples to 0. void ResetRecBuffer(); // Returns true if rec_buffer_ contains one or more sample greater than or - // equal to |value|. + // equal to `value`. bool CheckRecBuffer(int value); // Returns true/false depending on if recording or playback has been
diff --git a/pc/test/integration_test_helpers.h b/pc/test/integration_test_helpers.h index af59a83..c7c17b7 100644 --- a/pc/test/integration_test_helpers.h +++ b/pc/test/integration_test_helpers.h
@@ -799,7 +799,7 @@ const PeerConnectionInterface::RTCConfiguration* config, webrtc::PeerConnectionDependencies dependencies) { 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. if (config) { modified_config = *config; @@ -956,7 +956,7 @@ } } - // 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). void SendSdpMessage(SdpType type, const std::string& msg) { if (signaling_delay_ms_ == 0) { @@ -977,7 +977,7 @@ } } - // 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). void SendIceMessage(const std::string& sdp_mid, int sdp_mline_index, @@ -1125,7 +1125,7 @@ std::string debug_name_; 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; rtc::scoped_refptr<webrtc::PeerConnectionInterface> peer_connection_; @@ -1153,7 +1153,7 @@ // them, if required. std::vector<rtc::scoped_refptr<webrtc::VideoTrackSource>> 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_; SdpSemantics sdp_semantics_; @@ -1403,7 +1403,7 @@ 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. std::unique_ptr<PeerConnectionIntegrationWrapper> CreatePeerConnectionWrapper( const std::string& debug_name, @@ -1654,8 +1654,8 @@ PeerConnectionIntegrationWrapper* caller() { return caller_.get(); } - // Set the |caller_| to the |wrapper| passed in and return the - // original |caller_|. + // Set the `caller_` to the `wrapper` passed in and return the + // original `caller_`. PeerConnectionIntegrationWrapper* SetCallerPcWrapperAndReturnCurrent( PeerConnectionIntegrationWrapper* wrapper) { PeerConnectionIntegrationWrapper* old = caller_.release(); @@ -1665,8 +1665,8 @@ PeerConnectionIntegrationWrapper* callee() { return callee_.get(); } - // Set the |callee_| to the |wrapper| passed in and return the - // original |callee_|. + // Set the `callee_` to the `wrapper` passed in and return the + // original `callee_`. PeerConnectionIntegrationWrapper* SetCalleePcWrapperAndReturnCurrent( PeerConnectionIntegrationWrapper* wrapper) { PeerConnectionIntegrationWrapper* old = callee_.release(); @@ -1687,7 +1687,7 @@ // Expects the provided number of new frames to be received within // 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. bool ExpectNewFrames(const MediaExpectations& media_expectations) { // Make sure there are no bogus tracks confusing the issue. @@ -1841,11 +1841,11 @@ SdpSemantics sdp_semantics_; 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::FirewallSocketServer> fss_; - // |network_thread_| and |worker_thread_| are used by both - // |caller_| and |callee_| so they must be destroyed + // `network_thread_` and `worker_thread_` are used by both + // `caller_` and `callee_` so they must be destroyed // later. std::unique_ptr<rtc::Thread> network_thread_; std::unique_ptr<rtc::Thread> worker_thread_;
diff --git a/pc/test/peer_connection_test_wrapper.cc b/pc/test/peer_connection_test_wrapper.cc index 8fdfb1b..fef2cfb 100644 --- a/pc/test/peer_connection_test_wrapper.cc +++ b/pc/test/peer_connection_test_wrapper.cc
@@ -188,7 +188,7 @@ } 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::string sdp; EXPECT_TRUE(desc->ToString(&sdp));
diff --git a/pc/track_media_info_map.cc b/pc/track_media_info_map.cc index 66f4c46..e68f2f7 100644 --- a/pc/track_media_info_map.cc +++ b/pc/track_media_info_map.cc
@@ -56,7 +56,7 @@ if (!track) { 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(); if (ssrc != 0) { if (media_type == cricket::MEDIA_TYPE_AUDIO) {
diff --git a/pc/track_media_info_map_unittest.cc b/pc/track_media_info_map_unittest.cc index a0e37a2..42962da 100644 --- a/pc/track_media_info_map_unittest.cc +++ b/pc/track_media_info_map_unittest.cc
@@ -112,7 +112,7 @@ ~TrackMediaInfoMapTest() { // 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_) { delete voice_media_info_; delete video_media_info_;
diff --git a/pc/usage_pattern.h b/pc/usage_pattern.h index 0182999..1437330 100644 --- a/pc/usage_pattern.h +++ b/pc/usage_pattern.h
@@ -25,14 +25,14 @@ DATA_ADDED = 0x04, AUDIO_ADDED = 0x08, VIDEO_ADDED = 0x10, - // |SetLocalDescription| returns successfully. + // `SetLocalDescription` returns successfully. SET_LOCAL_DESCRIPTION_SUCCEEDED = 0x20, - // |SetRemoteDescription| returns successfully. + // `SetRemoteDescription` returns successfully. SET_REMOTE_DESCRIPTION_SUCCEEDED = 0x40, // A local candidate (with type host, server-reflexive, or relay) is // collected. CANDIDATE_COLLECTED = 0x80, - // A remote candidate is successfully added via |AddIceCandidate|. + // A remote candidate is successfully added via `AddIceCandidate`. ADD_ICE_CANDIDATE_SUCCEEDED = 0x100, ICE_STATE_CONNECTED = 0x200, CLOSE_CALLED = 0x400,
diff --git a/pc/used_ids.h b/pc/used_ids.h index 62b2faa..e88927a 100644 --- a/pc/used_ids.h +++ b/pc/used_ids.h
@@ -28,7 +28,7 @@ next_id_(max_allowed_id) {} 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 // in a session description to make sure no duplicate ids exists. // Note that typename Id must be a type of IdStruct. @@ -39,7 +39,7 @@ } } - // 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) { const int original_id = idstruct->id; int new_id = idstruct->id; @@ -141,7 +141,7 @@ // 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 // 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 { if (next_extension_id_ <= webrtc::RtpExtension::kOneByteHeaderExtensionMaxId) {
diff --git a/pc/video_rtp_receiver.h b/pc/video_rtp_receiver.h index f59db7a..b538186 100644 --- a/pc/video_rtp_receiver.h +++ b/pc/video_rtp_receiver.h
@@ -146,7 +146,7 @@ cricket::VideoMediaChannel* media_channel_ RTC_GUARDED_BY(worker_thread_) = nullptr; 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. const rtc::scoped_refptr<VideoRtpTrackSource> source_; const rtc::scoped_refptr<VideoTrackProxyWithInternal<VideoTrack>> track_; @@ -173,10 +173,10 @@ rtc::scoped_refptr<FrameTransformerInterface> frame_transformer_ RTC_GUARDED_BY(worker_thread_); // 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_); - // 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. bool saved_generate_keyframe_ RTC_GUARDED_BY(worker_thread_) = false; bool saved_encoded_sink_enabled_ RTC_GUARDED_BY(worker_thread_) = false;
diff --git a/pc/video_rtp_track_source.h b/pc/video_rtp_track_source.h index 47b7bc9..23a7cd2 100644 --- a/pc/video_rtp_track_source.h +++ b/pc/video_rtp_track_source.h
@@ -75,7 +75,7 @@ private: 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 // the VideoSinkWants. rtc::VideoBroadcaster broadcaster_;
diff --git a/pc/video_track.h b/pc/video_track.h index e840c80..49deaee 100644 --- a/pc/video_track.h +++ b/pc/video_track.h
@@ -54,7 +54,7 @@ ~VideoTrack(); private: - // Implements ObserverInterface. Observes |video_source_| state. + // Implements ObserverInterface. Observes `video_source_` state. void OnChanged() override; RTC_NO_UNIQUE_ADDRESS webrtc::SequenceChecker signaling_thread_;
diff --git a/pc/video_track_unittest.cc b/pc/video_track_unittest.cc index ab094ec..6342b60 100644 --- a/pc/video_track_unittest.cc +++ b/pc/video_track_unittest.cc
@@ -54,14 +54,14 @@ // Test adding renderers to a video track and render to them by providing // frames to the source. TEST_F(VideoTrackTest, RenderVideo) { - // FakeVideoTrackRenderer register itself to |video_track_| + // FakeVideoTrackRenderer register itself to `video_track_` std::unique_ptr<FakeVideoTrackRenderer> renderer_1( new FakeVideoTrackRenderer(video_track_.get())); video_track_source_->InjectFrame(frame_source_.GetFrame()); 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( new FakeVideoTrackRenderer(video_track_.get())); video_track_source_->InjectFrame(frame_source_.GetFrame());
diff --git a/pc/webrtc_sdp.cc b/pc/webrtc_sdp.cc index 379b2f3..4aa6191 100644 --- a/pc/webrtc_sdp.cc +++ b/pc/webrtc_sdp.cc
@@ -388,19 +388,19 @@ // Helper functions // 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 // following way when error happens: // "return ParseFailed***(...);" -// The line starting at |line_start| of |message| is the failing line. -// The reason for the failure should be provided in the |description|. +// The line starting at `line_start` of `message` is the failing line. +// The reason for the failure should be provided in the `description`. // An example of a description could be "unknown character". static bool ParseFailed(const std::string& message, size_t line_start, const std::string& description, SdpParseError* error) { - // Get the first line of |message| from |line_start|. + // Get the first line of `message` from `line_start`. std::string first_line; size_t line_end = message.find(kNewLine, line_start); if (line_end != std::string::npos) { @@ -421,8 +421,8 @@ return false; } -// |line| is the failing line. The reason for the failure should be -// provided in the |description|. +// `line` is the failing line. The reason for the failure should be +// provided in the `description`. static bool ParseFailed(const std::string& line, const std::string& description, SdpParseError* error) { @@ -435,8 +435,8 @@ return ParseFailed("", description, error); } -// |line| is the failing line. The failure is due to the fact that |line| -// doesn't have |expected_fields| fields. +// `line` is the failing line. The failure is due to the fact that `line` +// doesn't have `expected_fields` fields. static bool ParseFailedExpectFieldNum(const std::string& line, int expected_fields, SdpParseError* error) { @@ -445,8 +445,8 @@ return ParseFailed(line, description.str(), error); } -// |line| is the failing line. The failure is due to the fact that |line| has -// less than |expected_min_fields| fields. +// `line` is the failing line. The failure is due to the fact that `line` has +// less than `expected_min_fields` fields. static bool ParseFailedExpectMinFieldNum(const std::string& line, int expected_min_fields, SdpParseError* error) { @@ -455,8 +455,8 @@ return ParseFailed(line, description.str(), error); } -// |line| is the failing line. The failure is due to the fact that it failed to -// get the value of |attribute|. +// `line` is the failing line. The failure is due to the fact that it failed to +// get the value of `attribute`. static bool ParseFailedGetValue(const std::string& line, const std::string& attribute, SdpParseError* error) { @@ -465,10 +465,10 @@ 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") // 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, size_t line_start, const char line_type, @@ -527,7 +527,7 @@ return true; } -// Init |os| to "|type|=|value|". +// Init `os` to "`type`=`value`". static void InitLine(const char type, const std::string& value, rtc::StringBuilder* os) { @@ -535,12 +535,12 @@ *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) { 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, int value, std::string* message) { @@ -690,7 +690,7 @@ } // 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 // exist. We prioritize getting stream_ids/track_ids signaled in a=msid lines. void CreateTracksFromSsrcInfos(const SsrcInfoVec& ssrc_infos, @@ -784,11 +784,11 @@ return preference; } -// 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 +// 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 // likely to work, typically IPv4 relay. // 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 // pass it down via SessionDescription. static void GetDefaultDestination(const std::vector<Candidate>& candidates, @@ -831,7 +831,7 @@ } } -// 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) { std::string rtcp_line, rtcp_port, rtcp_ip, addr_type; GetDefaultDestination(candidates, ICE_CANDIDATE_COMPONENT_RTCP, &rtcp_port, @@ -1046,12 +1046,12 @@ bool is_raw) { RTC_DCHECK(candidate != NULL); - // Get the first line from |message|. + // Get the first line from `message`. std::string first_line = message; size_t pos = 0; 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()) { std::string left, right; if (rtc::tokenize_first(message, kNewLineChar, &left, &right) && @@ -1071,7 +1071,7 @@ std::string attribute_candidate; 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, &attribute_candidate, &candidate_value) || attribute_candidate != kAttributeCandidate) { @@ -1772,23 +1772,23 @@ } 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 InitAttrLine(kAttributeFmtp, os); - // Add :|payload_type| + // Add :`payload_type` *os << kSdpDelimiterColon << payload_type; } 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 InitAttrLine(kAttributePacketization, os); - // Add :|payload_type| + // Add :`payload_type` *os << kSdpDelimiterColon << payload_type; } 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>> // Add a=rtcp-fb InitAttrLine(kAttributeRtcpFb, os); @@ -1808,7 +1808,7 @@ // RFC 2198 and RFC 4733 don't use key-value pairs. *os << parameter_value; } else { - // fmtp parameters: |parameter_name|=|parameter_value| + // fmtp parameters: `parameter_name`=`parameter_value` *os << parameter_name << kSdpDelimiterEqual << parameter_value; } } @@ -2469,7 +2469,7 @@ // Will remove Simulcast Layers if: // 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( const std::vector<RidDescription>& valid_rids, SimulcastDescription* simulcast) { @@ -2668,7 +2668,7 @@ } } - // Make a temporary TransportDescription based on |session_td|. + // Make a temporary TransportDescription based on `session_td`. // Some of this gets overwritten by ParseContent. TransportDescription transport( session_td.transport_options, session_td.ice_ufrag, session_td.ice_pwd, @@ -2848,7 +2848,7 @@ } } -// 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 // with that payload type. template <class T> @@ -2856,7 +2856,7 @@ const T* codec = FindCodecById(codecs, payload_type); if (codec) return *codec; - // Return empty codec with |payload_type|. + // Return empty codec with `payload_type`. T ret_val; ret_val.id = payload_type; return ret_val; @@ -2883,8 +2883,8 @@ desc->set_codecs(codecs); } -// Adds or updates existing codec corresponding to |payload_type| according -// to |parameters|. +// Adds or updates existing codec corresponding to `payload_type` according +// to `parameters`. template <class T, class U> void UpdateCodec(MediaContentDescription* content_desc, int payload_type, @@ -2896,8 +2896,8 @@ AddOrReplaceCodec<T, U>(content_desc, new_codec); } -// Adds or updates existing codec corresponding to |payload_type| according -// to |feedback_param|. +// Adds or updates existing codec corresponding to `payload_type` according +// to `feedback_param`. template <class T, class U> void UpdateCodec(MediaContentDescription* content_desc, int payload_type, @@ -2909,8 +2909,8 @@ AddOrReplaceCodec<T, U>(content_desc, new_codec); } -// Adds or updates existing video codec corresponding to |payload_type| -// according to |packetization|. +// Adds or updates existing video codec corresponding to `payload_type` +// according to `packetization`. void UpdateVideoCodecPacketization(VideoContentDescription* video_desc, int payload_type, const std::string& packetization) { @@ -3322,7 +3322,7 @@ 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 // will be created in CreateTracksFromSsrcInfos, containing all the SSRCs from // the m= section. @@ -3351,7 +3351,7 @@ } } - // Add the new tracks to the |media_desc|. + // Add the new tracks to the `media_desc`. for (StreamParams& track : tracks) { media_desc->AddStream(track); } @@ -3429,7 +3429,7 @@ 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. auto ssrc_info_it = absl::c_find_if(*ssrc_infos, [ssrc_id](const SsrcInfo& ssrc_info) { @@ -3443,7 +3443,7 @@ } SsrcInfo& ssrc_info = *ssrc_info_it; - // Store the info to the |ssrc_info|. + // Store the info to the `ssrc_info`. if (attribute == kSsrcAttributeCname) { // RFC 5576 // cname:<value> @@ -3533,7 +3533,7 @@ } // 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, const std::string& name, int clockrate, @@ -3553,7 +3553,7 @@ } // 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, const std::string& name, VideoContentDescription* video_desc) {
diff --git a/pc/webrtc_sdp.h b/pc/webrtc_sdp.h index aa3317f..6d6980a 100644 --- a/pc/webrtc_sdp.h +++ b/pc/webrtc_sdp.h
@@ -94,18 +94,18 @@ cricket::Candidate* candidate, SdpParseError* error); -// Parses |message| according to the grammar defined in RFC 5245, Section 15.1 -// and, if successful, stores the result in |candidate| and returns true. -// If unsuccessful, returns false and stores error information in |error| if -// |error| is not null. -// If |is_raw| is false, |message| is expected to be prefixed with "a=". -// If |is_raw| is true, no prefix is expected in |messaage|. +// Parses `message` according to the grammar defined in RFC 5245, Section 15.1 +// and, if successful, stores the result in `candidate` and returns true. +// If unsuccessful, returns false and stores error information in `error` if +// `error` is not null. +// If `is_raw` is false, `message` is expected to be prefixed with "a=". +// If `is_raw` is true, no prefix is expected in `messaage`. RTC_EXPORT bool ParseCandidate(const std::string& message, cricket::Candidate* candidate, SdpParseError* error, 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 // IsFmtpParam(). Returns true if the set of FMTP parameters is nonempty, false // otherwise.
diff --git a/pc/webrtc_sdp_unittest.cc b/pc/webrtc_sdp_unittest.cc index 266fd3d..310da38 100644 --- a/pc/webrtc_sdp_unittest.cc +++ b/pc/webrtc_sdp_unittest.cc
@@ -907,7 +907,7 @@ 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, const std::string& newlines, std::string* message) { @@ -920,8 +920,8 @@ absl::StrReplaceAll({{line, newlines}}, message); } -// Expect a parse failure on the line containing |bad_part| when attempting to -// parse |bad_sdp|. +// Expect a parse failure on the line containing `bad_part` when attempting to +// parse `bad_sdp`. static void ExpectParseFailure(const std::string& bad_sdp, const std::string& bad_part) { JsepSessionDescription desc(kDummyType); @@ -932,14 +932,14 @@ << "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) { std::string bad_sdp = kSdpFullString; Replace(good_part, bad_part, &bad_sdp); 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, const std::string& newlines, const std::string& bad_part) { @@ -1583,7 +1583,7 @@ 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. bool RemoveCandidateUfragPwd(std::string* sdp) { absl::StrReplaceAll( @@ -1591,7 +1591,7 @@ 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, int mline_index, const std::string& ufrag, @@ -2396,7 +2396,7 @@ ASSERT_NE(before_pt, std::string::npos); before_pt += strlen("a=rtpmap:"); 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 + " "; size_t fmtp_pos = message.find(to_find); ASSERT_NE(std::string::npos, fmtp_pos) << "Failed to find " << to_find; @@ -3670,7 +3670,7 @@ // Fingerprint attribute is necessary to add DTLS setup attribute. InjectAfter(kAttributeIcePwdVoice, 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); EXPECT_EQ(sdp_with_dtlssetup, message); }
diff --git a/pc/webrtc_session_description_factory.cc b/pc/webrtc_session_description_factory.cc index 3382634..995ef5e 100644 --- a/pc/webrtc_session_description_factory.cc +++ b/pc/webrtc_session_description_factory.cc
@@ -142,7 +142,7 @@ // RFC 4566 suggested a Network Time Protocol (NTP) format timestamp // 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 - // |kInitSessionVersion|. + // `kInitSessionVersion`. session_version_(kInitSessionVersion), cert_generator_(dtls_enabled ? std::move(cert_generator) : nullptr), sdp_info_(sdp_info), @@ -160,13 +160,13 @@ // SRTP-SDES is disabled if DTLS is on. SetSdesPolicy(cricket::SEC_DISABLED); if (certificate) { - // Use |certificate|. + // Use `certificate`. certificate_request_state_ = CERTIFICATE_WAITING; 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 - // |SignalCertificateReady|. + // `SignalCertificateReady`. signaling_thread_->Post( RTC_FROM_HERE, this, MSG_USE_CONSTRUCTOR_CERTIFICATE, new rtc::ScopedRefMessageData<rtc::RTCCertificate>(certificate)); @@ -186,7 +186,7 @@ << key_params.type() << ")."; // 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, callback); } @@ -361,7 +361,7 @@ // 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. - // 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_); auto offer = std::make_unique<JsepSessionDescription>( SdpType::kOffer, std::move(desc), session_id_, @@ -419,8 +419,8 @@ // 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 // unrelated to the version number in the o line of the offer. - // Get a new version number by increasing the |session_version_answer_|. - // The |session_version_| is a uint64_t, the wrap around should not happen. + // Get a new version number by increasing the `session_version_answer_`. + // The `session_version_` is a uint64_t, the wrap around should not happen. RTC_DCHECK(session_version_ + 1 > session_version_); auto answer = std::make_unique<JsepSessionDescription>( SdpType::kAnswer, std::move(desc), session_id_,
diff --git a/pc/webrtc_session_description_factory.h b/pc/webrtc_session_description_factory.h index bd2636c..d0b3ad7 100644 --- a/pc/webrtc_session_description_factory.h +++ b/pc/webrtc_session_description_factory.h
@@ -75,7 +75,7 @@ class WebRtcSessionDescriptionFactory : public rtc::MessageHandler, public sigslot::has_slots<> { 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 // asynchronously. If a certificate is given, will use that for identifying // over DTLS. If neither is specified, DTLS is disabled.