Skip to content

Commit

Permalink
Run clang-tidy modernize-use-equals-{delete,default} on //media
Browse files Browse the repository at this point in the history
See the bugs and cxx post for justification and details:
https://groups.google.com/a/chromium.org/forum/#!topic/cxx/RkOHzIK6Tq8

This change was done using clang-tidy as described here:
https://chromium.googlesource.com/chromium/src/+/lkcr/docs/clang_tidy.md

In some cases the the tool leaves behind a string of commas where it
replaced a member initializer list
(https://bugs.llvm.org/show_bug.cgi?id=35051). They were cleaned up with:
  git diff --name-only | \
    xargs sed -E -i 's/(^\s*|\)\s*):[ ,]*= default/\1 = default/'

BUG=778959,778957

Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel;master.tryserver.chromium.linux:linux_optional_gpu_tests_rel;master.tryserver.chromium.mac:mac_optional_gpu_tests_rel;master.tryserver.chromium.win:win_optional_gpu_tests_rel
Change-Id: I1c7240c773aa3f71d2bb7158e8f76aa7340b0f2d
Reviewed-on: https://chromium-review.googlesource.com/790010
Reviewed-by: Dale Curtis <dalecurtis@chromium.org>
Commit-Queue: Chris Watkins <watk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520828}
  • Loading branch information
Chris Watkins authored and Commit Bot committed Dec 1, 2017
1 parent 68b1503 commit 2de6929
Show file tree
Hide file tree
Showing 452 changed files with 805 additions and 875 deletions.
2 changes: 1 addition & 1 deletion media/audio/alsa/alsa_input.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ AlsaPcmInputStream::AlsaPcmInputStream(AudioManagerBase* audio_manager,
weak_factory_(this) {
}

AlsaPcmInputStream::~AlsaPcmInputStream() {}
AlsaPcmInputStream::~AlsaPcmInputStream() = default;

bool AlsaPcmInputStream::Open() {
if (device_handle_)
Expand Down
6 changes: 2 additions & 4 deletions media/audio/alsa/alsa_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@

namespace media {

AlsaWrapper::AlsaWrapper() {
}
AlsaWrapper::AlsaWrapper() = default;

AlsaWrapper::~AlsaWrapper() {
}
AlsaWrapper::~AlsaWrapper() = default;

int AlsaWrapper::PcmOpen(snd_pcm_t** handle, const char* name,
snd_pcm_stream_t stream, int mode) {
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_debug_file_writer_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class AudioDebugFileWriterTest
}

protected:
virtual ~AudioDebugFileWriterTest() {}
virtual ~AudioDebugFileWriterTest() = default;

static void InitSourceInterleaved(int16_t* source_interleaved,
int source_samples) {
Expand Down
6 changes: 3 additions & 3 deletions media/audio/audio_debug_recording_helper_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class MockAudioDebugFileWriter : public AudioDebugFileWriter {
public:
MockAudioDebugFileWriter(const AudioParameters& params)
: AudioDebugFileWriter(params), reference_data_(nullptr) {}
~MockAudioDebugFileWriter() override {}
~MockAudioDebugFileWriter() override = default;

MOCK_METHOD1(Start, void(const base::FilePath&));
MOCK_METHOD0(Stop, void());
Expand Down Expand Up @@ -93,7 +93,7 @@ class AudioDebugRecordingHelperUnderTest : public AudioDebugRecordingHelper {
: AudioDebugRecordingHelper(params,
std::move(task_runner),
std::move(on_destruction_closure)) {}
~AudioDebugRecordingHelperUnderTest() override {}
~AudioDebugRecordingHelperUnderTest() override = default;

private:
// Creates the mock writer. After the mock writer is returned, we always
Expand All @@ -117,7 +117,7 @@ class AudioDebugRecordingHelperTest : public ::testing::Test {
public:
AudioDebugRecordingHelperTest() : file_path_(kBaseFilePath) {}

~AudioDebugRecordingHelperTest() override {}
~AudioDebugRecordingHelperTest() override = default;

// Helper function that creates a recording helper.
std::unique_ptr<AudioDebugRecordingHelper> CreateRecordingHelper(
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_debug_recording_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ AudioDebugRecordingManager::AudioDebugRecordingManager(
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: task_runner_(std::move(task_runner)), weak_factory_(this) {}

AudioDebugRecordingManager::~AudioDebugRecordingManager() {}
AudioDebugRecordingManager::~AudioDebugRecordingManager() = default;

void AudioDebugRecordingManager::EnableDebugRecording(
const base::FilePath& base_file_name) {
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_debug_recording_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class AudioDebugRecordingManagerUnderTest : public AudioDebugRecordingManager {
AudioDebugRecordingManagerUnderTest(
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: AudioDebugRecordingManager(std::move(task_runner)) {}
~AudioDebugRecordingManagerUnderTest() override {}
~AudioDebugRecordingManagerUnderTest() override = default;

private:
std::unique_ptr<AudioDebugRecordingHelper> CreateAudioDebugRecordingHelper(
Expand All @@ -111,7 +111,7 @@ class AudioDebugRecordingManagerTest : public ::testing::Test {
: manager_(message_loop_.task_runner()),
base_file_path_(base::FilePath::FromUTF8Unsafe("base_path")) {}

~AudioDebugRecordingManagerTest() override {}
~AudioDebugRecordingManagerTest() override = default;

// Registers a source and increases counter for the expected next source id.
std::unique_ptr<AudioDebugRecorder> RegisterDebugRecordingSource(
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_device_name.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace media {

AudioDeviceName::AudioDeviceName() {}
AudioDeviceName::AudioDeviceName() = default;

AudioDeviceName::AudioDeviceName(const std::string& device_name,
const std::string& unique_id)
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_device_thread.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ AudioDeviceThread::Callback::Callback(const AudioParameters& audio_parameters,
thread_checker_.DetachFromThread();
}

AudioDeviceThread::Callback::~Callback() {}
AudioDeviceThread::Callback::~Callback() = default;

void AudioDeviceThread::Callback::InitializeOnAudioThread() {
// Normally this function is called before the thread checker is used
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_input_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class AudioInputController::AudioCallback
explicit AudioCallback(AudioInputController* controller)
: controller_(controller),
weak_controller_(controller->weak_ptr_factory_.GetWeakPtr()) {}
~AudioCallback() override {}
~AudioCallback() override = default;

bool received_callback() const { return received_callback_; }
bool error_during_callback() const { return error_during_callback_; }
Expand Down
6 changes: 3 additions & 3 deletions media/audio/audio_input_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void CloseAudioController(AudioInputController* controller) {
class MockAudioInputControllerEventHandler
: public AudioInputController::EventHandler {
public:
MockAudioInputControllerEventHandler() {}
MockAudioInputControllerEventHandler() = default;

MOCK_METHOD1(OnCreated, void(bool initially_muted));
MOCK_METHOD1(OnError, void(AudioInputController::ErrorCode error_code));
Expand All @@ -74,7 +74,7 @@ class MockAudioInputControllerEventHandler

class MockSyncWriter : public AudioInputController::SyncWriter {
public:
MockSyncWriter() {}
MockSyncWriter() = default;

MOCK_METHOD4(Write,
void(const AudioBus* data,
Expand All @@ -86,7 +86,7 @@ class MockSyncWriter : public AudioInputController::SyncWriter {

class MockUserInputMonitor : public UserInputMonitor {
public:
MockUserInputMonitor() {}
MockUserInputMonitor() = default;

size_t GetKeyPressCount() const { return 0; }

Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_input_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

#include "media/audio/audio_input_delegate.h"

media::AudioInputDelegate::EventHandler::~EventHandler() {}
media::AudioInputDelegate::EventHandler::~EventHandler() = default;

media::AudioInputDelegate::~AudioInputDelegate() {}
media::AudioInputDelegate::~AudioInputDelegate() = default;
3 changes: 1 addition & 2 deletions media/audio/audio_input_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -381,8 +381,7 @@ AudioInputDevice::AudioThreadCallback::AudioThreadCallback(
frames_since_last_got_data_callback_(0),
got_data_callback_(std::move(got_data_callback_)) {}

AudioInputDevice::AudioThreadCallback::~AudioThreadCallback() {
}
AudioInputDevice::AudioThreadCallback::~AudioThreadCallback() = default;

void AudioInputDevice::AudioThreadCallback::MapSharedMemory() {
shared_memory_.Map(memory_length_);
Expand Down
8 changes: 4 additions & 4 deletions media/audio/audio_input_device_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ const size_t kMemorySegmentCount = 10u;

class MockAudioInputIPC : public AudioInputIPC {
public:
MockAudioInputIPC() {}
~MockAudioInputIPC() override {}
MockAudioInputIPC() = default;
~MockAudioInputIPC() override = default;

MOCK_METHOD5(CreateStream,
void(AudioInputIPCDelegate* delegate,
Expand All @@ -45,8 +45,8 @@ class MockAudioInputIPC : public AudioInputIPC {

class MockCaptureCallback : public AudioCapturerSource::CaptureCallback {
public:
MockCaptureCallback() {}
~MockCaptureCallback() override {}
MockCaptureCallback() = default;
~MockCaptureCallback() override = default;

MOCK_METHOD0(OnCaptureStarted, void());
MOCK_METHOD4(Capture,
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_input_ipc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

namespace media {

AudioInputIPCDelegate::~AudioInputIPCDelegate() {}
AudioInputIPCDelegate::~AudioInputIPCDelegate() = default;

AudioInputIPC::~AudioInputIPC() {}
AudioInputIPC::~AudioInputIPC() = default;

} // namespace media
14 changes: 7 additions & 7 deletions media/audio/audio_input_stream_data_interceptor_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ const double kVolume = 0.3456;

class MockStream : public AudioInputStream {
public:
MockStream() {}
~MockStream() {}
MockStream() = default;
~MockStream() = default;
MOCK_METHOD0(Open, bool());
MOCK_METHOD1(Start, void(AudioInputStream::AudioInputCallback*));
MOCK_METHOD0(Stop, void());
Expand All @@ -43,23 +43,23 @@ class MockStream : public AudioInputStream {

class MockDebugRecorder : public AudioDebugRecorder {
public:
MockDebugRecorder() {}
~MockDebugRecorder() {}
MockDebugRecorder() = default;
~MockDebugRecorder() = default;
MOCK_METHOD1(OnData, void(const AudioBus* source));
};

class MockCallback : public AudioInputStream::AudioInputCallback {
public:
MockCallback() {}
~MockCallback() {}
MockCallback() = default;
~MockCallback() = default;

MOCK_METHOD3(OnData, void(const AudioBus*, base::TimeTicks, double));
MOCK_METHOD0(OnError, void());
};

class MockDebugRecorderFactory {
public:
MockDebugRecorderFactory() {}
MockDebugRecorderFactory() = default;
~MockDebugRecorderFactory() { DCHECK(!prepared_recorder_); }

std::unique_ptr<AudioDebugRecorder> CreateDebugRecorder() {
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_low_latency_input_output_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class StreamWrapper {
samples_per_packet_ = params.frames_per_buffer();
}

virtual ~StreamWrapper() {}
virtual ~StreamWrapper() = default;

// Creates an Audio[Input|Output]Stream stream object using default
// parameters.
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ class AudioManagerHelper : public base::PowerObserver {
THREAD_MAX = THREAD_RECOVERED
};

AudioManagerHelper() {}
~AudioManagerHelper() override {}
AudioManagerHelper() = default;
~AudioManagerHelper() override = default;

void StartHangTimer(
scoped_refptr<base::SingleThreadTaskRunner> monitor_task_runner) {
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_manager_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ struct AudioManagerBase::DispatcherParams {
: input_params(input),
output_params(output),
output_device_id(output_device_id) {}
~DispatcherParams() {}
~DispatcherParams() = default;

const AudioParameters input_params;
const AudioParameters output_params;
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_manager_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ class MockAudioDebugRecordingManager : public AudioDebugRecordingManager {
scoped_refptr<base::SingleThreadTaskRunner> task_runner)
: AudioDebugRecordingManager(std::move(task_runner)) {}

~MockAudioDebugRecordingManager() override {}
~MockAudioDebugRecordingManager() override = default;

MOCK_METHOD1(EnableDebugRecording, void(const base::FilePath&));
MOCK_METHOD0(DisableDebugRecording, void());
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_output_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static const float kBufferNonZeroData = 1.0f;
class MockAudioOutputControllerEventHandler
: public AudioOutputController::EventHandler {
public:
MockAudioOutputControllerEventHandler() {}
MockAudioOutputControllerEventHandler() = default;

MOCK_METHOD0(OnControllerCreated, void());
MOCK_METHOD0(OnControllerPlaying, void());
Expand All @@ -63,7 +63,7 @@ class MockAudioOutputControllerEventHandler
class MockAudioOutputControllerSyncReader
: public AudioOutputController::SyncReader {
public:
MockAudioOutputControllerSyncReader() {}
MockAudioOutputControllerSyncReader() = default;

MOCK_METHOD3(RequestMoreData,
void(base::TimeDelta delay,
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_output_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

#include "media/audio/audio_output_delegate.h"

media::AudioOutputDelegate::EventHandler::~EventHandler() {}
media::AudioOutputDelegate::EventHandler::~EventHandler() = default;

media::AudioOutputDelegate::~AudioOutputDelegate() {}
media::AudioOutputDelegate::~AudioOutputDelegate() = default;
3 changes: 1 addition & 2 deletions media/audio/audio_output_device.cc
Original file line number Diff line number Diff line change
Expand Up @@ -466,8 +466,7 @@ AudioOutputDevice::AudioThreadCallback::AudioThreadCallback(
render_callback_(render_callback),
callback_num_(0) {}

AudioOutputDevice::AudioThreadCallback::~AudioThreadCallback() {
}
AudioOutputDevice::AudioThreadCallback::~AudioThreadCallback() = default;

void AudioOutputDevice::AudioThreadCallback::MapSharedMemory() {
CHECK_EQ(total_segments_, 1u);
Expand Down
8 changes: 4 additions & 4 deletions media/audio/audio_output_device_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ const size_t kBitstreamDataSize = 512;

class MockRenderCallback : public AudioRendererSink::RenderCallback {
public:
MockRenderCallback() {}
virtual ~MockRenderCallback() {}
MockRenderCallback() = default;
virtual ~MockRenderCallback() = default;

MOCK_METHOD4(Render,
int(base::TimeDelta delay,
Expand All @@ -76,8 +76,8 @@ void RenderAudioBus(base::TimeDelta delay,

class MockAudioOutputIPC : public AudioOutputIPC {
public:
MockAudioOutputIPC() {}
virtual ~MockAudioOutputIPC() {}
MockAudioOutputIPC() = default;
virtual ~MockAudioOutputIPC() = default;

MOCK_METHOD4(RequestDeviceAuthorization,
void(AudioOutputIPCDelegate* delegate,
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_output_ipc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

namespace media {

AudioOutputIPCDelegate::~AudioOutputIPCDelegate() {}
AudioOutputIPCDelegate::~AudioOutputIPCDelegate() = default;

AudioOutputIPC::~AudioOutputIPC() {}
AudioOutputIPC::~AudioOutputIPC() = default;

} // namespace media
2 changes: 1 addition & 1 deletion media/audio/audio_output_proxy_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class MockAudioOutputStream : public AudioOutputStream {
fake_output_stream_->Stop();
}

~MockAudioOutputStream() {}
~MockAudioOutputStream() = default;

bool start_called() { return start_called_; }
bool stop_called() { return stop_called_; }
Expand Down
3 changes: 1 addition & 2 deletions media/audio/audio_output_stream_sink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ AudioOutputStreamSink::AudioOutputStreamSink()
audio_task_runner_(AudioManager::Get()->GetTaskRunner()),
stream_(NULL) {}

AudioOutputStreamSink::~AudioOutputStreamSink() {
}
AudioOutputStreamSink::~AudioOutputStreamSink() = default;

void AudioOutputStreamSink::Initialize(const AudioParameters& params,
RenderCallback* callback) {
Expand Down
3 changes: 1 addition & 2 deletions media/audio/audio_power_monitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ AudioPowerMonitor::AudioPowerMonitor(
Reset();
}

AudioPowerMonitor::~AudioPowerMonitor() {
}
AudioPowerMonitor::~AudioPowerMonitor() = default;

void AudioPowerMonitor::Reset() {
// These are only read/written by Scan(), but Scan() should not be running
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_system.cc
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

namespace media {

AudioSystem::~AudioSystem() {}
AudioSystem::~AudioSystem() = default;

// static
std::unique_ptr<AudioSystem> AudioSystem::CreateInstance() {
Expand Down
2 changes: 1 addition & 1 deletion media/audio/audio_system_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ AudioSystemHelper::AudioSystemHelper(AudioManager* audio_manager)
DCHECK(audio_manager_);
}

AudioSystemHelper::~AudioSystemHelper() {}
AudioSystemHelper::~AudioSystemHelper() = default;

void AudioSystemHelper::GetInputStreamParameters(
const std::string& device_id,
Expand Down
4 changes: 2 additions & 2 deletions media/audio/audio_system_impl_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ namespace media {
template <bool use_audio_thread>
class AudioSystemImplTestBase : public testing::Test {
public:
AudioSystemImplTestBase() {}
AudioSystemImplTestBase() = default;

~AudioSystemImplTestBase() override {}
~AudioSystemImplTestBase() override = default;

void SetUp() override {
audio_manager_ = std::make_unique<MockAudioManager>(
Expand Down
Loading

0 comments on commit 2de6929

Please sign in to comment.