Reformat the WebRTC code base

Running clang-format with chromium's style guide.

The goal is n-fold:
 * providing consistency and readability (that's what code guidelines are for)
 * preventing noise with presubmit checks and git cl format
 * building on the previous point: making it easier to automatically fix format issues
 * you name it

Please consider using git-hyper-blame to ignore this commit.

Bug: webrtc:9340
Change-Id: I694567c4cdf8cee2860958cfe82bfaf25848bb87
Reviewed-on: https://webrtc-review.googlesource.com/81185
Reviewed-by: Patrik Höglund <phoglund@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23660}
This commit is contained in:
Yves Gerey
2018-06-19 15:03:05 +02:00
parent b602123a5a
commit 665174fdbb
1569 changed files with 30495 additions and 30309 deletions

View File

@ -20,17 +20,14 @@ namespace webrtc {
class MockBufferLevelFilter : public BufferLevelFilter {
public:
virtual ~MockBufferLevelFilter() { Die(); }
MOCK_METHOD0(Die,
void());
MOCK_METHOD0(Reset,
void());
MOCK_METHOD0(Die, void());
MOCK_METHOD0(Reset, void());
MOCK_METHOD3(Update,
void(size_t buffer_size_packets, int time_stretched_samples,
size_t packet_len_samples));
MOCK_METHOD1(SetTargetBufferLevel,
void(int target_buffer_level));
MOCK_CONST_METHOD0(filtered_current_level,
int());
void(size_t buffer_size_packets,
int time_stretched_samples,
size_t packet_len_samples));
MOCK_METHOD1(SetTargetBufferLevel, void(int target_buffer_level));
MOCK_CONST_METHOD0(filtered_current_level, int());
};
} // namespace webrtc

View File

@ -26,15 +26,13 @@ class MockDecoderDatabase : public DecoderDatabase {
: DecoderDatabase(factory, absl::nullopt) {}
virtual ~MockDecoderDatabase() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_CONST_METHOD0(Empty,
bool());
MOCK_CONST_METHOD0(Size,
int());
MOCK_METHOD0(Reset,
void());
MOCK_CONST_METHOD0(Empty, bool());
MOCK_CONST_METHOD0(Size, int());
MOCK_METHOD0(Reset, void());
MOCK_METHOD3(RegisterPayload,
int(uint8_t rtp_payload_type, NetEqDecoder codec_type,
const std::string& name));
int(uint8_t rtp_payload_type,
NetEqDecoder codec_type,
const std::string& name));
MOCK_METHOD2(RegisterPayload,
int(int rtp_payload_type, const SdpAudioFormat& audio_format));
MOCK_METHOD4(InsertExternal,
@ -42,19 +40,15 @@ class MockDecoderDatabase : public DecoderDatabase {
NetEqDecoder codec_type,
const std::string& codec_name,
AudioDecoder* decoder));
MOCK_METHOD1(Remove,
int(uint8_t rtp_payload_type));
MOCK_METHOD1(Remove, int(uint8_t rtp_payload_type));
MOCK_METHOD0(RemoveAll, void());
MOCK_CONST_METHOD1(GetDecoderInfo,
const DecoderInfo*(uint8_t rtp_payload_type));
const DecoderInfo*(uint8_t rtp_payload_type));
MOCK_METHOD2(SetActiveDecoder,
int(uint8_t rtp_payload_type, bool* new_decoder));
MOCK_CONST_METHOD0(GetActiveDecoder,
AudioDecoder*());
MOCK_METHOD1(SetActiveCngDecoder,
int(uint8_t rtp_payload_type));
MOCK_CONST_METHOD0(GetActiveCngDecoder,
ComfortNoiseDecoder*());
int(uint8_t rtp_payload_type, bool* new_decoder));
MOCK_CONST_METHOD0(GetActiveDecoder, AudioDecoder*());
MOCK_METHOD1(SetActiveCngDecoder, int(uint8_t rtp_payload_type));
MOCK_CONST_METHOD0(GetActiveCngDecoder, ComfortNoiseDecoder*());
};
} // namespace webrtc

View File

@ -25,37 +25,25 @@ class MockDelayManager : public DelayManager {
: DelayManager(max_packets_in_buffer, peak_detector, tick_timer) {}
virtual ~MockDelayManager() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_CONST_METHOD0(iat_vector,
const IATVector&());
MOCK_CONST_METHOD0(iat_vector, const IATVector&());
MOCK_METHOD3(Update,
int(uint16_t sequence_number, uint32_t timestamp, int sample_rate_hz));
MOCK_METHOD1(CalculateTargetLevel,
int(int iat_packets));
MOCK_METHOD1(SetPacketAudioLength,
int(int length_ms));
MOCK_METHOD0(Reset,
void());
MOCK_CONST_METHOD0(PeakFound,
bool());
MOCK_METHOD1(UpdateCounters,
void(int elapsed_time_ms));
MOCK_METHOD0(ResetPacketIatCount,
void());
MOCK_CONST_METHOD2(BufferLimits,
void(int* lower_limit, int* higher_limit));
MOCK_CONST_METHOD0(TargetLevel,
int());
int(uint16_t sequence_number,
uint32_t timestamp,
int sample_rate_hz));
MOCK_METHOD1(CalculateTargetLevel, int(int iat_packets));
MOCK_METHOD1(SetPacketAudioLength, int(int length_ms));
MOCK_METHOD0(Reset, void());
MOCK_CONST_METHOD0(PeakFound, bool());
MOCK_METHOD1(UpdateCounters, void(int elapsed_time_ms));
MOCK_METHOD0(ResetPacketIatCount, void());
MOCK_CONST_METHOD2(BufferLimits, void(int* lower_limit, int* higher_limit));
MOCK_CONST_METHOD0(TargetLevel, int());
MOCK_METHOD0(RegisterEmptyPacket, void());
MOCK_METHOD1(set_extra_delay_ms,
void(int16_t delay));
MOCK_CONST_METHOD0(base_target_level,
int());
MOCK_METHOD1(set_streaming_mode,
void(bool value));
MOCK_CONST_METHOD0(last_pack_cng_or_dtmf,
int());
MOCK_METHOD1(set_last_pack_cng_or_dtmf,
void(int value));
MOCK_METHOD1(set_extra_delay_ms, void(int16_t delay));
MOCK_CONST_METHOD0(base_target_level, int());
MOCK_METHOD1(set_streaming_mode, void(bool value));
MOCK_CONST_METHOD0(last_pack_cng_or_dtmf, int());
MOCK_METHOD1(set_last_pack_cng_or_dtmf, void(int value));
};
} // namespace webrtc

View File

@ -22,16 +22,11 @@ class MockDtmfBuffer : public DtmfBuffer {
MockDtmfBuffer(int fs) : DtmfBuffer(fs) {}
virtual ~MockDtmfBuffer() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_METHOD0(Flush,
void());
MOCK_METHOD1(InsertEvent,
int(const DtmfEvent& event));
MOCK_METHOD2(GetEvent,
bool(uint32_t current_timestamp, DtmfEvent* event));
MOCK_CONST_METHOD0(Length,
size_t());
MOCK_CONST_METHOD0(Empty,
bool());
MOCK_METHOD0(Flush, void());
MOCK_METHOD1(InsertEvent, int(const DtmfEvent& event));
MOCK_METHOD2(GetEvent, bool(uint32_t current_timestamp, DtmfEvent* event));
MOCK_CONST_METHOD0(Length, size_t());
MOCK_CONST_METHOD0(Empty, bool());
};
} // namespace webrtc

View File

@ -21,14 +21,10 @@ class MockDtmfToneGenerator : public DtmfToneGenerator {
public:
virtual ~MockDtmfToneGenerator() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_METHOD3(Init,
int(int fs, int event, int attenuation));
MOCK_METHOD0(Reset,
void());
MOCK_METHOD2(Generate,
int(size_t num_samples, AudioMultiVector* output));
MOCK_CONST_METHOD0(initialized,
bool());
MOCK_METHOD3(Init, int(int fs, int event, int attenuation));
MOCK_METHOD0(Reset, void());
MOCK_METHOD2(Generate, int(size_t num_samples, AudioMultiVector* output));
MOCK_CONST_METHOD0(initialized, bool());
};
} // namespace webrtc

View File

@ -33,16 +33,11 @@ class MockExpand : public Expand {
num_channels) {}
virtual ~MockExpand() { Die(); }
MOCK_METHOD0(Die, void());
MOCK_METHOD0(Reset,
void());
MOCK_METHOD1(Process,
int(AudioMultiVector* output));
MOCK_METHOD0(SetParametersForNormalAfterExpand,
void());
MOCK_METHOD0(SetParametersForMergeAfterExpand,
void());
MOCK_CONST_METHOD0(overlap_length,
size_t());
MOCK_METHOD0(Reset, void());
MOCK_METHOD1(Process, int(AudioMultiVector* output));
MOCK_METHOD0(SetParametersForNormalAfterExpand, void());
MOCK_METHOD0(SetParametersForMergeAfterExpand, void());
MOCK_CONST_METHOD0(overlap_length, size_t());
};
} // namespace webrtc

View File

@ -75,17 +75,16 @@ class MockExternalPcm16B : public AudioDecoder {
int sample_rate_hz,
int16_t* decoded,
SpeechType* speech_type));
MOCK_CONST_METHOD0(HasDecodePlc,
bool());
MOCK_METHOD2(DecodePlc,
size_t(size_t num_frames, int16_t* decoded));
MOCK_CONST_METHOD0(HasDecodePlc, bool());
MOCK_METHOD2(DecodePlc, size_t(size_t num_frames, int16_t* decoded));
MOCK_METHOD0(Reset, void());
MOCK_METHOD5(IncomingPacket,
int(const uint8_t* payload, size_t payload_len,
uint16_t rtp_sequence_number, uint32_t rtp_timestamp,
uint32_t arrival_timestamp));
MOCK_METHOD0(ErrorCode,
int());
int(const uint8_t* payload,
size_t payload_len,
uint16_t rtp_sequence_number,
uint32_t rtp_timestamp,
uint32_t arrival_timestamp));
MOCK_METHOD0(ErrorCode, int());
int SampleRateHz() const /* override */ { return real_.SampleRateHz(); }
size_t Channels() const /* override */ { return real_.Channels(); }