From bceec84aeedcb9f5992d30dae0b477fb5e227fee Mon Sep 17 00:00:00 2001 From: Jared Siskin Date: Thu, 20 Apr 2023 14:10:51 -0700 Subject: [PATCH] Format ^(api|call|common_audio|examples|media|net|p2p|pc)/ half of the remaining folders git ls-files | grep -e "\(\.h\|\.cc\)$" | grep -E "^(api|call|common_audio|examples|media|net|p2p|pc)/" | xargs clang-format -i ; git cl format after landing: add to .git-blame-ignore-revs Bug: webrtc:15082 Change-Id: I8b2cac13f4587d3ce9b2fccc7362967283f57ea2 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302062 Commit-Queue: Mirko Bonadei Reviewed-by: Harald Alvestrand Cr-Commit-Position: refs/heads/main@{#39977} --- api/audio_codecs/audio_decoder.cc | 1 - ...audio_encoder_multi_channel_opus_config.cc | 5 +- api/media_stream_interface.cc | 1 + api/neteq/default_neteq_controller_factory.cc | 1 + api/neteq/neteq_controller.h | 1 - api/stats/rtc_stats.h | 8 ++- api/units/timestamp_unittest.cc | 3 +- api/video_codecs/video_encoder.cc | 1 + api/voip/test/voip_engine_factory_unittest.cc | 3 +- call/adaptation/test/mock_resource_listener.h | 1 - call/flexfec_receive_stream_unittest.cc | 4 +- call/rtp_demuxer_unittest.cc | 1 - call/rtp_video_sender.cc | 14 ++--- common_audio/resampler/sinc_resampler.h | 8 +-- .../third_party/ooura/fft_size_256/fft4g.cc | 4 +- .../third_party/ooura/fft_size_256/fft4g.h | 2 + common_audio/wav_header.h | 1 + .../jni/android_call_client.cc | 3 +- .../androidvoip/jni/android_voip_client.cc | 1 + media/base/stream_params.h | 3 +- media/base/video_adapter.cc | 4 +- media/engine/fake_webrtc_video_engine.cc | 3 +- net/dcsctp/packet/chunk/data_chunk.cc | 8 +-- net/dcsctp/packet/chunk/idata_chunk.cc | 8 +-- p2p/base/basic_async_resolver_factory.cc | 1 - p2p/base/connection_info.h | 12 ++--- p2p/base/stun_request.cc | 2 +- p2p/base/transport_description_unittest.cc | 1 + pc/channel_unittest.cc | 1 - pc/data_channel_utils.h | 1 + pc/peer_connection.cc | 26 +++++----- pc/peer_connection.h | 4 +- pc/proxy.h | 52 +++++++++++++------ pc/rtc_stats_collector.cc | 3 +- pc/sdp_offer_answer.cc | 12 ++--- pc/session_description.cc | 3 +- 36 files changed, 112 insertions(+), 95 deletions(-) diff --git a/api/audio_codecs/audio_decoder.cc b/api/audio_codecs/audio_decoder.cc index 28f5b8aae8..0a131f15bc 100644 --- a/api/audio_codecs/audio_decoder.cc +++ b/api/audio_codecs/audio_decoder.cc @@ -10,7 +10,6 @@ #include "api/audio_codecs/audio_decoder.h" - #include #include diff --git a/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc b/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc index 0052c429b2..e159bd77cf 100644 --- a/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc +++ b/api/audio_codecs/opus/audio_encoder_multi_channel_opus_config.cc @@ -32,8 +32,9 @@ AudioEncoderMultiChannelOpusConfig::AudioEncoderMultiChannelOpusConfig( const AudioEncoderMultiChannelOpusConfig&) = default; AudioEncoderMultiChannelOpusConfig::~AudioEncoderMultiChannelOpusConfig() = default; -AudioEncoderMultiChannelOpusConfig& AudioEncoderMultiChannelOpusConfig:: -operator=(const AudioEncoderMultiChannelOpusConfig&) = default; +AudioEncoderMultiChannelOpusConfig& +AudioEncoderMultiChannelOpusConfig::operator=( + const AudioEncoderMultiChannelOpusConfig&) = default; bool AudioEncoderMultiChannelOpusConfig::IsOk() const { if (frame_size_ms <= 0 || frame_size_ms % 10 != 0) diff --git a/api/media_stream_interface.cc b/api/media_stream_interface.cc index e07907917b..6b0a6a9297 100644 --- a/api/media_stream_interface.cc +++ b/api/media_stream_interface.cc @@ -9,6 +9,7 @@ */ #include "api/media_stream_interface.h" + #include "api/media_types.h" namespace webrtc { diff --git a/api/neteq/default_neteq_controller_factory.cc b/api/neteq/default_neteq_controller_factory.cc index 22274dc7cc..4e0a0df108 100644 --- a/api/neteq/default_neteq_controller_factory.cc +++ b/api/neteq/default_neteq_controller_factory.cc @@ -9,6 +9,7 @@ */ #include "api/neteq/default_neteq_controller_factory.h" + #include "modules/audio_coding/neteq/decision_logic.h" namespace webrtc { diff --git a/api/neteq/neteq_controller.h b/api/neteq/neteq_controller.h index a64a233745..6f42e83b68 100644 --- a/api/neteq/neteq_controller.h +++ b/api/neteq/neteq_controller.h @@ -13,7 +13,6 @@ #include #include - #include #include diff --git a/api/stats/rtc_stats.h b/api/stats/rtc_stats.h index e38373a921..5cb97ccbee 100644 --- a/api/stats/rtc_stats.h +++ b/api/stats/rtc_stats.h @@ -163,7 +163,9 @@ class RTC_EXPORT RTCStats { return std::make_unique(*this); \ } \ \ - const char* this_class::type() const { return this_class::kType; } \ + const char* this_class::type() const { \ + return this_class::kType; \ + } \ \ std::vector \ this_class::MembersOfThisObjectAndAncestors( \ @@ -194,7 +196,9 @@ class RTC_EXPORT RTCStats { return std::make_unique(*this); \ } \ \ - const char* this_class::type() const { return this_class::kType; } \ + const char* this_class::type() const { \ + return this_class::kType; \ + } \ \ std::vector \ this_class::MembersOfThisObjectAndAncestors( \ diff --git a/api/units/timestamp_unittest.cc b/api/units/timestamp_unittest.cc index 43b2985d43..f49b8ddde6 100644 --- a/api/units/timestamp_unittest.cc +++ b/api/units/timestamp_unittest.cc @@ -8,9 +8,10 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "api/units/timestamp.h" + #include -#include "api/units/timestamp.h" #include "test/gtest.h" namespace webrtc { diff --git a/api/video_codecs/video_encoder.cc b/api/video_codecs/video_encoder.cc index e4b44aedb3..b0fe078b37 100644 --- a/api/video_codecs/video_encoder.cc +++ b/api/video_codecs/video_encoder.cc @@ -11,6 +11,7 @@ #include "api/video_codecs/video_encoder.h" #include + #include #include "rtc_base/checks.h" diff --git a/api/voip/test/voip_engine_factory_unittest.cc b/api/voip/test/voip_engine_factory_unittest.cc index f967a0ba8f..7d717c1662 100644 --- a/api/voip/test/voip_engine_factory_unittest.cc +++ b/api/voip/test/voip_engine_factory_unittest.cc @@ -8,10 +8,11 @@ * be found in the AUTHORS file in the root of the source tree. */ +#include "api/voip/voip_engine_factory.h" + #include #include "api/task_queue/default_task_queue_factory.h" -#include "api/voip/voip_engine_factory.h" #include "modules/audio_device/include/mock_audio_device.h" #include "modules/audio_processing/include/mock_audio_processing.h" #include "test/gtest.h" diff --git a/call/adaptation/test/mock_resource_listener.h b/call/adaptation/test/mock_resource_listener.h index f0f998f2e3..1c4df31a13 100644 --- a/call/adaptation/test/mock_resource_listener.h +++ b/call/adaptation/test/mock_resource_listener.h @@ -12,7 +12,6 @@ #define CALL_ADAPTATION_TEST_MOCK_RESOURCE_LISTENER_H_ #include "api/adaptation/resource.h" - #include "test/gmock.h" namespace webrtc { diff --git a/call/flexfec_receive_stream_unittest.cc b/call/flexfec_receive_stream_unittest.cc index cd961382e9..c575a3f41d 100644 --- a/call/flexfec_receive_stream_unittest.cc +++ b/call/flexfec_receive_stream_unittest.cc @@ -93,9 +93,7 @@ class FlexfecReceiveStreamTest : public ::testing::Test { receive_stream_->RegisterWithTransport(&rtp_stream_receiver_controller_); } - ~FlexfecReceiveStreamTest() { - receive_stream_->UnregisterFromTransport(); - } + ~FlexfecReceiveStreamTest() { receive_stream_->UnregisterFromTransport(); } rtc::AutoThread main_thread_; MockTransport rtcp_send_transport_; diff --git a/call/rtp_demuxer_unittest.cc b/call/rtp_demuxer_unittest.cc index 2b394d3bff..e85052810a 100644 --- a/call/rtp_demuxer_unittest.cc +++ b/call/rtp_demuxer_unittest.cc @@ -711,7 +711,6 @@ TEST_F(RtpDemuxerTest, AssociatingByRsidAndBySsrcCannotTriggerDoubleCall) { EXPECT_TRUE(demuxer_.OnRtpPacket(*packet)); } - // If one sink is associated with SSRC x, and another sink with RSID y, then if // we receive a packet with both SSRC x and RSID y, route that to only the sink // for RSID y since we believe RSID tags to be more trustworthy than signaled diff --git a/call/rtp_video_sender.cc b/call/rtp_video_sender.cc index b793b24f10..9108e83a13 100644 --- a/call/rtp_video_sender.cc +++ b/call/rtp_video_sender.cc @@ -923,14 +923,14 @@ int RtpVideoSender::ProtectionRequest(const FecProtectionParams* delta_params, *sent_nack_rate_bps = 0; *sent_fec_rate_bps = 0; for (const RtpStreamSender& stream : rtp_streams_) { - stream.rtp_rtcp->SetFecProtectionParams(*delta_params, *key_params); + stream.rtp_rtcp->SetFecProtectionParams(*delta_params, *key_params); - auto send_bitrate = stream.rtp_rtcp->GetSendRates(); - *sent_video_rate_bps += send_bitrate[RtpPacketMediaType::kVideo].bps(); - *sent_fec_rate_bps += - send_bitrate[RtpPacketMediaType::kForwardErrorCorrection].bps(); - *sent_nack_rate_bps += - send_bitrate[RtpPacketMediaType::kRetransmission].bps(); + auto send_bitrate = stream.rtp_rtcp->GetSendRates(); + *sent_video_rate_bps += send_bitrate[RtpPacketMediaType::kVideo].bps(); + *sent_fec_rate_bps += + send_bitrate[RtpPacketMediaType::kForwardErrorCorrection].bps(); + *sent_nack_rate_bps += + send_bitrate[RtpPacketMediaType::kRetransmission].bps(); } return 0; } diff --git a/common_audio/resampler/sinc_resampler.h b/common_audio/resampler/sinc_resampler.h index b89bba7ab4..c6a43abd01 100644 --- a/common_audio/resampler/sinc_resampler.h +++ b/common_audio/resampler/sinc_resampler.h @@ -157,10 +157,10 @@ class SincResampler { // Data from the source is copied into this buffer for each processing pass. std::unique_ptr input_buffer_; -// Stores the runtime selection of which Convolve function to use. -// TODO(ajm): Move to using a global static which must only be initialized -// once by the user. We're not doing this initially, because we don't have -// e.g. a LazyInstance helper in webrtc. + // Stores the runtime selection of which Convolve function to use. + // TODO(ajm): Move to using a global static which must only be initialized + // once by the user. We're not doing this initially, because we don't have + // e.g. a LazyInstance helper in webrtc. typedef float (*ConvolveProc)(const float*, const float*, const float*, diff --git a/common_audio/third_party/ooura/fft_size_256/fft4g.cc b/common_audio/third_party/ooura/fft_size_256/fft4g.cc index d2f7c1c41e..2573f23dab 100644 --- a/common_audio/third_party/ooura/fft_size_256/fft4g.cc +++ b/common_audio/third_party/ooura/fft_size_256/fft4g.cc @@ -286,11 +286,11 @@ Appendix : w[] and ip[] are compatible with all routines. */ +#include "common_audio/third_party/ooura/fft_size_256/fft4g.h" + #include #include -#include "common_audio/third_party/ooura/fft_size_256/fft4g.h" - namespace webrtc { namespace { diff --git a/common_audio/third_party/ooura/fft_size_256/fft4g.h b/common_audio/third_party/ooura/fft_size_256/fft4g.h index d41d2c65aa..5a465a3545 100644 --- a/common_audio/third_party/ooura/fft_size_256/fft4g.h +++ b/common_audio/third_party/ooura/fft_size_256/fft4g.h @@ -11,6 +11,8 @@ #ifndef COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_ #define COMMON_AUDIO_THIRD_PARTY_OOURA_FFT_SIZE_256_FFT4G_H_ +#include + namespace webrtc { // Refer to fft4g.c for documentation. diff --git a/common_audio/wav_header.h b/common_audio/wav_header.h index 2cccd7d34b..a1aa942a3d 100644 --- a/common_audio/wav_header.h +++ b/common_audio/wav_header.h @@ -13,6 +13,7 @@ #include #include + #include #include "rtc_base/checks.h" diff --git a/examples/androidnativeapi/jni/android_call_client.cc b/examples/androidnativeapi/jni/android_call_client.cc index ae0a40b9ba..2713a563cd 100644 --- a/examples/androidnativeapi/jni/android_call_client.cc +++ b/examples/androidnativeapi/jni/android_call_client.cc @@ -10,9 +10,8 @@ #include "examples/androidnativeapi/jni/android_call_client.h" -#include - #include +#include #include "api/peer_connection_interface.h" #include "api/rtc_event_log/rtc_event_log_factory.h" diff --git a/examples/androidvoip/jni/android_voip_client.cc b/examples/androidvoip/jni/android_voip_client.cc index cf07e87e50..92fad221d8 100644 --- a/examples/androidvoip/jni/android_voip_client.cc +++ b/examples/androidvoip/jni/android_voip_client.cc @@ -12,6 +12,7 @@ #include #include + #include #include #include diff --git a/media/base/stream_params.h b/media/base/stream_params.h index c9c8a09592..60c67a1a1c 100644 --- a/media/base/stream_params.h +++ b/media/base/stream_params.h @@ -303,8 +303,7 @@ inline bool RemoveStreamBySsrc(StreamParamsVec* streams, uint32_t ssrc) { return RemoveStream( streams, [&ssrc](const StreamParams& sp) { return sp.has_ssrc(ssrc); }); } -inline bool RemoveStreamByIds(StreamParamsVec* streams, - const std::string& id) { +inline bool RemoveStreamByIds(StreamParamsVec* streams, const std::string& id) { return RemoveStream(streams, [&id](const StreamParams& sp) { return sp.id == id; }); } diff --git a/media/base/video_adapter.cc b/media/base/video_adapter.cc index 01aaad13d3..daac8cf856 100644 --- a/media/base/video_adapter.cc +++ b/media/base/video_adapter.cc @@ -40,8 +40,8 @@ struct Fraction { // Determines number of output pixels if both width and height of an input of // `input_pixels` pixels is scaled with the fraction numerator / denominator. int scale_pixel_count(int input_pixels) { - return (numerator * numerator * static_cast(input_pixels)) - / (denominator * denominator); + return (numerator * numerator * static_cast(input_pixels)) / + (denominator * denominator); } }; diff --git a/media/engine/fake_webrtc_video_engine.cc b/media/engine/fake_webrtc_video_engine.cc index 3cd2855a6c..d10e6180c6 100644 --- a/media/engine/fake_webrtc_video_engine.cc +++ b/media/engine/fake_webrtc_video_engine.cc @@ -202,8 +202,7 @@ int FakeWebRtcVideoEncoder::GetNumEncodedFrames() { // Video encoder factory. FakeWebRtcVideoEncoderFactory::FakeWebRtcVideoEncoderFactory() - : num_created_encoders_(0), - vp8_factory_mode_(false) {} + : num_created_encoders_(0), vp8_factory_mode_(false) {} std::vector FakeWebRtcVideoEncoderFactory::GetSupportedFormats() const { diff --git a/net/dcsctp/packet/chunk/data_chunk.cc b/net/dcsctp/packet/chunk/data_chunk.cc index 769be2db91..cf866b7b2f 100644 --- a/net/dcsctp/packet/chunk/data_chunk.cc +++ b/net/dcsctp/packet/chunk/data_chunk.cc @@ -89,10 +89,10 @@ std::string DataChunk::ToString() const { rtc::StringBuilder sb; sb << "DATA, type=" << (options().is_unordered ? "unordered" : "ordered") << "::" - << (*options().is_beginning && *options().is_end - ? "complete" - : *options().is_beginning ? "first" - : *options().is_end ? "last" : "middle") + << (*options().is_beginning && *options().is_end ? "complete" + : *options().is_beginning ? "first" + : *options().is_end ? "last" + : "middle") << ", tsn=" << *tsn() << ", sid=" << *stream_id() << ", ssn=" << *ssn() << ", ppid=" << *ppid() << ", length=" << payload().size(); return sb.Release(); diff --git a/net/dcsctp/packet/chunk/idata_chunk.cc b/net/dcsctp/packet/chunk/idata_chunk.cc index 378c527909..9f19c7f053 100644 --- a/net/dcsctp/packet/chunk/idata_chunk.cc +++ b/net/dcsctp/packet/chunk/idata_chunk.cc @@ -92,10 +92,10 @@ std::string IDataChunk::ToString() const { rtc::StringBuilder sb; sb << "I-DATA, type=" << (options().is_unordered ? "unordered" : "ordered") << "::" - << (*options().is_beginning && *options().is_end - ? "complete" - : *options().is_beginning ? "first" - : *options().is_end ? "last" : "middle") + << (*options().is_beginning && *options().is_end ? "complete" + : *options().is_beginning ? "first" + : *options().is_end ? "last" + : "middle") << ", tsn=" << *tsn() << ", stream_id=" << *stream_id() << ", message_id=" << *message_id(); diff --git a/p2p/base/basic_async_resolver_factory.cc b/p2p/base/basic_async_resolver_factory.cc index 3fdf75b12f..2769f828d7 100644 --- a/p2p/base/basic_async_resolver_factory.cc +++ b/p2p/base/basic_async_resolver_factory.cc @@ -25,7 +25,6 @@ rtc::AsyncResolverInterface* BasicAsyncResolverFactory::Create() { return new rtc::AsyncResolver(); } - std::unique_ptr WrappingAsyncDnsResolverFactory::Create() { return std::make_unique(wrapped_factory_->Create()); diff --git a/p2p/base/connection_info.h b/p2p/base/connection_info.h index cd2a913451..e7ed1b4921 100644 --- a/p2p/base/connection_info.h +++ b/p2p/base/connection_info.h @@ -36,16 +36,16 @@ struct ConnectionInfo { ConnectionInfo(const ConnectionInfo&); ~ConnectionInfo(); - bool best_connection; // Is this the best connection we have? - bool writable; // Has this connection received a STUN response? - bool receiving; // Has this connection received anything? - bool timeout; // Has this connection timed out? - size_t rtt; // The STUN RTT for this connection. + bool best_connection; // Is this the best connection we have? + bool writable; // Has this connection received a STUN response? + bool receiving; // Has this connection received anything? + bool timeout; // Has this connection timed out? + size_t rtt; // The STUN RTT for this connection. size_t sent_discarded_bytes; // Number of outgoing bytes discarded due to // socket errors. size_t sent_total_bytes; // Total bytes sent on this connection. Does not // include discarded bytes. - size_t sent_bytes_second; // Bps over the last measurement interval. + size_t sent_bytes_second; // Bps over the last measurement interval. size_t sent_discarded_packets; // Number of outgoing packets discarded due to // socket errors. size_t sent_total_packets; // Number of total outgoing packets attempted for diff --git a/p2p/base/stun_request.cc b/p2p/base/stun_request.cc index d15a3e65e2..25d387cc3a 100644 --- a/p2p/base/stun_request.cc +++ b/p2p/base/stun_request.cc @@ -35,7 +35,7 @@ const int STUN_INITIAL_RTO = 250; // milliseconds // The timeout doubles each retransmission, up to this many times // RFC 5389 says SHOULD retransmit 7 times. // This has been 8 for years (not sure why). -const int STUN_MAX_RETRANSMISSIONS = 8; // Total sends: 9 +const int STUN_MAX_RETRANSMISSIONS = 8; // Total sends: 9 // We also cap the doubling, even though the standard doesn't say to. // This has been 1.6 seconds for years, but for networks that diff --git a/p2p/base/transport_description_unittest.cc b/p2p/base/transport_description_unittest.cc index 41d7336ff6..c3746ba628 100644 --- a/p2p/base/transport_description_unittest.cc +++ b/p2p/base/transport_description_unittest.cc @@ -9,6 +9,7 @@ */ #include "p2p/base/transport_description.h" + #include "test/gtest.h" using webrtc::RTCErrorType; diff --git a/pc/channel_unittest.cc b/pc/channel_unittest.cc index c6ad9e896a..cd71726339 100644 --- a/pc/channel_unittest.cc +++ b/pc/channel_unittest.cc @@ -2380,5 +2380,4 @@ TEST_F(VideoChannelDoubleThreadTest, SocketOptionsMergedOnSetTransport) { Base::SocketOptionsMergedOnSetTransport(); } - // TODO(pthatcher): TestSetReceiver? diff --git a/pc/data_channel_utils.h b/pc/data_channel_utils.h index 85cacdb563..8681ba4657 100644 --- a/pc/data_channel_utils.h +++ b/pc/data_channel_utils.h @@ -13,6 +13,7 @@ #include #include + #include #include #include diff --git a/pc/peer_connection.cc b/pc/peer_connection.cc index 4839fcf0a1..0956d75f4a 100644 --- a/pc/peer_connection.cc +++ b/pc/peer_connection.cc @@ -634,20 +634,18 @@ RTCError PeerConnection::Initialize( } // Network thread initialization. - transport_controller_copy_ = - network_thread()->BlockingCall([&] { - RTC_DCHECK_RUN_ON(network_thread()); - network_thread_safety_ = PendingTaskSafetyFlag::Create(); - InitializePortAllocatorResult pa_result = InitializePortAllocator_n( - stun_servers, turn_servers, configuration); - // Send information about IPv4/IPv6 status. - PeerConnectionAddressFamilyCounter address_family = - pa_result.enable_ipv6 ? kPeerConnection_IPv6 : kPeerConnection_IPv4; - RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IPMetrics", - address_family, - kPeerConnectionAddressFamilyCounter_Max); - return InitializeTransportController_n(configuration, dependencies); - }); + transport_controller_copy_ = network_thread()->BlockingCall([&] { + RTC_DCHECK_RUN_ON(network_thread()); + network_thread_safety_ = PendingTaskSafetyFlag::Create(); + InitializePortAllocatorResult pa_result = + InitializePortAllocator_n(stun_servers, turn_servers, configuration); + // Send information about IPv4/IPv6 status. + PeerConnectionAddressFamilyCounter address_family = + pa_result.enable_ipv6 ? kPeerConnection_IPv6 : kPeerConnection_IPv4; + RTC_HISTOGRAM_ENUMERATION("WebRTC.PeerConnection.IPMetrics", address_family, + kPeerConnectionAddressFamilyCounter_Max); + return InitializeTransportController_n(configuration, dependencies); + }); configuration_ = configuration; diff --git a/pc/peer_connection.h b/pc/peer_connection.h index 32d304e6e7..26d2531bef 100644 --- a/pc/peer_connection.h +++ b/pc/peer_connection.h @@ -265,9 +265,7 @@ class PeerConnection : public PeerConnectionInternal, } rtc::Thread* worker_thread() const final { return context_->worker_thread(); } - std::string session_id() const override { - return session_id_; - } + std::string session_id() const override { return session_id_; } bool initial_offerer() const override { RTC_DCHECK_RUN_ON(signaling_thread()); diff --git a/pc/proxy.h b/pc/proxy.h index b0782bb1ea..f39b4a59e2 100644 --- a/pc/proxy.h +++ b/pc/proxy.h @@ -200,8 +200,12 @@ class ConstMethodCall { typedef class_name##Interface C; \ \ public: \ - const INTERNAL_CLASS* internal() const { return c(); } \ - INTERNAL_CLASS* internal() { return c(); } + const INTERNAL_CLASS* internal() const { \ + return c(); \ + } \ + INTERNAL_CLASS* internal() { \ + return c(); \ + } // clang-format off // clang-format would put the semicolon alone, @@ -245,9 +249,15 @@ class ConstMethodCall { } \ \ private: \ - const INTERNAL_CLASS* c() const { return c_.get(); } \ - INTERNAL_CLASS* c() { return c_.get(); } \ - void DestroyInternal() { c_ = nullptr; } \ + const INTERNAL_CLASS* c() const { \ + return c_.get(); \ + } \ + INTERNAL_CLASS* c() { \ + return c_.get(); \ + } \ + void DestroyInternal() { \ + c_ = nullptr; \ + } \ rtc::scoped_refptr c_; // Note: This doesn't use a unique_ptr, because it intends to handle a corner @@ -264,9 +274,15 @@ class ConstMethodCall { } \ \ private: \ - const INTERNAL_CLASS* c() const { return c_; } \ - INTERNAL_CLASS* c() { return c_; } \ - void DestroyInternal() { delete c_; } \ + const INTERNAL_CLASS* c() const { \ + return c_; \ + } \ + INTERNAL_CLASS* c() { \ + return c_; \ + } \ + void DestroyInternal() { \ + delete c_; \ + } \ INTERNAL_CLASS* c_; #define BEGIN_PRIMARY_PROXY_MAP(class_name) \ @@ -292,16 +308,20 @@ class ConstMethodCall { primary_thread, secondary_thread, std::move(c)); \ } -#define PROXY_PRIMARY_THREAD_DESTRUCTOR() \ - private: \ - rtc::Thread* destructor_thread() const { return primary_thread_; } \ - \ +#define PROXY_PRIMARY_THREAD_DESTRUCTOR() \ + private: \ + rtc::Thread* destructor_thread() const { \ + return primary_thread_; \ + } \ + \ public: // NOLINTNEXTLINE -#define PROXY_SECONDARY_THREAD_DESTRUCTOR() \ - private: \ - rtc::Thread* destructor_thread() const { return secondary_thread_; } \ - \ +#define PROXY_SECONDARY_THREAD_DESTRUCTOR() \ + private: \ + rtc::Thread* destructor_thread() const { \ + return secondary_thread_; \ + } \ + \ public: // NOLINTNEXTLINE #if defined(RTC_DISABLE_PROXY_TRACE_EVENTS) diff --git a/pc/rtc_stats_collector.cc b/pc/rtc_stats_collector.cc index 4535597123..8a1ded79f8 100644 --- a/pc/rtc_stats_collector.cc +++ b/pc/rtc_stats_collector.cc @@ -873,8 +873,7 @@ ProduceRemoteInboundRtpStreamStatsFromReportBlockData( } remote_inbound->total_round_trip_time = report_block_data.sum_rtts().seconds(); - remote_inbound->round_trip_time_measurements = - report_block_data.num_rtts(); + remote_inbound->round_trip_time_measurements = report_block_data.num_rtts(); std::string local_id = RTCOutboundRtpStreamStatsIDFromSSRC( transport_id, media_type, report_block.source_ssrc); diff --git a/pc/sdp_offer_answer.cc b/pc/sdp_offer_answer.cc index 59f0b01dfd..6c9e647ca9 100644 --- a/pc/sdp_offer_answer.cc +++ b/pc/sdp_offer_answer.cc @@ -4764,13 +4764,11 @@ RTCError SdpOfferAnswerHandler::PushdownMediaDescription( // - crbug.com/1187289 for (const auto& entry : channels) { std::string error; - bool success = - context_->worker_thread()->BlockingCall([&]() { - return (source == cricket::CS_LOCAL) - ? entry.first->SetLocalContent(entry.second, type, error) - : entry.first->SetRemoteContent(entry.second, type, - error); - }); + bool success = context_->worker_thread()->BlockingCall([&]() { + return (source == cricket::CS_LOCAL) + ? entry.first->SetLocalContent(entry.second, type, error) + : entry.first->SetRemoteContent(entry.second, type, error); + }); if (!success) { return RTCError(RTCErrorType::INVALID_PARAMETER, error); } diff --git a/pc/session_description.cc b/pc/session_description.cc index 0346f8c149..e1152eb107 100644 --- a/pc/session_description.cc +++ b/pc/session_description.cc @@ -281,8 +281,7 @@ std::vector SessionDescription::GetGroupsByName( return content_groups; } -ContentInfo::~ContentInfo() { -} +ContentInfo::~ContentInfo() {} // Copy operator. ContentInfo::ContentInfo(const ContentInfo& o)