Skip to content

Commit

Permalink
Delete macros RTC_DISALLOW_ASSIGN and RTC_DISALLOW_IMPLICIT_CONSTRUCTORS
Browse files Browse the repository at this point in the history
The former was unused, the latter is replaced with the explicit C++11
deletions. The related RTC_DISALLOW_COPY_AND_ASSIGN is left for now,
it is used in a lot more places.

Bug: None
Change-Id: I49503e7f2b9ff43c6285f8695833479bbc18c380
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/185500
Reviewed-by: Karl Wiberg <[email protected]>
Commit-Queue: Niels Moller <[email protected]>
Cr-Commit-Position: refs/heads/master@{#32224}
  • Loading branch information
Niels Möller authored and Commit Bot committed Sep 29, 2020
1 parent 46be80d commit de95329
Show file tree
Hide file tree
Showing 55 changed files with 256 additions and 172 deletions.
1 change: 0 additions & 1 deletion api/transport/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ if (rtc_include_tests) {
deps = [
":stun_types",
"../../rtc_base",
"../../rtc_base:macromagic",
"../../rtc_base:rtc_base_approved",
"../../test:test_support",
"//testing/gtest",
Expand Down
8 changes: 5 additions & 3 deletions audio/audio_receive_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "call/audio_receive_stream.h"
#include "call/syncable.h"
#include "modules/rtp_rtcp/source/source_tracker.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/thread_checker.h"
#include "system_wrappers/include/clock.h"

Expand Down Expand Up @@ -61,6 +60,11 @@ class AudioReceiveStream final : public webrtc::AudioReceiveStream,
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
webrtc::RtcEventLog* event_log,
std::unique_ptr<voe::ChannelReceiveInterface> channel_receive);

AudioReceiveStream() = delete;
AudioReceiveStream(const AudioReceiveStream&) = delete;
AudioReceiveStream& operator=(const AudioReceiveStream&) = delete;

~AudioReceiveStream() override;

// webrtc::AudioReceiveStream implementation.
Expand Down Expand Up @@ -113,8 +117,6 @@ class AudioReceiveStream final : public webrtc::AudioReceiveStream,
bool playing_ RTC_GUARDED_BY(worker_thread_checker_) = false;

std::unique_ptr<RtpStreamReceiverInterface> rtp_stream_receiver_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioReceiveStream);
};
} // namespace internal
} // namespace webrtc
Expand Down
8 changes: 5 additions & 3 deletions audio/audio_send_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include "call/audio_state.h"
#include "call/bitrate_allocator.h"
#include "modules/rtp_rtcp/source/rtp_rtcp_interface.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/experiments/struct_parameters_parser.h"
#include "rtc_base/race_checker.h"
#include "rtc_base/synchronization/mutex.h"
Expand Down Expand Up @@ -75,6 +74,11 @@ class AudioSendStream final : public webrtc::AudioSendStream,
RtcEventLog* event_log,
const absl::optional<RtpState>& suspended_rtp_state,
std::unique_ptr<voe::ChannelSendInterface> channel_send);

AudioSendStream() = delete;
AudioSendStream(const AudioSendStream&) = delete;
AudioSendStream& operator=(const AudioSendStream&) = delete;

~AudioSendStream() override;

// webrtc::AudioSendStream implementation.
Expand Down Expand Up @@ -206,8 +210,6 @@ class AudioSendStream final : public webrtc::AudioSendStream,
size_t total_packet_overhead_bytes_ RTC_GUARDED_BY(worker_queue_) = 0;
absl::optional<std::pair<TimeDelta, TimeDelta>> frame_length_range_
RTC_GUARDED_BY(worker_queue_);

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioSendStream);
};
} // namespace internal
} // namespace webrtc
Expand Down
8 changes: 5 additions & 3 deletions audio/audio_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "audio/audio_transport_impl.h"
#include "audio/null_audio_poller.h"
#include "call/audio_state.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/ref_count.h"
#include "rtc_base/thread_checker.h"

Expand All @@ -32,6 +31,11 @@ namespace internal {
class AudioState : public webrtc::AudioState {
public:
explicit AudioState(const AudioState::Config& config);

AudioState() = delete;
AudioState(const AudioState&) = delete;
AudioState& operator=(const AudioState&) = delete;

~AudioState() override;

AudioProcessing* audio_processing() override;
Expand Down Expand Up @@ -82,8 +86,6 @@ class AudioState : public webrtc::AudioState {
size_t num_channels = 0;
};
std::map<webrtc::AudioSendStream*, StreamProperties> sending_streams_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioState);
};
} // namespace internal
} // namespace webrtc
Expand Down
8 changes: 5 additions & 3 deletions audio/audio_transport_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include "modules/audio_device/include/audio_device.h"
#include "modules/audio_processing/include/audio_processing.h"
#include "modules/audio_processing/typing_detection.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/synchronization/mutex.h"
#include "rtc_base/thread_annotations.h"

Expand All @@ -30,6 +29,11 @@ class AudioSender;
class AudioTransportImpl : public AudioTransport {
public:
AudioTransportImpl(AudioMixer* mixer, AudioProcessing* audio_processing);

AudioTransportImpl() = delete;
AudioTransportImpl(const AudioTransportImpl&) = delete;
AudioTransportImpl& operator=(const AudioTransportImpl&) = delete;

~AudioTransportImpl() override;

int32_t RecordedDataIsAvailable(const void* audioSamples,
Expand Down Expand Up @@ -85,8 +89,6 @@ class AudioTransportImpl : public AudioTransport {
AudioFrame mixed_frame_;
// Converts mixed audio to the audio device output rate.
PushResampler<int16_t> render_resampler_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(AudioTransportImpl);
};
} // namespace webrtc

Expand Down
8 changes: 5 additions & 3 deletions common_audio/smoothing_filter.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
#include <stdint.h>

#include "absl/types/optional.h"
#include "rtc_base/constructor_magic.h"

namespace webrtc {

Expand Down Expand Up @@ -42,6 +41,11 @@ class SmoothingFilterImpl final : public SmoothingFilter {
// will be set to |init_time_ms| first and can be changed through
// |SetTimeConstantMs|.
explicit SmoothingFilterImpl(int init_time_ms);

SmoothingFilterImpl() = delete;
SmoothingFilterImpl(const SmoothingFilterImpl&) = delete;
SmoothingFilterImpl& operator=(const SmoothingFilterImpl&) = delete;

~SmoothingFilterImpl() override;

void AddSample(float sample) override;
Expand All @@ -64,8 +68,6 @@ class SmoothingFilterImpl final : public SmoothingFilter {
float alpha_;
float state_;
int64_t last_state_time_ms_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(SmoothingFilterImpl);
};

} // namespace webrtc
Expand Down
9 changes: 4 additions & 5 deletions common_audio/window_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,17 @@

#include <stddef.h>

#include "rtc_base/constructor_magic.h"

namespace webrtc {

// Helper class with generators for various signal transform windows.
class WindowGenerator {
public:
WindowGenerator() = delete;
WindowGenerator(const WindowGenerator&) = delete;
WindowGenerator& operator=(const WindowGenerator&) = delete;

static void Hanning(int length, float* window);
static void KaiserBesselDerived(float alpha, size_t length, float* window);

private:
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WindowGenerator);
};

} // namespace webrtc
Expand Down
13 changes: 8 additions & 5 deletions media/engine/webrtc_voice_engine.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include "modules/audio_processing/include/audio_processing.h"
#include "rtc_base/arraysize.h"
#include "rtc_base/byte_order.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/experiments/field_trial_parser.h"
#include "rtc_base/experiments/field_trial_units.h"
#include "rtc_base/experiments/struct_parameters_parser.h"
Expand Down Expand Up @@ -802,6 +801,10 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
stream_ = call_->CreateAudioSendStream(config_);
}

WebRtcAudioSendStream() = delete;
WebRtcAudioSendStream(const WebRtcAudioSendStream&) = delete;
WebRtcAudioSendStream& operator=(const WebRtcAudioSendStream&) = delete;

~WebRtcAudioSendStream() override {
RTC_DCHECK(worker_thread_checker_.IsCurrent());
ClearSource();
Expand Down Expand Up @@ -1143,8 +1146,6 @@ class WebRtcVoiceMediaChannel::WebRtcAudioSendStream
// TODO(webrtc:11717): Remove this once audio_network_adaptor in AudioOptions
// has been removed.
absl::optional<std::string> audio_network_adaptor_config_from_options_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioSendStream);
};

class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
Expand Down Expand Up @@ -1193,6 +1194,10 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
RecreateAudioReceiveStream();
}

WebRtcAudioReceiveStream() = delete;
WebRtcAudioReceiveStream(const WebRtcAudioReceiveStream&) = delete;
WebRtcAudioReceiveStream& operator=(const WebRtcAudioReceiveStream&) = delete;

~WebRtcAudioReceiveStream() {
RTC_DCHECK(worker_thread_checker_.IsCurrent());
call_->DestroyAudioReceiveStream(stream_);
Expand Down Expand Up @@ -1356,8 +1361,6 @@ class WebRtcVoiceMediaChannel::WebRtcAudioReceiveStream {
bool playout_ = false;
float output_volume_ = 1.0;
std::unique_ptr<webrtc::AudioSinkInterface> raw_audio_sink_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcAudioReceiveStream);
};

WebRtcVoiceMediaChannel::WebRtcVoiceMediaChannel(
Expand Down
15 changes: 10 additions & 5 deletions media/engine/webrtc_voice_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include "media/base/media_engine.h"
#include "media/base/rtp_utils.h"
#include "rtc_base/buffer.h"
#include "rtc_base/constructor_magic.h"
#include "rtc_base/network_route.h"
#include "rtc_base/task_queue.h"
#include "rtc_base/thread_checker.h"
Expand All @@ -52,6 +51,11 @@ class WebRtcVoiceEngine final : public VoiceEngineInterface {
rtc::scoped_refptr<webrtc::AudioMixer> audio_mixer,
rtc::scoped_refptr<webrtc::AudioProcessing> audio_processing,
const webrtc::WebRtcKeyValueConfig& trials);

WebRtcVoiceEngine() = delete;
WebRtcVoiceEngine(const WebRtcVoiceEngine&) = delete;
WebRtcVoiceEngine& operator=(const WebRtcVoiceEngine&) = delete;

~WebRtcVoiceEngine() override;

// Does initialization that needs to occur on the worker thread.
Expand Down Expand Up @@ -133,8 +137,6 @@ class WebRtcVoiceEngine final : public VoiceEngineInterface {
// redundancy for opus audio.
const bool audio_red_for_opus_trial_enabled_;
const bool minimized_remsampling_on_mobile_trial_enabled_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceEngine);
};

// WebRtcVoiceMediaChannel is an implementation of VoiceMediaChannel that uses
Expand All @@ -147,6 +149,11 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
const AudioOptions& options,
const webrtc::CryptoOptions& crypto_options,
webrtc::Call* call);

WebRtcVoiceMediaChannel() = delete;
WebRtcVoiceMediaChannel(const WebRtcVoiceMediaChannel&) = delete;
WebRtcVoiceMediaChannel& operator=(const WebRtcVoiceMediaChannel&) = delete;

~WebRtcVoiceMediaChannel() override;

const AudioOptions& options() const { return options_; }
Expand Down Expand Up @@ -339,8 +346,6 @@ class WebRtcVoiceMediaChannel final : public VoiceMediaChannel,
unsignaled_frame_decryptor_;

const bool audio_red_for_opus_trial_enabled_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(WebRtcVoiceMediaChannel);
};
} // namespace cricket

Expand Down
1 change: 0 additions & 1 deletion modules/audio_coding/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,6 @@ rtc_library("webrtc_multiopus") {
"../../api/units:time_delta",
"../../rtc_base:checks",
"../../rtc_base:logging",
"../../rtc_base:macromagic",
"../../rtc_base:rtc_base_approved",
"../../rtc_base:safe_minmax",
"../../rtc_base:stringutils",
Expand Down
6 changes: 1 addition & 5 deletions modules/audio_processing/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ rtc_library("config") {
"include/config.cc",
"include/config.h",
]
deps = [
"../../rtc_base:macromagic",
"../../rtc_base/system:rtc_export",
]
deps = [ "../../rtc_base/system:rtc_export" ]
}

rtc_library("api") {
Expand All @@ -47,7 +44,6 @@ rtc_library("api") {
"../../api/audio:audio_frame_api",
"../../api/audio:echo_control",
"../../rtc_base:deprecation",
"../../rtc_base:macromagic",
"../../rtc_base:rtc_base_approved",
"../../rtc_base/system:arch",
"../../rtc_base/system:file_wrapper",
Expand Down
6 changes: 5 additions & 1 deletion modules/audio_processing/aec3/echo_canceller3.cc
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,11 @@ class EchoCanceller3::RenderWriter {
Aec3RenderQueueItemVerifier>* render_transfer_queue,
size_t num_bands,
size_t num_channels);

RenderWriter() = delete;
RenderWriter(const RenderWriter&) = delete;
RenderWriter& operator=(const RenderWriter&) = delete;

~RenderWriter();
void Insert(const AudioBuffer& input);

Expand All @@ -575,7 +580,6 @@ class EchoCanceller3::RenderWriter {
std::vector<std::vector<std::vector<float>>> render_queue_input_frame_;
SwapQueue<std::vector<std::vector<std::vector<float>>>,
Aec3RenderQueueItemVerifier>* render_transfer_queue_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RenderWriter);
};

EchoCanceller3::RenderWriter::RenderWriter(
Expand Down
24 changes: 18 additions & 6 deletions modules/audio_processing/aec3/echo_canceller3_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ bool VerifyOutputFrameBitexactness(rtc::ArrayView<const float> reference,
class CaptureTransportVerificationProcessor : public BlockProcessor {
public:
explicit CaptureTransportVerificationProcessor(size_t num_bands) {}

CaptureTransportVerificationProcessor() = delete;
CaptureTransportVerificationProcessor(
const CaptureTransportVerificationProcessor&) = delete;
CaptureTransportVerificationProcessor& operator=(
const CaptureTransportVerificationProcessor&) = delete;

~CaptureTransportVerificationProcessor() override = default;

void ProcessCapture(
Expand All @@ -124,16 +131,20 @@ class CaptureTransportVerificationProcessor : public BlockProcessor {
void GetMetrics(EchoControl::Metrics* metrics) const override {}

void SetAudioBufferDelay(int delay_ms) override {}

private:
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(CaptureTransportVerificationProcessor);
};

// Class for testing that the render data is properly received by the block
// processor.
class RenderTransportVerificationProcessor : public BlockProcessor {
public:
explicit RenderTransportVerificationProcessor(size_t num_bands) {}

RenderTransportVerificationProcessor() = delete;
RenderTransportVerificationProcessor(
const RenderTransportVerificationProcessor&) = delete;
RenderTransportVerificationProcessor& operator=(
const RenderTransportVerificationProcessor&) = delete;

~RenderTransportVerificationProcessor() override = default;

void ProcessCapture(
Expand Down Expand Up @@ -161,7 +172,6 @@ class RenderTransportVerificationProcessor : public BlockProcessor {
private:
std::deque<std::vector<std::vector<std::vector<float>>>>
received_render_blocks_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RenderTransportVerificationProcessor);
};

class EchoCanceller3Tester {
Expand All @@ -184,6 +194,10 @@ class EchoCanceller3Tester {
fullband_frame_length_ * 100,
1) {}

EchoCanceller3Tester() = delete;
EchoCanceller3Tester(const EchoCanceller3Tester&) = delete;
EchoCanceller3Tester& operator=(const EchoCanceller3Tester&) = delete;

// Verifies that the capture data is properly received by the block processor
// and that the processor data is properly passed to the EchoCanceller3
// output.
Expand Down Expand Up @@ -602,8 +616,6 @@ class EchoCanceller3Tester {
const int fullband_frame_length_;
AudioBuffer capture_buffer_;
AudioBuffer render_buffer_;

RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(EchoCanceller3Tester);
};

std::string ProduceDebugText(int sample_rate_hz) {
Expand Down
Loading

0 comments on commit de95329

Please sign in to comment.