diff --git a/base/allocator/partition_allocator/partition_alloc_unittest.cc b/base/allocator/partition_allocator/partition_alloc_unittest.cc index a9da13846823f1..5bd790e8c2a7d8 100644 --- a/base/allocator/partition_allocator/partition_alloc_unittest.cc +++ b/base/allocator/partition_allocator/partition_alloc_unittest.cc @@ -103,9 +103,9 @@ const char* type_name = nullptr; class PartitionAllocTest : public testing::Test { protected: - PartitionAllocTest() {} + PartitionAllocTest() = default; - ~PartitionAllocTest() override {} + ~PartitionAllocTest() override = default; void SetUp() override { allocator.init(); diff --git a/base/bind_unittest.cc b/base/bind_unittest.cc index ef948c19a46ae8..7deba473e97dd0 100644 --- a/base/bind_unittest.cc +++ b/base/bind_unittest.cc @@ -31,7 +31,7 @@ class IncompleteType; class NoRef { public: - NoRef() {} + NoRef() = default; MOCK_METHOD0(VoidMethod0, void()); MOCK_CONST_METHOD0(VoidConstMethod0, void()); @@ -49,7 +49,7 @@ class NoRef { class HasRef : public NoRef { public: - HasRef() {} + HasRef() = default; MOCK_CONST_METHOD0(AddRef, void()); MOCK_CONST_METHOD0(Release, bool()); @@ -61,7 +61,7 @@ class HasRef : public NoRef { class HasRefPrivateDtor : public HasRef { private: - ~HasRefPrivateDtor() {} + ~HasRefPrivateDtor() = default; }; static const int kParentValue = 1; @@ -196,11 +196,8 @@ class CopyCounter { public: CopyCounter(int* copies, int* assigns) : counter_(copies, assigns, nullptr, nullptr) {} - CopyCounter(const CopyCounter& other) : counter_(other.counter_) {} - CopyCounter& operator=(const CopyCounter& other) { - counter_ = other.counter_; - return *this; - } + CopyCounter(const CopyCounter& other) = default; + CopyCounter& operator=(const CopyCounter& other) = default; explicit CopyCounter(const DerivedCopyMoveCounter& other) : counter_(other) {} @@ -321,8 +318,7 @@ class BindTest : public ::testing::Test { static_func_mock_ptr = &static_func_mock_; } - virtual ~BindTest() { - } + virtual ~BindTest() = default; static void VoidFunc0() { static_func_mock_ptr->VoidMethod0(); diff --git a/base/callback_helpers.cc b/base/callback_helpers.cc index 1f87a6c35e6960..90867310c85575 100644 --- a/base/callback_helpers.cc +++ b/base/callback_helpers.cc @@ -6,7 +6,7 @@ namespace base { -ScopedClosureRunner::ScopedClosureRunner() {} +ScopedClosureRunner::ScopedClosureRunner() = default; ScopedClosureRunner::ScopedClosureRunner(OnceClosure closure) : closure_(std::move(closure)) {} diff --git a/base/callback_internal.cc b/base/callback_internal.cc index 864c1a036cdc2c..0179bb763f607e 100644 --- a/base/callback_internal.cc +++ b/base/callback_internal.cc @@ -71,7 +71,7 @@ CallbackBase::CallbackBase(BindStateBase* bind_state) DCHECK(!bind_state_.get() || bind_state_->HasOneRef()); } -CallbackBase::~CallbackBase() {} +CallbackBase::~CallbackBase() = default; CallbackBaseCopyable::CallbackBaseCopyable(const CallbackBaseCopyable& c) : CallbackBase(nullptr) { diff --git a/base/callback_unittest.cc b/base/callback_unittest.cc index f76adbcdd2ca56..c07d3ee20ea4a0 100644 --- a/base/callback_unittest.cc +++ b/base/callback_unittest.cc @@ -25,7 +25,7 @@ struct FakeBindState : internal::BindStateBase { FakeBindState() : BindStateBase(&NopInvokeFunc, &Destroy, &IsCancelled) {} private: - ~FakeBindState() {} + ~FakeBindState() = default; static void Destroy(const internal::BindStateBase* self) { delete static_cast(self); } @@ -41,7 +41,7 @@ class CallbackTest : public ::testing::Test { CallbackTest() : callback_a_(new FakeBindState()), callback_b_(new FakeBindState()) {} - ~CallbackTest() override {} + ~CallbackTest() override = default; protected: Callback callback_a_; diff --git a/base/cancelable_callback_unittest.cc b/base/cancelable_callback_unittest.cc index e793a836db7a3f..373498cbded897 100644 --- a/base/cancelable_callback_unittest.cc +++ b/base/cancelable_callback_unittest.cc @@ -23,7 +23,8 @@ namespace { class TestRefCounted : public RefCountedThreadSafe { private: friend class RefCountedThreadSafe; - ~TestRefCounted() {}; + ~TestRefCounted() = default; + ; }; void Increment(int* count) { (*count)++; } diff --git a/base/command_line.cc b/base/command_line.cc index 69c5fb12991a3d..3a5d089bb2fd1c 100644 --- a/base/command_line.cc +++ b/base/command_line.cc @@ -174,21 +174,11 @@ CommandLine::CommandLine(const StringVector& argv) InitFromArgv(argv); } -CommandLine::CommandLine(const CommandLine& other) - : argv_(other.argv_), - switches_(other.switches_), - begin_args_(other.begin_args_) { -} +CommandLine::CommandLine(const CommandLine& other) = default; -CommandLine& CommandLine::operator=(const CommandLine& other) { - argv_ = other.argv_; - switches_ = other.switches_; - begin_args_ = other.begin_args_; - return *this; -} +CommandLine& CommandLine::operator=(const CommandLine& other) = default; -CommandLine::~CommandLine() { -} +CommandLine::~CommandLine() = default; #if defined(OS_WIN) // static diff --git a/base/containers/linked_list_unittest.cc b/base/containers/linked_list_unittest.cc index 4b40fbf9d63952..3470c86b62cae4 100644 --- a/base/containers/linked_list_unittest.cc +++ b/base/containers/linked_list_unittest.cc @@ -28,7 +28,7 @@ class MultipleInheritanceNodeBase { class MultipleInheritanceNode : public MultipleInheritanceNodeBase, public LinkNode { public: - MultipleInheritanceNode() {} + MultipleInheritanceNode() = default; }; // Checks that when iterating |list| (either from head to tail, or from diff --git a/base/containers/small_map_unittest.cc b/base/containers/small_map_unittest.cc index d33549f1cd547c..6561851f9de0f7 100644 --- a/base/containers/small_map_unittest.cc +++ b/base/containers/small_map_unittest.cc @@ -443,7 +443,7 @@ namespace { class unordered_map_add_item : public std::unordered_map { public: - unordered_map_add_item() {} + unordered_map_add_item() = default; explicit unordered_map_add_item(const std::pair& item) { insert(item); } diff --git a/base/containers/stack_container_unittest.cc b/base/containers/stack_container_unittest.cc index 20907055fe0089..b6bb9b635276e7 100644 --- a/base/containers/stack_container_unittest.cc +++ b/base/containers/stack_container_unittest.cc @@ -107,7 +107,7 @@ template class AlignedData { public: AlignedData() { memset(data_, 0, alignment); } - ~AlignedData() {} + ~AlignedData() = default; alignas(alignment) char data_[alignment]; }; diff --git a/base/debug/activity_analyzer.cc b/base/debug/activity_analyzer.cc index 5cb7b71d18b06f..d787829579a784 100644 --- a/base/debug/activity_analyzer.cc +++ b/base/debug/activity_analyzer.cc @@ -41,8 +41,8 @@ void LogAnalyzerCreationError(AnalyzerCreationError error) { } // namespace -ThreadActivityAnalyzer::Snapshot::Snapshot() {} -ThreadActivityAnalyzer::Snapshot::~Snapshot() {} +ThreadActivityAnalyzer::Snapshot::Snapshot() = default; +ThreadActivityAnalyzer::Snapshot::~Snapshot() = default; ThreadActivityAnalyzer::ThreadActivityAnalyzer( const ThreadActivityTracker& tracker) @@ -60,7 +60,7 @@ ThreadActivityAnalyzer::ThreadActivityAnalyzer( PersistentMemoryAllocator::kSizeAny), allocator->GetAllocSize(reference)) {} -ThreadActivityAnalyzer::~ThreadActivityAnalyzer() {} +ThreadActivityAnalyzer::~ThreadActivityAnalyzer() = default; void ThreadActivityAnalyzer::AddGlobalInformation( GlobalActivityAnalyzer* global) { @@ -87,7 +87,7 @@ GlobalActivityAnalyzer::GlobalActivityAnalyzer( DCHECK(allocator_); } -GlobalActivityAnalyzer::~GlobalActivityAnalyzer() {} +GlobalActivityAnalyzer::~GlobalActivityAnalyzer() = default; // static std::unique_ptr @@ -298,12 +298,12 @@ bool GlobalActivityAnalyzer::IsDataComplete() const { return !allocator_->IsFull(); } -GlobalActivityAnalyzer::UserDataSnapshot::UserDataSnapshot() {} +GlobalActivityAnalyzer::UserDataSnapshot::UserDataSnapshot() = default; GlobalActivityAnalyzer::UserDataSnapshot::UserDataSnapshot( const UserDataSnapshot& rhs) = default; GlobalActivityAnalyzer::UserDataSnapshot::UserDataSnapshot( UserDataSnapshot&& rhs) = default; -GlobalActivityAnalyzer::UserDataSnapshot::~UserDataSnapshot() {} +GlobalActivityAnalyzer::UserDataSnapshot::~UserDataSnapshot() = default; void GlobalActivityAnalyzer::PrepareAllAnalyzers() { // Record the time when analysis started. diff --git a/base/debug/activity_analyzer_unittest.cc b/base/debug/activity_analyzer_unittest.cc index 78a8e19955f69f..e08b43aff3ef62 100644 --- a/base/debug/activity_analyzer_unittest.cc +++ b/base/debug/activity_analyzer_unittest.cc @@ -37,7 +37,7 @@ class TestActivityTracker : public ThreadActivityTracker { : ThreadActivityTracker(memset(memory.get(), 0, mem_size), mem_size), mem_segment_(std::move(memory)) {} - ~TestActivityTracker() override {} + ~TestActivityTracker() override = default; private: std::unique_ptr mem_segment_; @@ -51,7 +51,7 @@ class ActivityAnalyzerTest : public testing::Test { const int kMemorySize = 1 << 20; // 1MiB const int kStackSize = 1 << 10; // 1KiB - ActivityAnalyzerTest() {} + ActivityAnalyzerTest() = default; ~ActivityAnalyzerTest() override { GlobalActivityTracker* global_tracker = GlobalActivityTracker::Get(); @@ -119,7 +119,7 @@ class SimpleActivityThread : public SimpleThread { exit_(false), exit_condition_(&lock_) {} - ~SimpleActivityThread() override {} + ~SimpleActivityThread() override = default; void Run() override { ThreadActivityTracker::ActivityId id = diff --git a/base/debug/activity_tracker.cc b/base/debug/activity_tracker.cc index 264ad6b58293c1..1b3aaeec7b8923 100644 --- a/base/debug/activity_tracker.cc +++ b/base/debug/activity_tracker.cc @@ -120,8 +120,8 @@ Time WallTimeFromTickTime(int64_t ticks_start, int64_t ticks, Time time_start) { } // namespace -OwningProcess::OwningProcess() {} -OwningProcess::~OwningProcess() {} +OwningProcess::OwningProcess() = default; +OwningProcess::~OwningProcess() = default; void OwningProcess::Release_Initialize(int64_t pid) { uint32_t old_id = data_id.load(std::memory_order_acquire); @@ -185,7 +185,7 @@ ActivityTrackerMemoryAllocator::ActivityTrackerMemoryAllocator( DCHECK(allocator); } -ActivityTrackerMemoryAllocator::~ActivityTrackerMemoryAllocator() {} +ActivityTrackerMemoryAllocator::~ActivityTrackerMemoryAllocator() = default; ActivityTrackerMemoryAllocator::Reference ActivityTrackerMemoryAllocator::GetObjectReference() { @@ -276,9 +276,9 @@ void Activity::FillFrom(Activity* activity, #endif } -ActivityUserData::TypedValue::TypedValue() {} +ActivityUserData::TypedValue::TypedValue() = default; ActivityUserData::TypedValue::TypedValue(const TypedValue& other) = default; -ActivityUserData::TypedValue::~TypedValue() {} +ActivityUserData::TypedValue::~TypedValue() = default; StringPiece ActivityUserData::TypedValue::Get() const { DCHECK_EQ(RAW_VALUE, type_); @@ -323,13 +323,13 @@ StringPiece ActivityUserData::TypedValue::GetStringReference() const { // These are required because std::atomic is (currently) not a POD type and // thus clang requires explicit out-of-line constructors and destructors even // when they do nothing. -ActivityUserData::ValueInfo::ValueInfo() {} +ActivityUserData::ValueInfo::ValueInfo() = default; ActivityUserData::ValueInfo::ValueInfo(ValueInfo&&) = default; -ActivityUserData::ValueInfo::~ValueInfo() {} -ActivityUserData::MemoryHeader::MemoryHeader() {} -ActivityUserData::MemoryHeader::~MemoryHeader() {} -ActivityUserData::FieldHeader::FieldHeader() {} -ActivityUserData::FieldHeader::~FieldHeader() {} +ActivityUserData::ValueInfo::~ValueInfo() = default; +ActivityUserData::MemoryHeader::MemoryHeader() = default; +ActivityUserData::MemoryHeader::~MemoryHeader() = default; +ActivityUserData::FieldHeader::FieldHeader() = default; +ActivityUserData::FieldHeader::~FieldHeader() = default; ActivityUserData::ActivityUserData() : ActivityUserData(nullptr, 0, -1) {} @@ -362,7 +362,7 @@ ActivityUserData::ActivityUserData(void* memory, size_t size, int64_t pid) ImportExistingData(); } -ActivityUserData::~ActivityUserData() {} +ActivityUserData::~ActivityUserData() = default; bool ActivityUserData::CreateSnapshot(Snapshot* output_snapshot) const { DCHECK(output_snapshot); @@ -655,8 +655,8 @@ struct ThreadActivityTracker::Header { char thread_name[32]; }; -ThreadActivityTracker::Snapshot::Snapshot() {} -ThreadActivityTracker::Snapshot::~Snapshot() {} +ThreadActivityTracker::Snapshot::Snapshot() = default; +ThreadActivityTracker::Snapshot::~Snapshot() = default; ThreadActivityTracker::ScopedActivity::ScopedActivity( ThreadActivityTracker* tracker, @@ -758,7 +758,7 @@ ThreadActivityTracker::ThreadActivityTracker(void* base, size_t size) } } -ThreadActivityTracker::~ThreadActivityTracker() {} +ThreadActivityTracker::~ThreadActivityTracker() = default; ThreadActivityTracker::ActivityId ThreadActivityTracker::PushActivity( const void* program_counter, @@ -1082,18 +1082,18 @@ ThreadActivityTracker::CreateUserDataForActivity( // of std::atomic because the latter can create global ctors and dtors. subtle::AtomicWord GlobalActivityTracker::g_tracker_ = 0; -GlobalActivityTracker::ModuleInfo::ModuleInfo() {} +GlobalActivityTracker::ModuleInfo::ModuleInfo() = default; GlobalActivityTracker::ModuleInfo::ModuleInfo(ModuleInfo&& rhs) = default; GlobalActivityTracker::ModuleInfo::ModuleInfo(const ModuleInfo& rhs) = default; -GlobalActivityTracker::ModuleInfo::~ModuleInfo() {} +GlobalActivityTracker::ModuleInfo::~ModuleInfo() = default; GlobalActivityTracker::ModuleInfo& GlobalActivityTracker::ModuleInfo::operator=( ModuleInfo&& rhs) = default; GlobalActivityTracker::ModuleInfo& GlobalActivityTracker::ModuleInfo::operator=( const ModuleInfo& rhs) = default; -GlobalActivityTracker::ModuleInfoRecord::ModuleInfoRecord() {} -GlobalActivityTracker::ModuleInfoRecord::~ModuleInfoRecord() {} +GlobalActivityTracker::ModuleInfoRecord::ModuleInfoRecord() = default; +GlobalActivityTracker::ModuleInfoRecord::~ModuleInfoRecord() = default; bool GlobalActivityTracker::ModuleInfoRecord::DecodeTo( GlobalActivityTracker::ModuleInfo* info, @@ -1225,7 +1225,7 @@ GlobalActivityTracker::ThreadSafeUserData::ThreadSafeUserData(void* memory, int64_t pid) : ActivityUserData(memory, size, pid) {} -GlobalActivityTracker::ThreadSafeUserData::~ThreadSafeUserData() {} +GlobalActivityTracker::ThreadSafeUserData::~ThreadSafeUserData() = default; void GlobalActivityTracker::ThreadSafeUserData::Set(StringPiece name, ValueType type, diff --git a/base/debug/activity_tracker_unittest.cc b/base/debug/activity_tracker_unittest.cc index 1c7ed7acc498a2..79d19dbef02e1c 100644 --- a/base/debug/activity_tracker_unittest.cc +++ b/base/debug/activity_tracker_unittest.cc @@ -33,7 +33,7 @@ class TestActivityTracker : public ThreadActivityTracker { : ThreadActivityTracker(memset(memory.get(), 0, mem_size), mem_size), mem_segment_(std::move(memory)) {} - ~TestActivityTracker() override {} + ~TestActivityTracker() override = default; private: std::unique_ptr mem_segment_; @@ -49,7 +49,7 @@ class ActivityTrackerTest : public testing::Test { using ActivityId = ThreadActivityTracker::ActivityId; - ActivityTrackerTest() {} + ActivityTrackerTest() = default; ~ActivityTrackerTest() override { GlobalActivityTracker* global_tracker = GlobalActivityTracker::Get(); @@ -260,7 +260,7 @@ class SimpleLockThread : public SimpleThread { data_changed_(false), is_running_(false) {} - ~SimpleLockThread() override {} + ~SimpleLockThread() override = default; void Run() override { ThreadActivityTracker* tracker = @@ -401,7 +401,7 @@ class SimpleActivityThread : public SimpleThread { exit_(false), exit_condition_(&lock_) {} - ~SimpleActivityThread() override {} + ~SimpleActivityThread() override = default; void Run() override { ThreadActivityTracker::ActivityId id = diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc index fdaff1cb8c5f65..1d7df1f62f1a75 100644 --- a/base/debug/stack_trace_posix.cc +++ b/base/debug/stack_trace_posix.cc @@ -129,7 +129,7 @@ class BacktraceOutputHandler { virtual void HandleOutput(const char* output) = 0; protected: - virtual ~BacktraceOutputHandler() {} + virtual ~BacktraceOutputHandler() = default; }; #if !defined(__UCLIBC__) && !defined(_AIX) @@ -415,7 +415,7 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) { class PrintBacktraceOutputHandler : public BacktraceOutputHandler { public: - PrintBacktraceOutputHandler() {} + PrintBacktraceOutputHandler() = default; void HandleOutput(const char* output) override { // NOTE: This code MUST be async-signal safe (it's used by in-process diff --git a/base/debug/task_annotator.cc b/base/debug/task_annotator.cc index 31f11beeba9067..b9ff7f7d1c0b63 100644 --- a/base/debug/task_annotator.cc +++ b/base/debug/task_annotator.cc @@ -14,11 +14,9 @@ namespace base { namespace debug { -TaskAnnotator::TaskAnnotator() { -} +TaskAnnotator::TaskAnnotator() = default; -TaskAnnotator::~TaskAnnotator() { -} +TaskAnnotator::~TaskAnnotator() = default; void TaskAnnotator::DidQueueTask(const char* queue_function, const PendingTask& pending_task) { diff --git a/base/deferred_sequenced_task_runner.cc b/base/deferred_sequenced_task_runner.cc index 21cb99a64f4e1c..9830402943566a 100644 --- a/base/deferred_sequenced_task_runner.cc +++ b/base/deferred_sequenced_task_runner.cc @@ -18,8 +18,7 @@ DeferredSequencedTaskRunner::DeferredTask::DeferredTask() DeferredSequencedTaskRunner::DeferredTask::DeferredTask(DeferredTask&& other) = default; -DeferredSequencedTaskRunner::DeferredTask::~DeferredTask() { -} +DeferredSequencedTaskRunner::DeferredTask::~DeferredTask() = default; DeferredSequencedTaskRunner::DeferredTask& DeferredSequencedTaskRunner::DeferredTask::operator=(DeferredTask&& other) = @@ -29,8 +28,7 @@ DeferredSequencedTaskRunner::DeferredSequencedTaskRunner( scoped_refptr target_task_runner) : started_(false), target_task_runner_(std::move(target_task_runner)) {} -DeferredSequencedTaskRunner::~DeferredSequencedTaskRunner() { -} +DeferredSequencedTaskRunner::~DeferredSequencedTaskRunner() = default; bool DeferredSequencedTaskRunner::PostDelayedTask(const Location& from_here, OnceClosure task, diff --git a/base/environment.cc b/base/environment.cc index 6c13f5f2fc29b8..f6655d9a917ec2 100644 --- a/base/environment.cc +++ b/base/environment.cc @@ -132,7 +132,7 @@ const char kHome[] = "HOME"; } // namespace env_vars -Environment::~Environment() {} +Environment::~Environment() = default; // static std::unique_ptr Environment::Create() { diff --git a/base/feature_list.cc b/base/feature_list.cc index 7d984f1ad1d901..e9aa54bc54c4e8 100644 --- a/base/feature_list.cc +++ b/base/feature_list.cc @@ -81,9 +81,9 @@ const Feature kSyzyAsanDCheckIsFatalFeature{"DcheckIsFatal", base::FEATURE_DISABLED_BY_DEFAULT}; #endif // defined(SYZYASAN) -FeatureList::FeatureList() {} +FeatureList::FeatureList() = default; -FeatureList::~FeatureList() {} +FeatureList::~FeatureList() = default; void FeatureList::InitializeFromCommandLine( const std::string& enable_features, diff --git a/base/file_descriptor_store.cc b/base/file_descriptor_store.cc index 34f3381fe96467..71cf2b3f51d44c 100644 --- a/base/file_descriptor_store.cc +++ b/base/file_descriptor_store.cc @@ -26,7 +26,7 @@ FileDescriptorStore::Descriptor::Descriptor( FileDescriptorStore::Descriptor&& other) : key(other.key), fd(std::move(other.fd)), region(other.region) {} -FileDescriptorStore::Descriptor::~Descriptor() {} +FileDescriptorStore::Descriptor::~Descriptor() = default; // static FileDescriptorStore& FileDescriptorStore::GetInstance() { @@ -66,8 +66,8 @@ void FileDescriptorStore::Set(const std::string& key, descriptors_.insert(std::make_pair(key, std::move(descriptor))); } -FileDescriptorStore::FileDescriptorStore() {} +FileDescriptorStore::FileDescriptorStore() = default; -FileDescriptorStore::~FileDescriptorStore() {} +FileDescriptorStore::~FileDescriptorStore() = default; } // namespace base diff --git a/base/files/file.cc b/base/files/file.cc index 672950045a0d24..50b4370d309851 100644 --- a/base/files/file.cc +++ b/base/files/file.cc @@ -17,8 +17,7 @@ File::Info::Info() is_symbolic_link(false) { } -File::Info::~Info() { -} +File::Info::~Info() = default; File::File() : error_details_(FILE_ERROR_FAILED), diff --git a/base/files/file_enumerator.cc b/base/files/file_enumerator.cc index dfa277a2d1c7ef..9dfb2ba04b56d1 100644 --- a/base/files/file_enumerator.cc +++ b/base/files/file_enumerator.cc @@ -8,8 +8,7 @@ namespace base { -FileEnumerator::FileInfo::~FileInfo() { -} +FileEnumerator::FileInfo::~FileInfo() = default; bool FileEnumerator::ShouldSkip(const FilePath& path) { FilePath::StringType basename = path.BaseName().value(); diff --git a/base/files/file_enumerator_posix.cc b/base/files/file_enumerator_posix.cc index 71c0c3f45adb22..4b429c6448287e 100644 --- a/base/files/file_enumerator_posix.cc +++ b/base/files/file_enumerator_posix.cc @@ -92,8 +92,7 @@ FileEnumerator::FileEnumerator(const FilePath& root_path, pending_paths_.push(root_path); } -FileEnumerator::~FileEnumerator() { -} +FileEnumerator::~FileEnumerator() = default; FilePath FileEnumerator::Next() { AssertBlockingAllowed(); diff --git a/base/files/file_locking_unittest.cc b/base/files/file_locking_unittest.cc index 067ff5700759d1..e158b7d06a2ec4 100644 --- a/base/files/file_locking_unittest.cc +++ b/base/files/file_locking_unittest.cc @@ -121,7 +121,7 @@ MULTIPROCESS_TEST_MAIN(ChildMain) { class FileLockingTest : public testing::Test { public: - FileLockingTest() {} + FileLockingTest() = default; protected: void SetUp() override { diff --git a/base/files/file_path.cc b/base/files/file_path.cc index 3f83dfa904f303..29a0b40c8114ca 100644 --- a/base/files/file_path.cc +++ b/base/files/file_path.cc @@ -169,11 +169,9 @@ bool IsEmptyOrSpecialCase(const StringType& path) { } // namespace -FilePath::FilePath() { -} +FilePath::FilePath() = default; -FilePath::FilePath(const FilePath& that) : path_(that.path_) { -} +FilePath::FilePath(const FilePath& that) = default; FilePath::FilePath(FilePath&& that) noexcept = default; FilePath::FilePath(StringPieceType path) { @@ -183,13 +181,9 @@ FilePath::FilePath(StringPieceType path) { path_.erase(nul_pos, StringType::npos); } -FilePath::~FilePath() { -} +FilePath::~FilePath() = default; -FilePath& FilePath::operator=(const FilePath& that) { - path_ = that.path_; - return *this; -} +FilePath& FilePath::operator=(const FilePath& that) = default; FilePath& FilePath::operator=(FilePath&& that) = default; diff --git a/base/files/file_path_watcher_unittest.cc b/base/files/file_path_watcher_unittest.cc index 3895d52b7cc44d..1ae5dc16747575 100644 --- a/base/files/file_path_watcher_unittest.cc +++ b/base/files/file_path_watcher_unittest.cc @@ -75,7 +75,7 @@ class NotificationCollector private: friend class base::RefCountedThreadSafe; - ~NotificationCollector() {} + ~NotificationCollector() = default; void RecordChange(TestDelegate* delegate) { // Warning: |delegate| is Unretained. Do not dereference. @@ -100,8 +100,8 @@ class NotificationCollector class TestDelegateBase : public SupportsWeakPtr { public: - TestDelegateBase() {} - virtual ~TestDelegateBase() {} + TestDelegateBase() = default; + virtual ~TestDelegateBase() = default; virtual void OnFileChanged(const FilePath& path, bool error) = 0; @@ -120,7 +120,7 @@ class TestDelegate : public TestDelegateBase { : collector_(collector) { collector_->Register(this); } - ~TestDelegate() override {} + ~TestDelegate() override = default; void OnFileChanged(const FilePath& path, bool error) override { if (error) @@ -144,7 +144,7 @@ class FilePathWatcherTest : public testing::Test { { } - ~FilePathWatcherTest() override {} + ~FilePathWatcherTest() override = default; protected: void SetUp() override { @@ -275,7 +275,7 @@ class Deleter : public TestDelegateBase { : watcher_(watcher), loop_(loop) { } - ~Deleter() override {} + ~Deleter() override = default; void OnFileChanged(const FilePath&, bool) override { watcher_.reset(); diff --git a/base/files/important_file_writer_unittest.cc b/base/files/important_file_writer_unittest.cc index f48343ae82a7d3..0f97945ff6e654 100644 --- a/base/files/important_file_writer_unittest.cc +++ b/base/files/important_file_writer_unittest.cc @@ -114,7 +114,7 @@ WriteCallbacksObserver::GetAndResetObservationState() { class ImportantFileWriterTest : public testing::Test { public: - ImportantFileWriterTest() { } + ImportantFileWriterTest() = default; void SetUp() override { ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); file_ = temp_dir_.GetPath().AppendASCII("test-file"); diff --git a/base/files/scoped_temp_dir.cc b/base/files/scoped_temp_dir.cc index a04e825156b6d1..01ec0f0caab55f 100644 --- a/base/files/scoped_temp_dir.cc +++ b/base/files/scoped_temp_dir.cc @@ -16,8 +16,7 @@ constexpr FilePath::CharType kScopedDirPrefix[] = } // namespace -ScopedTempDir::ScopedTempDir() { -} +ScopedTempDir::ScopedTempDir() = default; ScopedTempDir::~ScopedTempDir() { if (!path_.empty() && !Delete()) diff --git a/base/gmock_unittest.cc b/base/gmock_unittest.cc index da8dd94ea39cc5..5c16728e354ff9 100644 --- a/base/gmock_unittest.cc +++ b/base/gmock_unittest.cc @@ -23,8 +23,8 @@ namespace { // for easy mocking. class SampleClass { public: - SampleClass() {} - virtual ~SampleClass() {} + SampleClass() = default; + virtual ~SampleClass() = default; virtual int ReturnSomething() { return -1; diff --git a/base/i18n/bidi_line_iterator_unittest.cc b/base/i18n/bidi_line_iterator_unittest.cc index 5851664d9cfe29..d531313bf1d656 100644 --- a/base/i18n/bidi_line_iterator_unittest.cc +++ b/base/i18n/bidi_line_iterator_unittest.cc @@ -14,7 +14,7 @@ namespace { class BiDiLineIteratorTest : public testing::TestWithParam { public: - BiDiLineIteratorTest() {} + BiDiLineIteratorTest() = default; BiDiLineIterator* iterator() { return &iterator_; } diff --git a/base/i18n/char_iterator.cc b/base/i18n/char_iterator.cc index 25efc518694c0f..d80b8b618d991e 100644 --- a/base/i18n/char_iterator.cc +++ b/base/i18n/char_iterator.cc @@ -21,8 +21,7 @@ UTF8CharIterator::UTF8CharIterator(const std::string* str) U8_NEXT(str_, next_pos_, len_, char_); } -UTF8CharIterator::~UTF8CharIterator() { -} +UTF8CharIterator::~UTF8CharIterator() = default; bool UTF8CharIterator::Advance() { if (array_pos_ >= len_) @@ -58,8 +57,7 @@ UTF16CharIterator::UTF16CharIterator(const char16* str, size_t str_len) ReadChar(); } -UTF16CharIterator::~UTF16CharIterator() { -} +UTF16CharIterator::~UTF16CharIterator() = default; bool UTF16CharIterator::Advance() { if (array_pos_ >= len_) diff --git a/base/i18n/file_util_icu.cc b/base/i18n/file_util_icu.cc index e0cf3d52178753..c154204d659339 100644 --- a/base/i18n/file_util_icu.cc +++ b/base/i18n/file_util_icu.cc @@ -54,7 +54,7 @@ class IllegalCharacters { friend struct DefaultSingletonTraits; IllegalCharacters(); - ~IllegalCharacters() { } + ~IllegalCharacters() = default; // set of characters considered invalid anywhere inside a filename. std::unique_ptr illegal_anywhere_; diff --git a/base/i18n/message_formatter.cc b/base/i18n/message_formatter.cc index 6962a28297553a..c69dd07d3d8114 100644 --- a/base/i18n/message_formatter.cc +++ b/base/i18n/message_formatter.cc @@ -48,7 +48,7 @@ MessageArg::MessageArg(double d) : formattable(new icu::Formattable(d)) {} MessageArg::MessageArg(const Time& t) : formattable(new icu::Formattable(static_cast(t.ToJsTime()))) {} -MessageArg::~MessageArg() {} +MessageArg::~MessageArg() = default; // Tests if this argument has a value, and if so increments *count. bool MessageArg::has_value(int *count) const { diff --git a/base/json/json_file_value_serializer.cc b/base/json/json_file_value_serializer.cc index cd836fcc489c84..a7c68c59d50ed9 100644 --- a/base/json/json_file_value_serializer.cc +++ b/base/json/json_file_value_serializer.cc @@ -21,8 +21,7 @@ JSONFileValueSerializer::JSONFileValueSerializer( : json_file_path_(json_file_path) { } -JSONFileValueSerializer::~JSONFileValueSerializer() { -} +JSONFileValueSerializer::~JSONFileValueSerializer() = default; bool JSONFileValueSerializer::Serialize(const base::Value& root) { return SerializeInternal(root, false); @@ -57,8 +56,7 @@ JSONFileValueDeserializer::JSONFileValueDeserializer( int options) : json_file_path_(json_file_path), options_(options), last_read_size_(0U) {} -JSONFileValueDeserializer::~JSONFileValueDeserializer() { -} +JSONFileValueDeserializer::~JSONFileValueDeserializer() = default; int JSONFileValueDeserializer::ReadFileToString(std::string* json_string) { DCHECK(json_string); diff --git a/base/json/json_parser.cc b/base/json/json_parser.cc index 7b26c204987f55..ceb64a62c056e9 100644 --- a/base/json/json_parser.cc +++ b/base/json/json_parser.cc @@ -70,8 +70,7 @@ JSONParser::JSONParser(int options) error_column_(0) { } -JSONParser::~JSONParser() { -} +JSONParser::~JSONParser() = default; std::unique_ptr JSONParser::Parse(StringPiece input) { start_pos_ = input.data(); @@ -135,8 +134,7 @@ JSONParser::StringBuilder::StringBuilder() : StringBuilder(nullptr) {} JSONParser::StringBuilder::StringBuilder(const char* pos) : pos_(pos), length_(0) {} -JSONParser::StringBuilder::~StringBuilder() { -} +JSONParser::StringBuilder::~StringBuilder() = default; JSONParser::StringBuilder& JSONParser::StringBuilder::operator=( StringBuilder&& other) = default; diff --git a/base/json/json_reader.cc b/base/json/json_reader.cc index 4ff7496bbb15f7..e18f4a55a5adca 100644 --- a/base/json/json_reader.cc +++ b/base/json/json_reader.cc @@ -39,8 +39,7 @@ JSONReader::JSONReader(int options) : parser_(new internal::JSONParser(options)) { } -JSONReader::~JSONReader() { -} +JSONReader::~JSONReader() = default; // static std::unique_ptr JSONReader::Read(StringPiece json) { diff --git a/base/json/json_string_value_serializer.cc b/base/json/json_string_value_serializer.cc index 2e46ab387a20a1..f9c45a40d3e57e 100644 --- a/base/json/json_string_value_serializer.cc +++ b/base/json/json_string_value_serializer.cc @@ -15,7 +15,7 @@ JSONStringValueSerializer::JSONStringValueSerializer(std::string* json_string) pretty_print_(false) { } -JSONStringValueSerializer::~JSONStringValueSerializer() {} +JSONStringValueSerializer::~JSONStringValueSerializer() = default; bool JSONStringValueSerializer::Serialize(const Value& root) { return SerializeInternal(root, false); @@ -45,7 +45,7 @@ JSONStringValueDeserializer::JSONStringValueDeserializer( int options) : json_string_(json_string), options_(options) {} -JSONStringValueDeserializer::~JSONStringValueDeserializer() {} +JSONStringValueDeserializer::~JSONStringValueDeserializer() = default; std::unique_ptr JSONStringValueDeserializer::Deserialize( int* error_code, diff --git a/base/lazy_instance_unittest.cc b/base/lazy_instance_unittest.cc index 55ea45bf3575ba..cfa48f2308c763 100644 --- a/base/lazy_instance_unittest.cc +++ b/base/lazy_instance_unittest.cc @@ -150,8 +150,8 @@ namespace { template class AlignedData { public: - AlignedData() {} - ~AlignedData() {} + AlignedData() = default; + ~AlignedData() = default; alignas(alignment) char data_[alignment]; }; diff --git a/base/linux_util.cc b/base/linux_util.cc index d58fb799955040..ddf848eeb701f6 100644 --- a/base/linux_util.cc +++ b/base/linux_util.cc @@ -48,7 +48,7 @@ class LinuxDistroHelper { // The simple state machine goes from: // STATE_DID_NOT_CHECK -> STATE_CHECK_STARTED -> STATE_CHECK_FINISHED. LinuxDistroHelper() : state_(STATE_DID_NOT_CHECK) {} - ~LinuxDistroHelper() {} + ~LinuxDistroHelper() = default; // Retrieve the current state, if we're in STATE_DID_NOT_CHECK, // we automatically move to STATE_CHECK_STARTED so nobody else will diff --git a/base/memory/discardable_memory.cc b/base/memory/discardable_memory.cc index d50f1853e19702..f0730aa403fec6 100644 --- a/base/memory/discardable_memory.cc +++ b/base/memory/discardable_memory.cc @@ -6,10 +6,8 @@ namespace base { -DiscardableMemory::DiscardableMemory() { -} +DiscardableMemory::DiscardableMemory() = default; -DiscardableMemory::~DiscardableMemory() { -} +DiscardableMemory::~DiscardableMemory() = default; } // namespace base diff --git a/base/memory/discardable_shared_memory.cc b/base/memory/discardable_shared_memory.cc index 2b7f7381a97767..7aeddab63d205f 100644 --- a/base/memory/discardable_shared_memory.cc +++ b/base/memory/discardable_shared_memory.cc @@ -152,8 +152,7 @@ DiscardableSharedMemory::DiscardableSharedMemory( locked_page_count_(0) { } -DiscardableSharedMemory::~DiscardableSharedMemory() { -} +DiscardableSharedMemory::~DiscardableSharedMemory() = default; bool DiscardableSharedMemory::CreateAndMap(size_t size) { CheckedNumeric checked_size = size; diff --git a/base/memory/discardable_shared_memory_unittest.cc b/base/memory/discardable_shared_memory_unittest.cc index 2858f50da6df71..caf7eaf047cc61 100644 --- a/base/memory/discardable_shared_memory_unittest.cc +++ b/base/memory/discardable_shared_memory_unittest.cc @@ -19,7 +19,7 @@ namespace { class TestDiscardableSharedMemory : public DiscardableSharedMemory { public: - TestDiscardableSharedMemory() {} + TestDiscardableSharedMemory() = default; explicit TestDiscardableSharedMemory(SharedMemoryHandle handle) : DiscardableSharedMemory(handle) {} diff --git a/base/memory/memory_coordinator_client_registry.cc b/base/memory/memory_coordinator_client_registry.cc index 67064581ab001e..45b4a7f5bc95ff 100644 --- a/base/memory/memory_coordinator_client_registry.cc +++ b/base/memory/memory_coordinator_client_registry.cc @@ -17,7 +17,7 @@ MemoryCoordinatorClientRegistry::GetInstance() { MemoryCoordinatorClientRegistry::MemoryCoordinatorClientRegistry() : clients_(new ClientList) {} -MemoryCoordinatorClientRegistry::~MemoryCoordinatorClientRegistry() {} +MemoryCoordinatorClientRegistry::~MemoryCoordinatorClientRegistry() = default; void MemoryCoordinatorClientRegistry::Register( MemoryCoordinatorClient* client) { diff --git a/base/memory/memory_coordinator_proxy.cc b/base/memory/memory_coordinator_proxy.cc index f82e928a4b5935..4e22fe04fcf21b 100644 --- a/base/memory/memory_coordinator_proxy.cc +++ b/base/memory/memory_coordinator_proxy.cc @@ -12,11 +12,9 @@ MemoryCoordinator* g_memory_coordinator = nullptr; } // namespace -MemoryCoordinatorProxy::MemoryCoordinatorProxy() { -} +MemoryCoordinatorProxy::MemoryCoordinatorProxy() = default; -MemoryCoordinatorProxy::~MemoryCoordinatorProxy() { -} +MemoryCoordinatorProxy::~MemoryCoordinatorProxy() = default; // static MemoryCoordinatorProxy* MemoryCoordinatorProxy::GetInstance() { diff --git a/base/memory/memory_pressure_monitor_chromeos_unittest.cc b/base/memory/memory_pressure_monitor_chromeos_unittest.cc index 23b037cea6e0f7..d203afb0ad9bd8 100644 --- a/base/memory/memory_pressure_monitor_chromeos_unittest.cc +++ b/base/memory/memory_pressure_monitor_chromeos_unittest.cc @@ -52,7 +52,7 @@ class TestMemoryPressureMonitor : public MemoryPressureMonitor { // function. StopObserving(); } - ~TestMemoryPressureMonitor() override {} + ~TestMemoryPressureMonitor() override = default; void SetMemoryInPercentOverride(int percent) { memory_in_percent_override_ = percent; diff --git a/base/memory/ref_counted_memory.cc b/base/memory/ref_counted_memory.cc index 00f2293bb65783..7eaaf03425763f 100644 --- a/base/memory/ref_counted_memory.cc +++ b/base/memory/ref_counted_memory.cc @@ -15,9 +15,9 @@ bool RefCountedMemory::Equals( (memcmp(front(), other->front(), size()) == 0); } -RefCountedMemory::RefCountedMemory() {} +RefCountedMemory::RefCountedMemory() = default; -RefCountedMemory::~RefCountedMemory() {} +RefCountedMemory::~RefCountedMemory() = default; const unsigned char* RefCountedStaticMemory::front() const { return data_; @@ -27,9 +27,9 @@ size_t RefCountedStaticMemory::size() const { return length_; } -RefCountedStaticMemory::~RefCountedStaticMemory() {} +RefCountedStaticMemory::~RefCountedStaticMemory() = default; -RefCountedBytes::RefCountedBytes() {} +RefCountedBytes::RefCountedBytes() = default; RefCountedBytes::RefCountedBytes(const std::vector& initializer) : data_(initializer) { @@ -55,11 +55,11 @@ size_t RefCountedBytes::size() const { return data_.size(); } -RefCountedBytes::~RefCountedBytes() {} +RefCountedBytes::~RefCountedBytes() = default; -RefCountedString::RefCountedString() {} +RefCountedString::RefCountedString() = default; -RefCountedString::~RefCountedString() {} +RefCountedString::~RefCountedString() = default; // static scoped_refptr RefCountedString::TakeString( diff --git a/base/memory/ref_counted_unittest.cc b/base/memory/ref_counted_unittest.cc index afaebdb3c95e93..96f588e66cdced 100644 --- a/base/memory/ref_counted_unittest.cc +++ b/base/memory/ref_counted_unittest.cc @@ -14,7 +14,7 @@ namespace { class SelfAssign : public base::RefCounted { protected: - virtual ~SelfAssign() {} + virtual ~SelfAssign() = default; private: friend class base::RefCounted; @@ -22,7 +22,7 @@ class SelfAssign : public base::RefCounted { class Derived : public SelfAssign { protected: - ~Derived() override {} + ~Derived() override = default; private: friend class base::RefCounted; @@ -112,7 +112,7 @@ class Other : public base::RefCounted { private: friend class base::RefCounted; - ~Other() {} + ~Other() = default; }; class HasPrivateDestructorWithDeleter; @@ -124,11 +124,11 @@ struct Deleter { class HasPrivateDestructorWithDeleter : public base::RefCounted { public: - HasPrivateDestructorWithDeleter() {} + HasPrivateDestructorWithDeleter() = default; private: friend struct Deleter; - ~HasPrivateDestructorWithDeleter() {} + ~HasPrivateDestructorWithDeleter() = default; }; void Deleter::Destruct(const HasPrivateDestructorWithDeleter* x) { @@ -147,11 +147,11 @@ class InitialRefCountIsOne : public base::RefCounted { public: REQUIRE_ADOPTION_FOR_REFCOUNTED_TYPE(); - InitialRefCountIsOne() {} + InitialRefCountIsOne() = default; private: friend class base::RefCounted; - ~InitialRefCountIsOne() {} + ~InitialRefCountIsOne() = default; }; } // end namespace diff --git a/base/memory/shared_memory_posix.cc b/base/memory/shared_memory_posix.cc index bf840e29208769..5b5d002d7bc159 100644 --- a/base/memory/shared_memory_posix.cc +++ b/base/memory/shared_memory_posix.cc @@ -33,7 +33,7 @@ namespace base { -SharedMemory::SharedMemory() {} +SharedMemory::SharedMemory() = default; SharedMemory::SharedMemory(const SharedMemoryHandle& handle, bool read_only) : shm_(handle), read_only_(read_only) {} diff --git a/base/memory/shared_memory_unittest.cc b/base/memory/shared_memory_unittest.cc index ceafb992db9135..7567eb42282f2b 100644 --- a/base/memory/shared_memory_unittest.cc +++ b/base/memory/shared_memory_unittest.cc @@ -55,7 +55,7 @@ namespace { class MultipleThreadMain : public PlatformThread::Delegate { public: explicit MultipleThreadMain(int16_t id) : id_(id) {} - ~MultipleThreadMain() override {} + ~MultipleThreadMain() override = default; static void CleanUp() { SharedMemory memory; diff --git a/base/memory/singleton_unittest.cc b/base/memory/singleton_unittest.cc index 1a4d901c131fc4..50b862d3eb0d9c 100644 --- a/base/memory/singleton_unittest.cc +++ b/base/memory/singleton_unittest.cc @@ -19,8 +19,8 @@ typedef void (*CallbackFunc)(); template class AlignedData { public: - AlignedData() {} - ~AlignedData() {} + AlignedData() = default; + ~AlignedData() = default; alignas(alignment) char data_[alignment]; }; @@ -123,8 +123,8 @@ struct CallbackSingletonWithStaticTrait::Trait template class AlignedTestSingleton { public: - AlignedTestSingleton() {} - ~AlignedTestSingleton() {} + AlignedTestSingleton() = default; + ~AlignedTestSingleton() = default; static AlignedTestSingleton* GetInstance() { return Singleton>::get(); @@ -162,7 +162,7 @@ CallbackFunc* GetStaticSingleton() { class SingletonTest : public testing::Test { public: - SingletonTest() {} + SingletonTest() = default; void SetUp() override { non_leak_called_ = false; diff --git a/base/memory/weak_ptr.cc b/base/memory/weak_ptr.cc index 2130d67897d8c8..1c3208f6433b18 100644 --- a/base/memory/weak_ptr.cc +++ b/base/memory/weak_ptr.cc @@ -28,17 +28,14 @@ bool WeakReference::Flag::IsValid() const { return is_valid_; } -WeakReference::Flag::~Flag() { -} +WeakReference::Flag::~Flag() = default; -WeakReference::WeakReference() { -} +WeakReference::WeakReference() = default; WeakReference::WeakReference(const Flag* flag) : flag_(flag) { } -WeakReference::~WeakReference() { -} +WeakReference::~WeakReference() = default; WeakReference::WeakReference(WeakReference&& other) = default; @@ -46,8 +43,7 @@ WeakReference::WeakReference(const WeakReference& other) = default; bool WeakReference::is_valid() const { return flag_.get() && flag_->IsValid(); } -WeakReferenceOwner::WeakReferenceOwner() { -} +WeakReferenceOwner::WeakReferenceOwner() = default; WeakReferenceOwner::~WeakReferenceOwner() { Invalidate(); @@ -70,7 +66,7 @@ void WeakReferenceOwner::Invalidate() { WeakPtrBase::WeakPtrBase() : ptr_(0) {} -WeakPtrBase::~WeakPtrBase() {} +WeakPtrBase::~WeakPtrBase() = default; WeakPtrBase::WeakPtrBase(const WeakReference& ref, uintptr_t ptr) : ref_(ref), ptr_(ptr) {} diff --git a/base/memory/weak_ptr_unittest.cc b/base/memory/weak_ptr_unittest.cc index 93c41053cfc11f..f8dfb7c0f0d1b1 100644 --- a/base/memory/weak_ptr_unittest.cc +++ b/base/memory/weak_ptr_unittest.cc @@ -51,7 +51,7 @@ struct Derived : public Base {}; struct TargetBase {}; struct Target : public TargetBase, public SupportsWeakPtr { - virtual ~Target() {} + virtual ~Target() = default; }; struct DerivedTarget : public Target {}; @@ -64,7 +64,7 @@ struct DerivedTargetWithNestedBase : public Target { // A struct with a virtual destructor. struct VirtualDestructor { - virtual ~VirtualDestructor() {} + virtual ~VirtualDestructor() = default; }; // A class inheriting from Target where Target is not the first base, and where diff --git a/base/message_loop/message_loop.cc b/base/message_loop/message_loop.cc index 9cddbe89ecd6ef..2c8899bf05e7d8 100644 --- a/base/message_loop/message_loop.cc +++ b/base/message_loop/message_loop.cc @@ -71,14 +71,11 @@ std::unique_ptr ReturnPump(std::unique_ptr pump) { //------------------------------------------------------------------------------ -MessageLoop::TaskObserver::TaskObserver() { -} +MessageLoop::TaskObserver::TaskObserver() = default; -MessageLoop::TaskObserver::~TaskObserver() { -} +MessageLoop::TaskObserver::~TaskObserver() = default; -MessageLoop::DestructionObserver::~DestructionObserver() { -} +MessageLoop::DestructionObserver::~DestructionObserver() = default; //------------------------------------------------------------------------------ diff --git a/base/message_loop/message_loop_io_posix_unittest.cc b/base/message_loop/message_loop_io_posix_unittest.cc index 5038bea7f8a4e5..f98d4668d3a629 100644 --- a/base/message_loop/message_loop_io_posix_unittest.cc +++ b/base/message_loop/message_loop_io_posix_unittest.cc @@ -25,7 +25,7 @@ namespace { class MessageLoopForIoPosixTest : public testing::Test { public: - MessageLoopForIoPosixTest() {} + MessageLoopForIoPosixTest() = default; // testing::Test interface. void SetUp() override { diff --git a/base/message_loop/message_loop_task_runner.cc b/base/message_loop/message_loop_task_runner.cc index 5d41986d99582c..f251e3b8b243dc 100644 --- a/base/message_loop/message_loop_task_runner.cc +++ b/base/message_loop/message_loop_task_runner.cc @@ -46,8 +46,7 @@ bool MessageLoopTaskRunner::RunsTasksInCurrentSequence() const { return valid_thread_id_ == PlatformThread::CurrentId(); } -MessageLoopTaskRunner::~MessageLoopTaskRunner() { -} +MessageLoopTaskRunner::~MessageLoopTaskRunner() = default; } // namespace internal diff --git a/base/message_loop/message_loop_unittest.cc b/base/message_loop/message_loop_unittest.cc index 742436edde6b51..39953cc5f851e9 100644 --- a/base/message_loop/message_loop_unittest.cc +++ b/base/message_loop/message_loop_unittest.cc @@ -86,7 +86,7 @@ class Foo : public RefCounted { private: friend class RefCounted; - ~Foo() {} + ~Foo() = default; int test_count_; std::string result_; @@ -202,7 +202,7 @@ class DummyTaskObserver : public MessageLoop::TaskObserver { num_tasks_processed_(0), num_tasks_(num_tasks) {} - ~DummyTaskObserver() override {} + ~DummyTaskObserver() override = default; void WillProcessTask(const PendingTask& pending_task) override { num_tasks_started_++; diff --git a/base/message_loop/message_pump.cc b/base/message_loop/message_pump.cc index 3d85b9b5643d0d..907617624a212f 100644 --- a/base/message_loop/message_pump.cc +++ b/base/message_loop/message_pump.cc @@ -6,11 +6,9 @@ namespace base { -MessagePump::MessagePump() { -} +MessagePump::MessagePump() = default; -MessagePump::~MessagePump() { -} +MessagePump::~MessagePump() = default; void MessagePump::SetTimerSlack(TimerSlack) { } diff --git a/base/message_loop/message_pump_default.cc b/base/message_loop/message_pump_default.cc index 50dbc6f7183b66..dba0f5ba4e2b0d 100644 --- a/base/message_loop/message_pump_default.cc +++ b/base/message_loop/message_pump_default.cc @@ -24,7 +24,7 @@ MessagePumpDefault::MessagePumpDefault() event_(WaitableEvent::ResetPolicy::AUTOMATIC, WaitableEvent::InitialState::NOT_SIGNALED) {} -MessagePumpDefault::~MessagePumpDefault() {} +MessagePumpDefault::~MessagePumpDefault() = default; void MessagePumpDefault::Run(Delegate* delegate) { AutoReset auto_reset_keep_running(&keep_running_, true); diff --git a/base/message_loop/message_pump_libevent_unittest.cc b/base/message_loop/message_pump_libevent_unittest.cc index c0282a1276d5cf..da7c06ef820ab2 100644 --- a/base/message_loop/message_pump_libevent_unittest.cc +++ b/base/message_loop/message_pump_libevent_unittest.cc @@ -33,7 +33,7 @@ class MessagePumpLibeventTest : public testing::Test { MessagePumpLibeventTest() : ui_loop_(new MessageLoop(MessageLoop::TYPE_UI)), io_thread_("MessagePumpLibeventTestIOThread") {} - ~MessagePumpLibeventTest() override {} + ~MessagePumpLibeventTest() override = default; void SetUp() override { Thread::Options options(MessageLoop::TYPE_IO, 0); @@ -77,7 +77,7 @@ namespace { // nothing useful. class StupidWatcher : public MessagePumpLibevent::Watcher { public: - ~StupidWatcher() override {} + ~StupidWatcher() override = default; // base:MessagePumpLibevent::Watcher interface void OnFileCanReadWithoutBlocking(int fd) override {} @@ -111,7 +111,7 @@ class BaseWatcher : public MessagePumpLibevent::Watcher { : controller_(controller) { DCHECK(controller_); } - ~BaseWatcher() override {} + ~BaseWatcher() override = default; // base:MessagePumpLibevent::Watcher interface void OnFileCanReadWithoutBlocking(int /* fd */) override { NOTREACHED(); } @@ -155,7 +155,7 @@ class StopWatcher : public BaseWatcher { MessagePumpLibevent::FileDescriptorWatcher* controller) : BaseWatcher(controller) {} - ~StopWatcher() override {} + ~StopWatcher() override = default; void OnFileCanWriteWithoutBlocking(int /* fd */) override { controller_->StopWatchingFileDescriptor(); @@ -183,8 +183,8 @@ void QuitMessageLoopAndStart(const Closure& quit_closure) { class NestedPumpWatcher : public MessagePumpLibevent::Watcher { public: - NestedPumpWatcher() {} - ~NestedPumpWatcher() override {} + NestedPumpWatcher() = default; + ~NestedPumpWatcher() override = default; void OnFileCanReadWithoutBlocking(int /* fd */) override { RunLoop runloop; diff --git a/base/message_loop/message_pump_perftest.cc b/base/message_loop/message_pump_perftest.cc index 4b45341d58d74c..90680f070413bc 100644 --- a/base/message_loop/message_pump_perftest.cc +++ b/base/message_loop/message_pump_perftest.cc @@ -240,8 +240,8 @@ TEST_F(ScheduleWorkTest, ThreadTimeToJavaFromFourThreads) { class FakeMessagePump : public MessagePump { public: - FakeMessagePump() {} - ~FakeMessagePump() override {} + FakeMessagePump() = default; + ~FakeMessagePump() override = default; void Run(Delegate* delegate) override {} diff --git a/base/metrics/bucket_ranges.cc b/base/metrics/bucket_ranges.cc index f995d7c43ebbb9..040439399627ba 100644 --- a/base/metrics/bucket_ranges.cc +++ b/base/metrics/bucket_ranges.cc @@ -107,7 +107,7 @@ BucketRanges::BucketRanges(size_t num_ranges) : ranges_(num_ranges, 0), checksum_(0) {} -BucketRanges::~BucketRanges() {} +BucketRanges::~BucketRanges() = default; uint32_t BucketRanges::CalculateChecksum() const { // Seed checksum. diff --git a/base/metrics/field_trial.cc b/base/metrics/field_trial.cc index 221253fd4bcbf1..72f25a9013e610 100644 --- a/base/metrics/field_trial.cc +++ b/base/metrics/field_trial.cc @@ -243,14 +243,13 @@ int FieldTrialList::kNoExpirationYear = 0; //------------------------------------------------------------------------------ // FieldTrial methods and members. -FieldTrial::EntropyProvider::~EntropyProvider() { -} +FieldTrial::EntropyProvider::~EntropyProvider() = default; -FieldTrial::State::State() {} +FieldTrial::State::State() = default; FieldTrial::State::State(const State& other) = default; -FieldTrial::State::~State() {} +FieldTrial::State::~State() = default; bool FieldTrial::FieldTrialEntry::GetTrialAndGroupName( StringPiece* trial_name, @@ -413,7 +412,7 @@ FieldTrial::FieldTrial(const std::string& trial_name, << "Trial " << trial_name << " is missing a default group name."; } -FieldTrial::~FieldTrial() {} +FieldTrial::~FieldTrial() = default; void FieldTrial::SetTrialRegistered() { DCHECK_EQ(kNotFinalized, group_); @@ -486,8 +485,7 @@ FieldTrialList* FieldTrialList::global_ = nullptr; // static bool FieldTrialList::used_without_global_ = false; -FieldTrialList::Observer::~Observer() { -} +FieldTrialList::Observer::~Observer() = default; FieldTrialList::FieldTrialList( std::unique_ptr entropy_provider) diff --git a/base/metrics/field_trial_param_associator.cc b/base/metrics/field_trial_param_associator.cc index 9c93f344cfab0d..af76eafaca447d 100644 --- a/base/metrics/field_trial_param_associator.cc +++ b/base/metrics/field_trial_param_associator.cc @@ -8,8 +8,8 @@ namespace base { -FieldTrialParamAssociator::FieldTrialParamAssociator() {} -FieldTrialParamAssociator::~FieldTrialParamAssociator() {} +FieldTrialParamAssociator::FieldTrialParamAssociator() = default; +FieldTrialParamAssociator::~FieldTrialParamAssociator() = default; // static FieldTrialParamAssociator* FieldTrialParamAssociator::GetInstance() { diff --git a/base/metrics/histogram.cc b/base/metrics/histogram.cc index 2941190b6f4185..40e7bcc860a65e 100644 --- a/base/metrics/histogram.cc +++ b/base/metrics/histogram.cc @@ -622,8 +622,7 @@ Histogram::Histogram(const char* name, unlogged_samples_->id(), ranges, logged_meta, logged_counts)); } -Histogram::~Histogram() { -} +Histogram::~Histogram() = default; bool Histogram::PrintEmptyBucket(uint32_t index) const { return true; @@ -878,7 +877,7 @@ class LinearHistogram::Factory : public Histogram::Factory { DISALLOW_COPY_AND_ASSIGN(Factory); }; -LinearHistogram::~LinearHistogram() {} +LinearHistogram::~LinearHistogram() = default; HistogramBase* LinearHistogram::FactoryGet(const std::string& name, Sample minimum, diff --git a/base/metrics/histogram_base.cc b/base/metrics/histogram_base.cc index e0a5047e08bbb3..da3a8c62e7ac39 100644 --- a/base/metrics/histogram_base.cc +++ b/base/metrics/histogram_base.cc @@ -69,7 +69,7 @@ const HistogramBase::Sample HistogramBase::kSampleType_MAX = INT_MAX; HistogramBase::HistogramBase(const char* name) : histogram_name_(name), flags_(kNoFlags) {} -HistogramBase::~HistogramBase() {} +HistogramBase::~HistogramBase() = default; void HistogramBase::CheckName(const StringPiece& name) const { DCHECK_EQ(StringPiece(histogram_name()), name); diff --git a/base/metrics/histogram_base_unittest.cc b/base/metrics/histogram_base_unittest.cc index 38948577972d54..5850c6776a86a6 100644 --- a/base/metrics/histogram_base_unittest.cc +++ b/base/metrics/histogram_base_unittest.cc @@ -21,8 +21,7 @@ class HistogramBaseTest : public testing::Test { ResetStatisticsRecorder(); } - ~HistogramBaseTest() override { - } + ~HistogramBaseTest() override = default; void ResetStatisticsRecorder() { // It is necessary to fully destruct any existing StatisticsRecorder diff --git a/base/metrics/histogram_delta_serialization.cc b/base/metrics/histogram_delta_serialization.cc index b0b9d724116701..a74b87f0d0eb36 100644 --- a/base/metrics/histogram_delta_serialization.cc +++ b/base/metrics/histogram_delta_serialization.cc @@ -37,8 +37,7 @@ HistogramDeltaSerialization::HistogramDeltaSerialization( const std::string& caller_name) : histogram_snapshot_manager_(this), serialized_deltas_(nullptr) {} -HistogramDeltaSerialization::~HistogramDeltaSerialization() { -} +HistogramDeltaSerialization::~HistogramDeltaSerialization() = default; void HistogramDeltaSerialization::PrepareAndSerializeDeltas( std::vector* serialized_deltas, diff --git a/base/metrics/histogram_samples.cc b/base/metrics/histogram_samples.cc index 10243bbc9cc04d..7703580538fbf2 100644 --- a/base/metrics/histogram_samples.cc +++ b/base/metrics/histogram_samples.cc @@ -186,7 +186,7 @@ HistogramSamples::HistogramSamples(uint64_t id, Metadata* meta) // This mustn't do anything with |meta_|. It was passed to the ctor and may // be invalid by the time this dtor gets called. -HistogramSamples::~HistogramSamples() {} +HistogramSamples::~HistogramSamples() = default; void HistogramSamples::Add(const HistogramSamples& other) { IncreaseSumAndCount(other.sum(), other.redundant_count()); @@ -262,7 +262,7 @@ void HistogramSamples::RecordNegativeSample(NegativeSampleReason reason, static_cast(id())); } -SampleCountIterator::~SampleCountIterator() {} +SampleCountIterator::~SampleCountIterator() = default; bool SampleCountIterator::GetBucketIndex(size_t* index) const { DCHECK(!Done()); @@ -280,7 +280,7 @@ SingleSampleIterator::SingleSampleIterator(HistogramBase::Sample min, size_t bucket_index) : min_(min), max_(max), bucket_index_(bucket_index), count_(count) {} -SingleSampleIterator::~SingleSampleIterator() {} +SingleSampleIterator::~SingleSampleIterator() = default; bool SingleSampleIterator::Done() const { return count_ == 0; diff --git a/base/metrics/histogram_snapshot_manager.cc b/base/metrics/histogram_snapshot_manager.cc index 432511a2f52512..7b3cff8b4d8d73 100644 --- a/base/metrics/histogram_snapshot_manager.cc +++ b/base/metrics/histogram_snapshot_manager.cc @@ -41,8 +41,7 @@ HistogramSnapshotManager::HistogramSnapshotManager( is_active_.store(false, std::memory_order_relaxed); } -HistogramSnapshotManager::~HistogramSnapshotManager() { -} +HistogramSnapshotManager::~HistogramSnapshotManager() = default; void HistogramSnapshotManager::PrepareDelta(HistogramBase* histogram) { if (!histogram->ValidateHistogramContents(true, 0)) diff --git a/base/metrics/histogram_snapshot_manager_unittest.cc b/base/metrics/histogram_snapshot_manager_unittest.cc index ca95eaa684a90e..1e2c599ec6bf92 100644 --- a/base/metrics/histogram_snapshot_manager_unittest.cc +++ b/base/metrics/histogram_snapshot_manager_unittest.cc @@ -19,7 +19,7 @@ namespace base { class HistogramFlattenerDeltaRecorder : public HistogramFlattener { public: - HistogramFlattenerDeltaRecorder() {} + HistogramFlattenerDeltaRecorder() = default; void RecordDelta(const HistogramBase& histogram, const HistogramSamples& snapshot) override { @@ -59,7 +59,7 @@ class HistogramSnapshotManagerTest : public testing::Test { : statistics_recorder_(StatisticsRecorder::CreateTemporaryForTesting()), histogram_snapshot_manager_(&histogram_flattener_delta_recorder_) {} - ~HistogramSnapshotManagerTest() override {} + ~HistogramSnapshotManagerTest() override = default; std::unique_ptr statistics_recorder_; HistogramFlattenerDeltaRecorder histogram_flattener_delta_recorder_; diff --git a/base/metrics/persistent_histogram_allocator.cc b/base/metrics/persistent_histogram_allocator.cc index 1d908fae0b0b57..79a903eb183017 100644 --- a/base/metrics/persistent_histogram_allocator.cc +++ b/base/metrics/persistent_histogram_allocator.cc @@ -106,7 +106,8 @@ PersistentSparseHistogramDataManager::PersistentSparseHistogramDataManager( PersistentMemoryAllocator* allocator) : allocator_(allocator), record_iterator_(allocator) {} -PersistentSparseHistogramDataManager::~PersistentSparseHistogramDataManager() {} +PersistentSparseHistogramDataManager::~PersistentSparseHistogramDataManager() = + default; PersistentSampleMapRecords* PersistentSparseHistogramDataManager::UseSampleMapRecords(uint64_t id, @@ -189,7 +190,7 @@ PersistentSampleMapRecords::PersistentSampleMapRecords( uint64_t sample_map_id) : data_manager_(data_manager), sample_map_id_(sample_map_id) {} -PersistentSampleMapRecords::~PersistentSampleMapRecords() {} +PersistentSampleMapRecords::~PersistentSampleMapRecords() = default; PersistentSampleMapRecords* PersistentSampleMapRecords::Acquire( const void* user) { @@ -276,7 +277,7 @@ PersistentHistogramAllocator::PersistentHistogramAllocator( : memory_allocator_(std::move(memory)), sparse_histogram_data_manager_(memory_allocator_.get()) {} -PersistentHistogramAllocator::~PersistentHistogramAllocator() {} +PersistentHistogramAllocator::~PersistentHistogramAllocator() = default; std::unique_ptr PersistentHistogramAllocator::GetHistogram( Reference ref) { @@ -747,7 +748,7 @@ void PersistentHistogramAllocator::RecordCreateHistogramResult( result_histogram->Add(result); } -GlobalHistogramAllocator::~GlobalHistogramAllocator() {} +GlobalHistogramAllocator::~GlobalHistogramAllocator() = default; // static void GlobalHistogramAllocator::CreateWithPersistentMemory( diff --git a/base/metrics/persistent_memory_allocator.cc b/base/metrics/persistent_memory_allocator.cc index e49ea478658a4e..be107c39474bf9 100644 --- a/base/metrics/persistent_memory_allocator.cc +++ b/base/metrics/persistent_memory_allocator.cc @@ -1029,7 +1029,7 @@ SharedPersistentMemoryAllocator::SharedPersistentMemoryAllocator( read_only), shared_memory_(std::move(memory)) {} -SharedPersistentMemoryAllocator::~SharedPersistentMemoryAllocator() {} +SharedPersistentMemoryAllocator::~SharedPersistentMemoryAllocator() = default; // static bool SharedPersistentMemoryAllocator::IsSharedMemoryAcceptable( @@ -1056,7 +1056,7 @@ FilePersistentMemoryAllocator::FilePersistentMemoryAllocator( read_only), mapped_file_(std::move(file)) {} -FilePersistentMemoryAllocator::~FilePersistentMemoryAllocator() {} +FilePersistentMemoryAllocator::~FilePersistentMemoryAllocator() = default; // static bool FilePersistentMemoryAllocator::IsFileAcceptable( @@ -1159,7 +1159,7 @@ DelayedPersistentAllocation::DelayedPersistentAllocation( DCHECK(reference_); } -DelayedPersistentAllocation::~DelayedPersistentAllocation() {} +DelayedPersistentAllocation::~DelayedPersistentAllocation() = default; void* DelayedPersistentAllocation::Get() const { // Relaxed operations are acceptable here because it's not protecting the diff --git a/base/metrics/persistent_sample_map.cc b/base/metrics/persistent_sample_map.cc index 817702fd1227c8..f38b9d1f601743 100644 --- a/base/metrics/persistent_sample_map.cc +++ b/base/metrics/persistent_sample_map.cc @@ -50,7 +50,7 @@ PersistentSampleMapIterator::PersistentSampleMapIterator( SkipEmptyBuckets(); } -PersistentSampleMapIterator::~PersistentSampleMapIterator() {} +PersistentSampleMapIterator::~PersistentSampleMapIterator() = default; bool PersistentSampleMapIterator::Done() const { return iter_ == end_; diff --git a/base/metrics/sample_map.cc b/base/metrics/sample_map.cc index 08fe032057702d..c6dce2932126e0 100644 --- a/base/metrics/sample_map.cc +++ b/base/metrics/sample_map.cc @@ -47,7 +47,7 @@ SampleMapIterator::SampleMapIterator(const SampleToCountMap& sample_counts) SkipEmptyBuckets(); } -SampleMapIterator::~SampleMapIterator() {} +SampleMapIterator::~SampleMapIterator() = default; bool SampleMapIterator::Done() const { return iter_ == end_; diff --git a/base/metrics/sample_vector.cc b/base/metrics/sample_vector.cc index 749b2d8f292fc4..cf8634e8367993 100644 --- a/base/metrics/sample_vector.cc +++ b/base/metrics/sample_vector.cc @@ -30,7 +30,7 @@ SampleVectorBase::SampleVectorBase(uint64_t id, CHECK_GE(bucket_ranges_->bucket_count(), 1u); } -SampleVectorBase::~SampleVectorBase() {} +SampleVectorBase::~SampleVectorBase() = default; void SampleVectorBase::Accumulate(Sample value, Count count) { const size_t bucket_index = GetBucketIndex(value); @@ -327,7 +327,7 @@ PersistentSampleVector::PersistentSampleVector( } } -PersistentSampleVector::~PersistentSampleVector() {} +PersistentSampleVector::~PersistentSampleVector() = default; bool PersistentSampleVector::MountExistingCountsStorage() const { // There is no early exit if counts is not yet mounted because, given that @@ -384,7 +384,7 @@ SampleVectorIterator::SampleVectorIterator( SkipEmptyBuckets(); } -SampleVectorIterator::~SampleVectorIterator() {} +SampleVectorIterator::~SampleVectorIterator() = default; bool SampleVectorIterator::Done() const { return index_ >= counts_size_; diff --git a/base/metrics/single_sample_metrics_unittest.cc b/base/metrics/single_sample_metrics_unittest.cc index e3c1cf0e2bebe9..c1a8b96b5c5706 100644 --- a/base/metrics/single_sample_metrics_unittest.cc +++ b/base/metrics/single_sample_metrics_unittest.cc @@ -20,7 +20,7 @@ const char kMetricName[] = "Single.Sample.Metric"; class SingleSampleMetricsTest : public testing::Test { public: - SingleSampleMetricsTest() {} + SingleSampleMetricsTest() = default; ~SingleSampleMetricsTest() override { // Ensure we cleanup after ourselves. diff --git a/base/metrics/sparse_histogram.cc b/base/metrics/sparse_histogram.cc index 35a2b59221a124..e33fd3c88f24da 100644 --- a/base/metrics/sparse_histogram.cc +++ b/base/metrics/sparse_histogram.cc @@ -78,7 +78,7 @@ std::unique_ptr SparseHistogram::PersistentCreate( new SparseHistogram(allocator, name, meta, logged_meta)); } -SparseHistogram::~SparseHistogram() {} +SparseHistogram::~SparseHistogram() = default; uint64_t SparseHistogram::name_hash() const { return unlogged_samples_->id(); diff --git a/base/metrics/statistics_recorder_unittest.cc b/base/metrics/statistics_recorder_unittest.cc index f0bb50cae61e20..be9c114cb395ef 100644 --- a/base/metrics/statistics_recorder_unittest.cc +++ b/base/metrics/statistics_recorder_unittest.cc @@ -42,7 +42,7 @@ class LogStateSaver { // Test implementation of RecordHistogramChecker interface. class OddRecordHistogramChecker : public base::RecordHistogramChecker { public: - ~OddRecordHistogramChecker() override {} + ~OddRecordHistogramChecker() override = default; // base::RecordHistogramChecker: bool ShouldRecord(uint64_t histogram_hash) const override { diff --git a/base/observer_list_unittest.cc b/base/observer_list_unittest.cc index fa6ab7831662bc..fd88a2d5e8aa24 100644 --- a/base/observer_list_unittest.cc +++ b/base/observer_list_unittest.cc @@ -31,14 +31,14 @@ namespace { class Foo { public: virtual void Observe(int x) = 0; - virtual ~Foo() {} + virtual ~Foo() = default; virtual int GetValue() const { return 0; } }; class Adder : public Foo { public: explicit Adder(int scaler) : total(0), scaler_(scaler) {} - ~Adder() override {} + ~Adder() override = default; void Observe(int x) override { total += x * scaler_; } int GetValue() const override { return total; } @@ -58,7 +58,7 @@ class Disrupter : public Foo { Disrupter(ObserverList* list, bool remove_self) : Disrupter(list, nullptr, remove_self) {} - ~Disrupter() override {} + ~Disrupter() override = default; void Observe(int x) override { if (remove_self_) @@ -116,7 +116,7 @@ class AddRemoveThread : public PlatformThread::Delegate, ready_(ready), weak_factory_(this) {} - ~AddRemoveThread() override {} + ~AddRemoveThread() override = default; void ThreadMain() override { loop_ = new MessageLoop(); // Fire up a message loop. @@ -528,7 +528,7 @@ TEST(ObserverListThreadSafeTest, WithoutSequence) { class FooRemover : public Foo { public: explicit FooRemover(ObserverListThreadSafe* list) : list_(list) {} - ~FooRemover() override {} + ~FooRemover() override = default; void AddFooToRemove(Foo* foo) { foos_.push_back(foo); @@ -875,7 +875,7 @@ TEST(ObserverListTest, ClearNotifyExistingOnly) { class ListDestructor : public Foo { public: explicit ListDestructor(ObserverList* list) : list_(list) {} - ~ListDestructor() override {} + ~ListDestructor() override = default; void Observe(int x) override { delete list_; } diff --git a/base/pending_task.cc b/base/pending_task.cc index 64dc1da56f3c11..31f2d2d9beb764 100644 --- a/base/pending_task.cc +++ b/base/pending_task.cc @@ -33,8 +33,7 @@ PendingTask::PendingTask(const Location& posted_from, PendingTask::PendingTask(PendingTask&& other) = default; -PendingTask::~PendingTask() { -} +PendingTask::~PendingTask() = default; PendingTask& PendingTask::operator=(PendingTask&& other) = default; diff --git a/base/pickle.cc b/base/pickle.cc index cfd4c7a9e14554..c2189c8fb573a2 100644 --- a/base/pickle.cc +++ b/base/pickle.cc @@ -207,9 +207,9 @@ bool PickleIterator::ReadBytes(const char** data, int length) { return true; } -Pickle::Attachment::Attachment() {} +Pickle::Attachment::Attachment() = default; -Pickle::Attachment::~Attachment() {} +Pickle::Attachment::~Attachment() = default; // Payload is uint32_t aligned. diff --git a/base/pickle_unittest.cc b/base/pickle_unittest.cc index faf88cfc586340..6c302572e4deb1 100644 --- a/base/pickle_unittest.cc +++ b/base/pickle_unittest.cc @@ -529,7 +529,7 @@ namespace { // Publicly exposes the ClaimBytes interface for testing. class TestingPickle : public Pickle { public: - TestingPickle() {} + TestingPickle() = default; void* ClaimBytes(size_t num_bytes) { return Pickle::ClaimBytes(num_bytes); } }; diff --git a/base/posix/global_descriptors.cc b/base/posix/global_descriptors.cc index 9cc75531bc7229..738d14e3ad543f 100644 --- a/base/posix/global_descriptors.cc +++ b/base/posix/global_descriptors.cc @@ -94,8 +94,8 @@ void GlobalDescriptors::Reset(const Mapping& mapping) { descriptors_ = mapping; } -GlobalDescriptors::GlobalDescriptors() {} +GlobalDescriptors::GlobalDescriptors() = default; -GlobalDescriptors::~GlobalDescriptors() {} +GlobalDescriptors::~GlobalDescriptors() = default; } // namespace base diff --git a/base/power_monitor/power_monitor_source.cc b/base/power_monitor/power_monitor_source.cc index 5d27a0e5a07b05..d4757b0629f252 100644 --- a/base/power_monitor/power_monitor_source.cc +++ b/base/power_monitor/power_monitor_source.cc @@ -9,8 +9,8 @@ namespace base { -PowerMonitorSource::PowerMonitorSource() {} -PowerMonitorSource::~PowerMonitorSource() {} +PowerMonitorSource::PowerMonitorSource() = default; +PowerMonitorSource::~PowerMonitorSource() = default; bool PowerMonitorSource::IsOnBatteryPower() { AutoLock auto_lock(battery_lock_); diff --git a/base/power_monitor/power_monitor_unittest.cc b/base/power_monitor/power_monitor_unittest.cc index f1c2459874095c..7f2a84b774b4cc 100644 --- a/base/power_monitor/power_monitor_unittest.cc +++ b/base/power_monitor/power_monitor_unittest.cc @@ -17,7 +17,7 @@ class PowerMonitorTest : public testing::Test { power_monitor_.reset(new PowerMonitor( std::unique_ptr(power_monitor_source_))); } - ~PowerMonitorTest() override {} + ~PowerMonitorTest() override = default; PowerMonitorTestSource* source() { return power_monitor_source_; } PowerMonitor* monitor() { return power_monitor_.get(); } diff --git a/base/process/process_iterator.cc b/base/process/process_iterator.cc index 920c8d0c076e56..013017f75b57e5 100644 --- a/base/process/process_iterator.cc +++ b/base/process/process_iterator.cc @@ -10,7 +10,7 @@ namespace base { #if defined(OS_POSIX) ProcessEntry::ProcessEntry() : pid_(0), ppid_(0), gid_(0) {} ProcessEntry::ProcessEntry(const ProcessEntry& other) = default; -ProcessEntry::~ProcessEntry() {} +ProcessEntry::~ProcessEntry() = default; #endif const ProcessEntry* ProcessIterator::NextProcessEntry() { @@ -52,8 +52,7 @@ NamedProcessIterator::NamedProcessIterator( #endif } -NamedProcessIterator::~NamedProcessIterator() { -} +NamedProcessIterator::~NamedProcessIterator() = default; int GetProcessCount(const FilePath::StringType& executable_name, const ProcessFilter* filter) { diff --git a/base/process/process_metrics_posix.cc b/base/process/process_metrics_posix.cc index 0eb5c1f97b0d8c..73a52d6210d37e 100644 --- a/base/process/process_metrics_posix.cc +++ b/base/process/process_metrics_posix.cc @@ -29,7 +29,7 @@ int64_t TimeValToMicroseconds(const struct timeval& tv) { return ret; } -ProcessMetrics::~ProcessMetrics() { } +ProcessMetrics::~ProcessMetrics() = default; #if defined(OS_LINUX) static const rlim_t kSystemDefaultMaxFds = 8192; diff --git a/base/process/process_metrics_unittest.cc b/base/process/process_metrics_unittest.cc index be08bb985d22da..fdf9c96a909c8f 100644 --- a/base/process/process_metrics_unittest.cc +++ b/base/process/process_metrics_unittest.cc @@ -51,7 +51,7 @@ void BusyWork(std::vector* vec) { // Exists as a class so it can be a friend of SystemMetrics. class SystemMetricsTest : public testing::Test { public: - SystemMetricsTest() {} + SystemMetricsTest() = default; private: DISALLOW_COPY_AND_ASSIGN(SystemMetricsTest); diff --git a/base/process/process_posix.cc b/base/process/process_posix.cc index a7772b7af74d22..2481e26ba16c60 100644 --- a/base/process/process_posix.cc +++ b/base/process/process_posix.cc @@ -225,8 +225,7 @@ namespace base { Process::Process(ProcessHandle handle) : process_(handle) { } -Process::~Process() { -} +Process::~Process() = default; Process::Process(Process&& other) : process_(other.process_) { other.Close(); diff --git a/base/process/process_util_unittest.cc b/base/process/process_util_unittest.cc index f6f3a8382a4023..43f2898801fe5e 100644 --- a/base/process/process_util_unittest.cc +++ b/base/process/process_util_unittest.cc @@ -1038,7 +1038,7 @@ MULTIPROCESS_TEST_MAIN(process_util_test_die_immediately) { class ReadFromPipeDelegate : public base::LaunchOptions::PreExecDelegate { public: explicit ReadFromPipeDelegate(int fd) : fd_(fd) {} - ~ReadFromPipeDelegate() override {} + ~ReadFromPipeDelegate() override = default; void RunAsyncSafe() override { char c; RAW_CHECK(HANDLE_EINTR(read(fd_, &c, 1)) == 1); diff --git a/base/profiler/native_stack_sampler.cc b/base/profiler/native_stack_sampler.cc index 6fa9cfa235721b..6eed54f0468bbd 100644 --- a/base/profiler/native_stack_sampler.cc +++ b/base/profiler/native_stack_sampler.cc @@ -13,11 +13,11 @@ NativeStackSampler::StackBuffer::StackBuffer(size_t buffer_size) sizeof(uintptr_t)]), size_(buffer_size) {} -NativeStackSampler::StackBuffer::~StackBuffer() {} +NativeStackSampler::StackBuffer::~StackBuffer() = default; -NativeStackSampler::NativeStackSampler() {} +NativeStackSampler::NativeStackSampler() = default; -NativeStackSampler::~NativeStackSampler() {} +NativeStackSampler::~NativeStackSampler() = default; std::unique_ptr NativeStackSampler::CreateStackBuffer() { @@ -27,8 +27,8 @@ NativeStackSampler::CreateStackBuffer() { return std::make_unique(size); } -NativeStackSamplerTestDelegate::~NativeStackSamplerTestDelegate() {} +NativeStackSamplerTestDelegate::~NativeStackSamplerTestDelegate() = default; -NativeStackSamplerTestDelegate::NativeStackSamplerTestDelegate() {} +NativeStackSamplerTestDelegate::NativeStackSamplerTestDelegate() = default; } // namespace base diff --git a/base/profiler/stack_sampling_profiler.cc b/base/profiler/stack_sampling_profiler.cc index bacde018b1494d..35e60581e0e8ae 100644 --- a/base/profiler/stack_sampling_profiler.cc +++ b/base/profiler/stack_sampling_profiler.cc @@ -59,7 +59,7 @@ StackSamplingProfiler::Module::Module(uintptr_t base_address, const FilePath& filename) : base_address(base_address), id(id), filename(filename) {} -StackSamplingProfiler::Module::~Module() {} +StackSamplingProfiler::Module::~Module() = default; // StackSamplingProfiler::Frame ----------------------------------------------- @@ -67,7 +67,7 @@ StackSamplingProfiler::Frame::Frame(uintptr_t instruction_pointer, size_t module_index) : instruction_pointer(instruction_pointer), module_index(module_index) {} -StackSamplingProfiler::Frame::~Frame() {} +StackSamplingProfiler::Frame::~Frame() = default; StackSamplingProfiler::Frame::Frame() : instruction_pointer(0), module_index(kUnknownModuleIndex) { @@ -75,11 +75,11 @@ StackSamplingProfiler::Frame::Frame() // StackSamplingProfiler::Sample ---------------------------------------------- -StackSamplingProfiler::Sample::Sample() {} +StackSamplingProfiler::Sample::Sample() = default; StackSamplingProfiler::Sample::Sample(const Sample& sample) = default; -StackSamplingProfiler::Sample::~Sample() {} +StackSamplingProfiler::Sample::~Sample() = default; StackSamplingProfiler::Sample::Sample(const Frame& frame) { frames.push_back(std::move(frame)); @@ -90,12 +90,12 @@ StackSamplingProfiler::Sample::Sample(const std::vector& frames) // StackSamplingProfiler::CallStackProfile ------------------------------------ -StackSamplingProfiler::CallStackProfile::CallStackProfile() {} +StackSamplingProfiler::CallStackProfile::CallStackProfile() = default; StackSamplingProfiler::CallStackProfile::CallStackProfile( CallStackProfile&& other) = default; -StackSamplingProfiler::CallStackProfile::~CallStackProfile() {} +StackSamplingProfiler::CallStackProfile::~CallStackProfile() = default; StackSamplingProfiler::CallStackProfile& StackSamplingProfiler::CallStackProfile::operator=(CallStackProfile&& other) = @@ -151,7 +151,7 @@ class StackSamplingProfiler::SamplingThread : public Thread { callback(callback), finished(finished), native_sampler(std::move(sampler)) {} - ~CollectionContext() {} + ~CollectionContext() = default; // An identifier for the profiler associated with this collection, used to // uniquely identify the collection to outside interests. diff --git a/base/profiler/stack_sampling_profiler_unittest.cc b/base/profiler/stack_sampling_profiler_unittest.cc index 94c3d341f1e8ab..94b8a6e8b1eddf 100644 --- a/base/profiler/stack_sampling_profiler_unittest.cc +++ b/base/profiler/stack_sampling_profiler_unittest.cc @@ -863,7 +863,7 @@ PROFILER_TEST_F(StackSamplingProfilerTest, StopSafely) { // Test delegate that counts samples. class SampleRecordedCounter : public NativeStackSamplerTestDelegate { public: - SampleRecordedCounter() {} + SampleRecordedCounter() = default; void OnPreStackWalk() override { AutoLock lock(lock_); diff --git a/base/sequenced_task_runner.cc b/base/sequenced_task_runner.cc index 4f36dc4decab6b..86771c67b5a8ac 100644 --- a/base/sequenced_task_runner.cc +++ b/base/sequenced_task_runner.cc @@ -28,8 +28,7 @@ OnTaskRunnerDeleter::OnTaskRunnerDeleter( : task_runner_(std::move(task_runner)) { } -OnTaskRunnerDeleter::~OnTaskRunnerDeleter() { -} +OnTaskRunnerDeleter::~OnTaskRunnerDeleter() = default; OnTaskRunnerDeleter::OnTaskRunnerDeleter(OnTaskRunnerDeleter&&) = default; diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc index d538567fdb139f..2112f2309f7511 100644 --- a/base/strings/string_util.cc +++ b/base/strings/string_util.cc @@ -36,7 +36,7 @@ namespace { // prevents other code that might accidentally use Singleton from // getting our internal one. struct EmptyStrings { - EmptyStrings() {} + EmptyStrings() = default; const std::string s; const string16 s16; diff --git a/base/sync_socket_posix.cc b/base/sync_socket_posix.cc index cc44e58a965ffd..ff1e0e6caa3329 100644 --- a/base/sync_socket_posix.cc +++ b/base/sync_socket_posix.cc @@ -212,7 +212,7 @@ SyncSocket::Handle SyncSocket::Release() { return r; } -CancelableSyncSocket::CancelableSyncSocket() {} +CancelableSyncSocket::CancelableSyncSocket() = default; CancelableSyncSocket::CancelableSyncSocket(Handle handle) : SyncSocket(handle) { } diff --git a/base/sync_socket_unittest.cc b/base/sync_socket_unittest.cc index 202aa2c764a79f..fdcd9a1cc678fa 100644 --- a/base/sync_socket_unittest.cc +++ b/base/sync_socket_unittest.cc @@ -30,7 +30,7 @@ class HangingReceiveThread : public DelegateSimpleThread::Delegate { thread_.Start(); } - ~HangingReceiveThread() override {} + ~HangingReceiveThread() override = default; void Run() override { int data = 0; diff --git a/base/synchronization/waitable_event_watcher_posix.cc b/base/synchronization/waitable_event_watcher_posix.cc index 80f142d4ec6029..21368a8710441a 100644 --- a/base/synchronization/waitable_event_watcher_posix.cc +++ b/base/synchronization/waitable_event_watcher_posix.cc @@ -46,7 +46,7 @@ class Flag : public RefCountedThreadSafe { private: friend class RefCountedThreadSafe; - ~Flag() {} + ~Flag() = default; mutable Lock lock_; bool flag_; diff --git a/base/task_runner.cc b/base/task_runner.cc index bbba7028503a0c..aae9f9ec4f3bb7 100644 --- a/base/task_runner.cc +++ b/base/task_runner.cc @@ -51,9 +51,9 @@ bool TaskRunner::PostTaskAndReply(const Location& from_here, from_here, std::move(task), std::move(reply)); } -TaskRunner::TaskRunner() {} +TaskRunner::TaskRunner() = default; -TaskRunner::~TaskRunner() {} +TaskRunner::~TaskRunner() = default; void TaskRunner::OnDestruct() const { delete this; diff --git a/base/test/fuzzed_data_provider.cc b/base/test/fuzzed_data_provider.cc index 14ffb12a648f08..b2d443a9b98b15 100644 --- a/base/test/fuzzed_data_provider.cc +++ b/base/test/fuzzed_data_provider.cc @@ -14,7 +14,7 @@ namespace base { FuzzedDataProvider::FuzzedDataProvider(const uint8_t* data, size_t size) : remaining_data_(reinterpret_cast(data), size) {} -FuzzedDataProvider::~FuzzedDataProvider() {} +FuzzedDataProvider::~FuzzedDataProvider() = default; std::string FuzzedDataProvider::ConsumeBytes(size_t num_bytes) { num_bytes = std::min(num_bytes, remaining_data_.length()); diff --git a/base/test/gtest_util.cc b/base/test/gtest_util.cc index 1552c1a2500a50..e5d38f44ae8a30 100644 --- a/base/test/gtest_util.cc +++ b/base/test/gtest_util.cc @@ -16,8 +16,7 @@ namespace base { -TestIdentifier::TestIdentifier() { -} +TestIdentifier::TestIdentifier() = default; TestIdentifier::TestIdentifier(const TestIdentifier& other) = default; diff --git a/base/test/histogram_tester.cc b/base/test/histogram_tester.cc index 485f30f0eec1d2..64b4ca2e00f741 100644 --- a/base/test/histogram_tester.cc +++ b/base/test/histogram_tester.cc @@ -29,8 +29,7 @@ HistogramTester::HistogramTester() { } } -HistogramTester::~HistogramTester() { -} +HistogramTester::~HistogramTester() = default; void HistogramTester::ExpectUniqueSample( const std::string& name, diff --git a/base/test/launcher/test_launcher.cc b/base/test/launcher/test_launcher.cc index 36ad6f4b9a2d8a..52055e57cf0b03 100644 --- a/base/test/launcher/test_launcher.cc +++ b/base/test/launcher/test_launcher.cc @@ -493,7 +493,7 @@ const char kGTestRepeatFlag[] = "gtest_repeat"; const char kGTestRunDisabledTestsFlag[] = "gtest_also_run_disabled_tests"; const char kGTestOutputFlag[] = "gtest_output"; -TestLauncherDelegate::~TestLauncherDelegate() {} +TestLauncherDelegate::~TestLauncherDelegate() = default; TestLauncher::LaunchOptions::LaunchOptions() = default; TestLauncher::LaunchOptions::LaunchOptions(const LaunchOptions& other) = @@ -521,7 +521,7 @@ TestLauncher::TestLauncher(TestLauncherDelegate* launcher_delegate, &TestLauncher::OnOutputTimeout), parallel_jobs_(parallel_jobs) {} -TestLauncher::~TestLauncher() {} +TestLauncher::~TestLauncher() = default; bool TestLauncher::Run() { if (!Init()) diff --git a/base/test/launcher/test_launcher_nacl_nonsfi.cc b/base/test/launcher/test_launcher_nacl_nonsfi.cc index d456ba26c72435..2199e5a994222b 100644 --- a/base/test/launcher/test_launcher_nacl_nonsfi.cc +++ b/base/test/launcher/test_launcher_nacl_nonsfi.cc @@ -66,8 +66,7 @@ void PrintUsage() { class NonSfiUnitTestPlatformDelegate : public base::UnitTestPlatformDelegate { public: - NonSfiUnitTestPlatformDelegate() { - } + NonSfiUnitTestPlatformDelegate() = default; bool Init(const std::string& test_binary) { base::FilePath dir_exe; diff --git a/base/test/launcher/test_launcher_tracer.cc b/base/test/launcher/test_launcher_tracer.cc index 4ffa8de3ec6aa7..d525df75235ba5 100644 --- a/base/test/launcher/test_launcher_tracer.cc +++ b/base/test/launcher/test_launcher_tracer.cc @@ -13,7 +13,7 @@ namespace base { TestLauncherTracer::TestLauncherTracer() : trace_start_time_(TimeTicks::Now()) {} -TestLauncherTracer::~TestLauncherTracer() {} +TestLauncherTracer::~TestLauncherTracer() = default; void TestLauncherTracer::RecordProcessExecution(TimeTicks start_time, TimeDelta duration) { diff --git a/base/test/launcher/test_result.cc b/base/test/launcher/test_result.cc index ce4776ab2aab49..9f37a2b96dac71 100644 --- a/base/test/launcher/test_result.cc +++ b/base/test/launcher/test_result.cc @@ -49,8 +49,7 @@ std::string TestResultPart::TypeAsString() const { TestResult::TestResult() : status(TEST_UNKNOWN) { } -TestResult::~TestResult() { -} +TestResult::~TestResult() = default; TestResult::TestResult(const TestResult& other) = default; TestResult::TestResult(TestResult&& other) = default; diff --git a/base/test/launcher/test_results_tracker.cc b/base/test/launcher/test_results_tracker.cc index 36d907584a1188..16587a1ec95c0f 100644 --- a/base/test/launcher/test_results_tracker.cc +++ b/base/test/launcher/test_results_tracker.cc @@ -494,23 +494,18 @@ void TestResultsTracker::PrintTests(InputIterator first, fflush(stdout); } - -TestResultsTracker::AggregateTestResult::AggregateTestResult() { -} +TestResultsTracker::AggregateTestResult::AggregateTestResult() = default; TestResultsTracker::AggregateTestResult::AggregateTestResult( const AggregateTestResult& other) = default; -TestResultsTracker::AggregateTestResult::~AggregateTestResult() { -} +TestResultsTracker::AggregateTestResult::~AggregateTestResult() = default; -TestResultsTracker::PerIterationData::PerIterationData() { -} +TestResultsTracker::PerIterationData::PerIterationData() = default; TestResultsTracker::PerIterationData::PerIterationData( const PerIterationData& other) = default; -TestResultsTracker::PerIterationData::~PerIterationData() { -} +TestResultsTracker::PerIterationData::~PerIterationData() = default; } // namespace base diff --git a/base/test/launcher/unit_test_launcher.cc b/base/test/launcher/unit_test_launcher.cc index 02cd424b56039c..17be5293aea6f4 100644 --- a/base/test/launcher/unit_test_launcher.cc +++ b/base/test/launcher/unit_test_launcher.cc @@ -112,8 +112,7 @@ void PrintUsage() { class DefaultUnitTestPlatformDelegate : public UnitTestPlatformDelegate { public: - DefaultUnitTestPlatformDelegate() { - } + DefaultUnitTestPlatformDelegate() = default; private: // UnitTestPlatformDelegate: diff --git a/base/test/mock_devices_changed_observer.cc b/base/test/mock_devices_changed_observer.cc index c05f26a61382dd..9fc57cd93e7dd8 100644 --- a/base/test/mock_devices_changed_observer.cc +++ b/base/test/mock_devices_changed_observer.cc @@ -6,10 +6,8 @@ namespace base { -MockDevicesChangedObserver::MockDevicesChangedObserver() { -} +MockDevicesChangedObserver::MockDevicesChangedObserver() = default; -MockDevicesChangedObserver::~MockDevicesChangedObserver() { -} +MockDevicesChangedObserver::~MockDevicesChangedObserver() = default; } // namespace base diff --git a/base/test/mock_entropy_provider.cc b/base/test/mock_entropy_provider.cc index 5ebf19a7c737a7..f3fd2a481ea606 100644 --- a/base/test/mock_entropy_provider.cc +++ b/base/test/mock_entropy_provider.cc @@ -9,7 +9,7 @@ namespace base { MockEntropyProvider::MockEntropyProvider() : entropy_value_(0.5) {} MockEntropyProvider::MockEntropyProvider(double entropy_value) : entropy_value_(entropy_value) {} -MockEntropyProvider::~MockEntropyProvider() {} +MockEntropyProvider::~MockEntropyProvider() = default; double MockEntropyProvider::GetEntropyForTrial( const std::string& trial_name, diff --git a/base/test/multiprocess_test.cc b/base/test/multiprocess_test.cc index 68f7604d84076e..46556f7573205e 100644 --- a/base/test/multiprocess_test.cc +++ b/base/test/multiprocess_test.cc @@ -50,8 +50,7 @@ CommandLine GetMultiProcessTestChildBaseCommandLine() { // MultiProcessTest ------------------------------------------------------------ -MultiProcessTest::MultiProcessTest() { -} +MultiProcessTest::MultiProcessTest() = default; Process MultiProcessTest::SpawnChild(const std::string& procname) { LaunchOptions options; diff --git a/base/test/null_task_runner.cc b/base/test/null_task_runner.cc index 44a41a16c06591..dfa26fa313cbf0 100644 --- a/base/test/null_task_runner.cc +++ b/base/test/null_task_runner.cc @@ -6,9 +6,9 @@ namespace base { -NullTaskRunner::NullTaskRunner() {} +NullTaskRunner::NullTaskRunner() = default; -NullTaskRunner::~NullTaskRunner() {} +NullTaskRunner::~NullTaskRunner() = default; bool NullTaskRunner::PostDelayedTask(const Location& from_here, OnceClosure task, diff --git a/base/test/power_monitor_test_base.cc b/base/test/power_monitor_test_base.cc index 9eba8746780515..f662b53580c40a 100644 --- a/base/test/power_monitor_test_base.cc +++ b/base/test/power_monitor_test_base.cc @@ -17,8 +17,7 @@ PowerMonitorTestSource::PowerMonitorTestSource() << "PowerMonitorTestSource requires a MessageLoop."; } -PowerMonitorTestSource::~PowerMonitorTestSource() { -} +PowerMonitorTestSource::~PowerMonitorTestSource() = default; void PowerMonitorTestSource::GeneratePowerStateEvent(bool on_battery_power) { test_on_battery_power_ = on_battery_power; @@ -47,8 +46,7 @@ PowerMonitorTestObserver::PowerMonitorTestObserver() resumes_(0) { } -PowerMonitorTestObserver::~PowerMonitorTestObserver() { -} +PowerMonitorTestObserver::~PowerMonitorTestObserver() = default; // PowerObserver callbacks. void PowerMonitorTestObserver::OnPowerStateChange(bool on_battery_power) { diff --git a/base/test/scoped_feature_list.cc b/base/test/scoped_feature_list.cc index 170500df041fee..bd3e3a440906f1 100644 --- a/base/test/scoped_feature_list.cc +++ b/base/test/scoped_feature_list.cc @@ -81,7 +81,7 @@ void OverrideFeatures(const std::string& features, } // namespace -ScopedFeatureList::ScopedFeatureList() {} +ScopedFeatureList::ScopedFeatureList() = default; ScopedFeatureList::~ScopedFeatureList() { if (field_trial_override_) diff --git a/base/test/sequenced_task_runner_test_template.cc b/base/test/sequenced_task_runner_test_template.cc index 0022aac36eed6b..de6849230e9ebc 100644 --- a/base/test/sequenced_task_runner_test_template.cc +++ b/base/test/sequenced_task_runner_test_template.cc @@ -99,8 +99,7 @@ void SequencedTaskTracker::WaitForCompletedTasks(int count) { task_end_cv_.Wait(); } -SequencedTaskTracker::~SequencedTaskTracker() { -} +SequencedTaskTracker::~SequencedTaskTracker() = default; void PrintTo(const TaskEvent& event, std::ostream* os) { *os << "(i=" << event.i << ", type="; diff --git a/base/test/simple_test_clock.cc b/base/test/simple_test_clock.cc index a2bdc2ac3d87d8..cf95065f37619c 100644 --- a/base/test/simple_test_clock.cc +++ b/base/test/simple_test_clock.cc @@ -6,9 +6,9 @@ namespace base { -SimpleTestClock::SimpleTestClock() {} +SimpleTestClock::SimpleTestClock() = default; -SimpleTestClock::~SimpleTestClock() {} +SimpleTestClock::~SimpleTestClock() = default; Time SimpleTestClock::Now() { AutoLock lock(lock_); diff --git a/base/test/simple_test_tick_clock.cc b/base/test/simple_test_tick_clock.cc index c6375bd6be6f75..d454646d72b26d 100644 --- a/base/test/simple_test_tick_clock.cc +++ b/base/test/simple_test_tick_clock.cc @@ -8,9 +8,9 @@ namespace base { -SimpleTestTickClock::SimpleTestTickClock() {} +SimpleTestTickClock::SimpleTestTickClock() = default; -SimpleTestTickClock::~SimpleTestTickClock() {} +SimpleTestTickClock::~SimpleTestTickClock() = default; TimeTicks SimpleTestTickClock::NowTicks() { AutoLock lock(lock_); diff --git a/base/test/task_runner_test_template.cc b/base/test/task_runner_test_template.cc index 5a72d31a048fb7..fe702472c75e7b 100644 --- a/base/test/task_runner_test_template.cc +++ b/base/test/task_runner_test_template.cc @@ -10,7 +10,7 @@ namespace test { TaskTracker::TaskTracker() : task_runs_(0), task_runs_cv_(&lock_) {} -TaskTracker::~TaskTracker() {} +TaskTracker::~TaskTracker() = default; Closure TaskTracker::WrapTask(const Closure& task, int i) { return Bind(&TaskTracker::RunTask, this, task, i); diff --git a/base/test/test_discardable_memory_allocator.cc b/base/test/test_discardable_memory_allocator.cc index 23aac68c753808..37397d8a382970 100644 --- a/base/test/test_discardable_memory_allocator.cc +++ b/base/test/test_discardable_memory_allocator.cc @@ -53,11 +53,9 @@ class DiscardableMemoryImpl : public DiscardableMemory { } // namespace -TestDiscardableMemoryAllocator::TestDiscardableMemoryAllocator() { -} +TestDiscardableMemoryAllocator::TestDiscardableMemoryAllocator() = default; -TestDiscardableMemoryAllocator::~TestDiscardableMemoryAllocator() { -} +TestDiscardableMemoryAllocator::~TestDiscardableMemoryAllocator() = default; std::unique_ptr TestDiscardableMemoryAllocator::AllocateLockedDiscardableMemory(size_t size) { diff --git a/base/test/test_message_loop.cc b/base/test/test_message_loop.cc index 7283a8799294d3..bd3610fe65a193 100644 --- a/base/test/test_message_loop.cc +++ b/base/test/test_message_loop.cc @@ -7,7 +7,7 @@ namespace base { -TestMessageLoop::TestMessageLoop() {} +TestMessageLoop::TestMessageLoop() = default; TestMessageLoop::TestMessageLoop(MessageLoop::Type type) : loop_(type) {} diff --git a/base/test/test_mock_time_task_runner.cc b/base/test/test_mock_time_task_runner.cc index 86cebb0b66a35e..d97e35a92989b2 100644 --- a/base/test/test_mock_time_task_runner.cc +++ b/base/test/test_mock_time_task_runner.cc @@ -162,8 +162,8 @@ TestMockTimeTaskRunner::TestOrderedPendingTask::TestOrderedPendingTask( nestability), ordinal(ordinal) {} -TestMockTimeTaskRunner::TestOrderedPendingTask::~TestOrderedPendingTask() { -} +TestMockTimeTaskRunner::TestOrderedPendingTask::~TestOrderedPendingTask() = + default; TestMockTimeTaskRunner::TestOrderedPendingTask& TestMockTimeTaskRunner::TestOrderedPendingTask::operator=( @@ -203,8 +203,7 @@ TestMockTimeTaskRunner::TestMockTimeTaskRunner(Time start_time, } } -TestMockTimeTaskRunner::~TestMockTimeTaskRunner() { -} +TestMockTimeTaskRunner::~TestMockTimeTaskRunner() = default; void TestMockTimeTaskRunner::FastForwardBy(TimeDelta delta) { DCHECK(thread_checker_.CalledOnValidThread()); diff --git a/base/test/test_pending_task.cc b/base/test/test_pending_task.cc index 999de7eea88e10..f9cfa8e6bb1598 100644 --- a/base/test/test_pending_task.cc +++ b/base/test/test_pending_task.cc @@ -36,7 +36,7 @@ bool TestPendingTask::ShouldRunBefore(const TestPendingTask& other) const { return GetTimeToRun() < other.GetTimeToRun(); } -TestPendingTask::~TestPendingTask() {} +TestPendingTask::~TestPendingTask() = default; void TestPendingTask::AsValueInto(base::trace_event::TracedValue* state) const { state->SetInteger("run_at", GetTimeToRun().ToInternalValue()); diff --git a/base/test/thread_test_helper.cc b/base/test/thread_test_helper.cc index 037de2b484a427..f3ca7807f5449a 100644 --- a/base/test/thread_test_helper.cc +++ b/base/test/thread_test_helper.cc @@ -31,7 +31,7 @@ bool ThreadTestHelper::Run() { void ThreadTestHelper::RunTest() { set_test_result(true); } -ThreadTestHelper::~ThreadTestHelper() {} +ThreadTestHelper::~ThreadTestHelper() = default; void ThreadTestHelper::RunOnSequence() { RunTest(); diff --git a/base/test/trace_event_analyzer.cc b/base/test/trace_event_analyzer.cc index 0431bcce80b9d7..5d6d081b123a01 100644 --- a/base/test/trace_event_analyzer.cc +++ b/base/test/trace_event_analyzer.cc @@ -27,8 +27,7 @@ TraceEvent::TraceEvent() TraceEvent::TraceEvent(TraceEvent&& other) = default; -TraceEvent::~TraceEvent() { -} +TraceEvent::~TraceEvent() = default; TraceEvent& TraceEvent::operator=(TraceEvent&& rhs) = default; @@ -205,8 +204,7 @@ std::unique_ptr TraceEvent::GetKnownArgAsValue( QueryNode::QueryNode(const Query& query) : query_(query) { } -QueryNode::~QueryNode() { -} +QueryNode::~QueryNode() = default; // Query @@ -227,19 +225,9 @@ Query::Query(TraceEventMember member, const std::string& arg_name) is_pattern_(false) { } -Query::Query(const Query& query) - : type_(query.type_), - operator_(query.operator_), - left_(query.left_), - right_(query.right_), - member_(query.member_), - number_(query.number_), - string_(query.string_), - is_pattern_(query.is_pattern_) { -} +Query::Query(const Query& query) = default; -Query::~Query() { -} +Query::~Query() = default; Query Query::String(const std::string& str) { return Query(str); @@ -728,8 +716,7 @@ bool ParseEventsFromJson(const std::string& json, TraceAnalyzer::TraceAnalyzer() : ignore_metadata_events_(false), allow_association_changes_(true) {} -TraceAnalyzer::~TraceAnalyzer() { -} +TraceAnalyzer::~TraceAnalyzer() = default; // static TraceAnalyzer* TraceAnalyzer::Create(const std::string& json_events) { diff --git a/base/threading/sequenced_worker_pool.cc b/base/threading/sequenced_worker_pool.cc index 8dc2b6fa6f00f5..4a2fdfda6b94f0 100644 --- a/base/threading/sequenced_worker_pool.cc +++ b/base/threading/sequenced_worker_pool.cc @@ -80,7 +80,7 @@ struct SequencedTask { sequence_task_number(0), shutdown_behavior(SequencedWorkerPool::BLOCK_SHUTDOWN) {} - ~SequencedTask() {} + ~SequencedTask() = default; SequencedTask(SequencedTask&&) = default; SequencedTask& operator=(SequencedTask&&) = default; @@ -151,8 +151,7 @@ SequencedWorkerPoolTaskRunner::SequencedWorkerPoolTaskRunner( SequencedWorkerPool::WorkerShutdown shutdown_behavior) : pool_(std::move(pool)), shutdown_behavior_(shutdown_behavior) {} -SequencedWorkerPoolTaskRunner::~SequencedWorkerPoolTaskRunner() { -} +SequencedWorkerPoolTaskRunner::~SequencedWorkerPoolTaskRunner() = default; bool SequencedWorkerPoolTaskRunner::PostDelayedTask(const Location& from_here, OnceClosure task, @@ -578,8 +577,7 @@ SequencedWorkerPool::Worker::Worker( Start(); } -SequencedWorkerPool::Worker::~Worker() { -} +SequencedWorkerPool::Worker::~Worker() = default; void SequencedWorkerPool::Worker::Run() { DCHECK_EQ(AllPoolsState::USE_WORKER_POOL, g_all_pools_state); @@ -1474,7 +1472,7 @@ SequencedWorkerPool::SequencedWorkerPool(size_t max_threads, task_priority, observer)) {} -SequencedWorkerPool::~SequencedWorkerPool() {} +SequencedWorkerPool::~SequencedWorkerPool() = default; void SequencedWorkerPool::OnDestruct() const { // Avoid deleting ourselves on a worker thread (which would deadlock). diff --git a/base/threading/sequenced_worker_pool_unittest.cc b/base/threading/sequenced_worker_pool_unittest.cc index 8afd5a18d7a7f9..32ed9126f21de2 100644 --- a/base/threading/sequenced_worker_pool_unittest.cc +++ b/base/threading/sequenced_worker_pool_unittest.cc @@ -210,7 +210,7 @@ class TestTracker : public base::RefCountedThreadSafe { private: friend class base::RefCountedThreadSafe; - ~TestTracker() {} + ~TestTracker() = default; void SignalWorkerDone(int id) { { @@ -1105,9 +1105,9 @@ INSTANTIATE_TEST_CASE_P( class SequencedWorkerPoolTaskRunnerTestDelegate { public: - SequencedWorkerPoolTaskRunnerTestDelegate() {} + SequencedWorkerPoolTaskRunnerTestDelegate() = default; - ~SequencedWorkerPoolTaskRunnerTestDelegate() {} + ~SequencedWorkerPoolTaskRunnerTestDelegate() = default; void StartTaskRunner() { pool_owner_.reset( @@ -1140,10 +1140,9 @@ INSTANTIATE_TYPED_TEST_CASE_P(SequencedWorkerPool, TaskRunnerAffinityTest, class SequencedWorkerPoolTaskRunnerWithShutdownBehaviorTestDelegate { public: - SequencedWorkerPoolTaskRunnerWithShutdownBehaviorTestDelegate() {} + SequencedWorkerPoolTaskRunnerWithShutdownBehaviorTestDelegate() = default; - ~SequencedWorkerPoolTaskRunnerWithShutdownBehaviorTestDelegate() { - } + ~SequencedWorkerPoolTaskRunnerWithShutdownBehaviorTestDelegate() = default; void StartTaskRunner() { pool_owner_.reset( @@ -1180,10 +1179,9 @@ INSTANTIATE_TYPED_TEST_CASE_P( class SequencedWorkerPoolSequencedTaskRunnerTestDelegate { public: - SequencedWorkerPoolSequencedTaskRunnerTestDelegate() {} + SequencedWorkerPoolSequencedTaskRunnerTestDelegate() = default; - ~SequencedWorkerPoolSequencedTaskRunnerTestDelegate() { - } + ~SequencedWorkerPoolSequencedTaskRunnerTestDelegate() = default; void StartTaskRunner() { pool_owner_.reset(new SequencedWorkerPoolOwner( diff --git a/base/threading/simple_thread_unittest.cc b/base/threading/simple_thread_unittest.cc index 0e52500c522d7d..4e618f9c6aafa4 100644 --- a/base/threading/simple_thread_unittest.cc +++ b/base/threading/simple_thread_unittest.cc @@ -19,7 +19,7 @@ namespace { class SetIntRunner : public DelegateSimpleThread::Delegate { public: SetIntRunner(int* ptr, int val) : ptr_(ptr), val_(val) { } - ~SetIntRunner() override {} + ~SetIntRunner() override = default; private: void Run() override { *ptr_ = val_; } @@ -69,7 +69,7 @@ class ControlledRunner : public DelegateSimpleThread::Delegate { class WaitEventRunner : public DelegateSimpleThread::Delegate { public: explicit WaitEventRunner(WaitableEvent* event) : event_(event) { } - ~WaitEventRunner() override {} + ~WaitEventRunner() override = default; private: void Run() override { diff --git a/base/threading/thread_collision_warner_unittest.cc b/base/threading/thread_collision_warner_unittest.cc index 71447efd737ce8..cd56768c61b67d 100644 --- a/base/threading/thread_collision_warner_unittest.cc +++ b/base/threading/thread_collision_warner_unittest.cc @@ -46,7 +46,7 @@ class AssertReporter : public base::AsserterBase { void warn() override { failed_ = true; } - ~AssertReporter() override {} + ~AssertReporter() override = default; bool fail_state() const { return failed_; } void reset() { failed_ = false; } diff --git a/base/threading/thread_id_name_manager.cc b/base/threading/thread_id_name_manager.cc index 03c1eee27824d3..74a42c7d70751a 100644 --- a/base/threading/thread_id_name_manager.cc +++ b/base/threading/thread_id_name_manager.cc @@ -28,8 +28,7 @@ ThreadIdNameManager::ThreadIdNameManager() name_to_interned_name_[kDefaultName] = g_default_name; } -ThreadIdNameManager::~ThreadIdNameManager() { -} +ThreadIdNameManager::~ThreadIdNameManager() = default; ThreadIdNameManager* ThreadIdNameManager::GetInstance() { return Singleton { public: - HasWeakPtr() {} - virtual ~HasWeakPtr() {} + HasWeakPtr() = default; + virtual ~HasWeakPtr() = default; private: DISALLOW_COPY_AND_ASSIGN(HasWeakPtr); diff --git a/base/tools_sanity_unittest.cc b/base/tools_sanity_unittest.cc index af2081d3c92a97..5c41bd74f29ee3 100644 --- a/base/tools_sanity_unittest.cc +++ b/base/tools_sanity_unittest.cc @@ -254,7 +254,7 @@ namespace { class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate { public: explicit TOOLS_SANITY_TEST_CONCURRENT_THREAD(bool *value) : value_(value) {} - ~TOOLS_SANITY_TEST_CONCURRENT_THREAD() override {} + ~TOOLS_SANITY_TEST_CONCURRENT_THREAD() override = default; void ThreadMain() override { *value_ = true; @@ -270,7 +270,7 @@ class TOOLS_SANITY_TEST_CONCURRENT_THREAD : public PlatformThread::Delegate { class ReleaseStoreThread : public PlatformThread::Delegate { public: explicit ReleaseStoreThread(base::subtle::Atomic32 *value) : value_(value) {} - ~ReleaseStoreThread() override {} + ~ReleaseStoreThread() override = default; void ThreadMain() override { base::subtle::Release_Store(value_, kMagicValue); @@ -286,7 +286,7 @@ class ReleaseStoreThread : public PlatformThread::Delegate { class AcquireLoadThread : public PlatformThread::Delegate { public: explicit AcquireLoadThread(base::subtle::Atomic32 *value) : value_(value) {} - ~AcquireLoadThread() override {} + ~AcquireLoadThread() override = default; void ThreadMain() override { // Wait for the other thread to make Release_Store PlatformThread::Sleep(TimeDelta::FromMilliseconds(100)); diff --git a/base/trace_event/event_name_filter.cc b/base/trace_event/event_name_filter.cc index 8d0058c147453d..7bf932e0403c8e 100644 --- a/base/trace_event/event_name_filter.cc +++ b/base/trace_event/event_name_filter.cc @@ -16,7 +16,7 @@ EventNameFilter::EventNameFilter( std::unique_ptr event_names_whitelist) : event_names_whitelist_(std::move(event_names_whitelist)) {} -EventNameFilter::~EventNameFilter() {} +EventNameFilter::~EventNameFilter() = default; bool EventNameFilter::FilterTraceEvent(const TraceEvent& trace_event) const { return event_names_whitelist_->count(trace_event.name()) != 0; diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.cc b/base/trace_event/heap_profiler_allocation_context_tracker.cc index f1fff8b2edcc36..e9466a8a08fa5b 100644 --- a/base/trace_event/heap_profiler_allocation_context_tracker.cc +++ b/base/trace_event/heap_profiler_allocation_context_tracker.cc @@ -87,7 +87,7 @@ AllocationContextTracker::AllocationContextTracker() tracked_stack_.reserve(kMaxStackDepth); task_contexts_.reserve(kMaxTaskDepth); } -AllocationContextTracker::~AllocationContextTracker() {} +AllocationContextTracker::~AllocationContextTracker() = default; // static void AllocationContextTracker::SetCurrentThreadName(const char* name) { diff --git a/base/trace_event/heap_profiler_allocation_register.cc b/base/trace_event/heap_profiler_allocation_register.cc index 22b178803a11c9..44f3442302edc9 100644 --- a/base/trace_event/heap_profiler_allocation_register.cc +++ b/base/trace_event/heap_profiler_allocation_register.cc @@ -91,7 +91,7 @@ AllocationRegister::AllocationRegister(size_t allocation_capacity, DCHECK_EQ(index_and_flag.first, kOutOfStorageBacktraceIndex); } -AllocationRegister::~AllocationRegister() {} +AllocationRegister::~AllocationRegister() = default; bool AllocationRegister::Insert(const void* address, size_t size, diff --git a/base/trace_event/heap_profiler_event_filter.cc b/base/trace_event/heap_profiler_event_filter.cc index 67125ff2909d94..937072ca7b5eb5 100644 --- a/base/trace_event/heap_profiler_event_filter.cc +++ b/base/trace_event/heap_profiler_event_filter.cc @@ -32,8 +32,8 @@ inline AllocationContextTracker* GetThreadLocalTracker() { // static const char HeapProfilerEventFilter::kName[] = "heap_profiler_predicate"; -HeapProfilerEventFilter::HeapProfilerEventFilter() {} -HeapProfilerEventFilter::~HeapProfilerEventFilter() {} +HeapProfilerEventFilter::HeapProfilerEventFilter() = default; +HeapProfilerEventFilter::~HeapProfilerEventFilter() = default; bool HeapProfilerEventFilter::FilterTraceEvent( const TraceEvent& trace_event) const { diff --git a/base/trace_event/heap_profiler_heap_dump_writer.cc b/base/trace_event/heap_profiler_heap_dump_writer.cc index 9f64f6ed2fab0f..71c3d97f544868 100644 --- a/base/trace_event/heap_profiler_heap_dump_writer.cc +++ b/base/trace_event/heap_profiler_heap_dump_writer.cc @@ -186,7 +186,7 @@ HeapDumpWriter::HeapDumpWriter(StackFrameDeduplicator* stack_frame_deduplicator, type_name_deduplicator_(type_name_deduplicator), breakdown_threshold_bytes_(breakdown_threshold_bytes) {} -HeapDumpWriter::~HeapDumpWriter() {} +HeapDumpWriter::~HeapDumpWriter() = default; bool HeapDumpWriter::AddEntryForBucket(const Bucket& bucket) { // The contexts in the bucket are all different, but the [begin, cursor) range diff --git a/base/trace_event/heap_profiler_serialization_state.cc b/base/trace_event/heap_profiler_serialization_state.cc index d332d43c4710cf..b1866e72f1c262 100644 --- a/base/trace_event/heap_profiler_serialization_state.cc +++ b/base/trace_event/heap_profiler_serialization_state.cc @@ -9,7 +9,7 @@ namespace trace_event { HeapProfilerSerializationState::HeapProfilerSerializationState() : heap_profiler_breakdown_threshold_bytes_(0) {} -HeapProfilerSerializationState::~HeapProfilerSerializationState() {} +HeapProfilerSerializationState::~HeapProfilerSerializationState() = default; void HeapProfilerSerializationState::SetStackFrameDeduplicator( std::unique_ptr stack_frame_deduplicator) { diff --git a/base/trace_event/heap_profiler_stack_frame_deduplicator.cc b/base/trace_event/heap_profiler_stack_frame_deduplicator.cc index 351117f14f7688..c05cd0a25e303b 100644 --- a/base/trace_event/heap_profiler_stack_frame_deduplicator.cc +++ b/base/trace_event/heap_profiler_stack_frame_deduplicator.cc @@ -39,14 +39,14 @@ StackFrameDeduplicator::FrameNode::FrameNode(StackFrame frame, int parent_frame_index) : frame(frame), parent_frame_index(parent_frame_index) {} StackFrameDeduplicator::FrameNode::FrameNode(const FrameNode& other) = default; -StackFrameDeduplicator::FrameNode::~FrameNode() {} +StackFrameDeduplicator::FrameNode::~FrameNode() = default; size_t StackFrameDeduplicator::FrameNode::EstimateMemoryUsage() const { return base::trace_event::EstimateMemoryUsage(children); } -StackFrameDeduplicator::StackFrameDeduplicator() {} -StackFrameDeduplicator::~StackFrameDeduplicator() {} +StackFrameDeduplicator::StackFrameDeduplicator() = default; +StackFrameDeduplicator::~StackFrameDeduplicator() = default; bool StackFrameDeduplicator::Match(int frame_index, const StackFrame* begin_frame, diff --git a/base/trace_event/heap_profiler_type_name_deduplicator.cc b/base/trace_event/heap_profiler_type_name_deduplicator.cc index 8fb81a2ef1a3ec..360f239bbd1dae 100644 --- a/base/trace_event/heap_profiler_type_name_deduplicator.cc +++ b/base/trace_event/heap_profiler_type_name_deduplicator.cc @@ -24,7 +24,7 @@ TypeNameDeduplicator::TypeNameDeduplicator() { type_ids_.insert(std::make_pair(nullptr, 0)); } -TypeNameDeduplicator::~TypeNameDeduplicator() {} +TypeNameDeduplicator::~TypeNameDeduplicator() = default; int TypeNameDeduplicator::Insert(const char* type_name) { auto result = type_ids_.insert(std::make_pair(type_name, 0)); diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc index b7fdae8eefa4ac..ffd519133c2ee2 100644 --- a/base/trace_event/malloc_dump_provider.cc +++ b/base/trace_event/malloc_dump_provider.cc @@ -191,7 +191,7 @@ MallocDumpProvider* MallocDumpProvider::GetInstance() { MallocDumpProvider::MallocDumpProvider() : tid_dumping_heap_(kInvalidThreadId) {} -MallocDumpProvider::~MallocDumpProvider() {} +MallocDumpProvider::~MallocDumpProvider() = default; // Called at trace dump point time. Creates a snapshot the memory counters for // the current process. diff --git a/base/trace_event/memory_allocator_dump.cc b/base/trace_event/memory_allocator_dump.cc index 6566cadd14f2ba..5260a734dbd204 100644 --- a/base/trace_event/memory_allocator_dump.cc +++ b/base/trace_event/memory_allocator_dump.cc @@ -41,8 +41,7 @@ MemoryAllocatorDump::MemoryAllocatorDump( DCHECK(absolute_name[0] != '/' && *absolute_name.rbegin() != '/'); } -MemoryAllocatorDump::~MemoryAllocatorDump() { -} +MemoryAllocatorDump::~MemoryAllocatorDump() = default; void MemoryAllocatorDump::AddScalar(const char* name, const char* units, diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc index 3b39806223959f..14fe7e937719da 100644 --- a/base/trace_event/memory_dump_manager.cc +++ b/base/trace_event/memory_dump_manager.cc @@ -930,8 +930,8 @@ MemoryDumpManager::ProcessMemoryDumpAsyncState::ProcessMemoryDumpAsyncState( MakeUnique(heap_profiler_serialization_state, args); } -MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() { -} +MemoryDumpManager::ProcessMemoryDumpAsyncState::~ProcessMemoryDumpAsyncState() = + default; } // namespace trace_event } // namespace base diff --git a/base/trace_event/memory_dump_manager_unittest.cc b/base/trace_event/memory_dump_manager_unittest.cc index e2d4ee13060b5e..22cee6d65ce731 100644 --- a/base/trace_event/memory_dump_manager_unittest.cc +++ b/base/trace_event/memory_dump_manager_unittest.cc @@ -168,7 +168,7 @@ class TestSequencedTaskRunner : public SequencedTaskRunner { } private: - ~TestSequencedTaskRunner() override {} + ~TestSequencedTaskRunner() override = default; SequencedWorkerPoolOwner worker_pool_; const SequencedWorkerPool::SequenceToken token_; diff --git a/base/trace_event/memory_dump_provider_info.cc b/base/trace_event/memory_dump_provider_info.cc index 34784eb5c0ac41..65eeadf6bef5c7 100644 --- a/base/trace_event/memory_dump_provider_info.cc +++ b/base/trace_event/memory_dump_provider_info.cc @@ -27,7 +27,7 @@ MemoryDumpProviderInfo::MemoryDumpProviderInfo( consecutive_failures(0), disabled(false) {} -MemoryDumpProviderInfo::~MemoryDumpProviderInfo() {} +MemoryDumpProviderInfo::~MemoryDumpProviderInfo() = default; bool MemoryDumpProviderInfo::Comparator::operator()( const scoped_refptr& a, diff --git a/base/trace_event/memory_dump_scheduler.cc b/base/trace_event/memory_dump_scheduler.cc index 8e4baaae5d48c8..0332af7569d2c2 100644 --- a/base/trace_event/memory_dump_scheduler.cc +++ b/base/trace_event/memory_dump_scheduler.cc @@ -114,8 +114,8 @@ void MemoryDumpScheduler::Tick(uint32_t expected_generation) { TimeDelta::FromMilliseconds(period_ms_)); } -MemoryDumpScheduler::Config::Config() {} -MemoryDumpScheduler::Config::~Config() {} +MemoryDumpScheduler::Config::Config() = default; +MemoryDumpScheduler::Config::~Config() = default; MemoryDumpScheduler::Config::Config(const MemoryDumpScheduler::Config&) = default; diff --git a/base/trace_event/process_memory_dump.cc b/base/trace_event/process_memory_dump.cc index f315c48ae372ae..3d068afedbdddb 100644 --- a/base/trace_event/process_memory_dump.cc +++ b/base/trace_event/process_memory_dump.cc @@ -198,7 +198,7 @@ ProcessMemoryDump::ProcessMemoryDump( std::move(heap_profiler_serialization_state)), dump_args_(dump_args) {} -ProcessMemoryDump::~ProcessMemoryDump() {} +ProcessMemoryDump::~ProcessMemoryDump() = default; ProcessMemoryDump::ProcessMemoryDump(ProcessMemoryDump&& other) = default; ProcessMemoryDump& ProcessMemoryDump::operator=(ProcessMemoryDump&& other) = default; diff --git a/base/trace_event/trace_buffer.cc b/base/trace_event/trace_buffer.cc index a776fa362edbb1..8de470f0fdd300 100644 --- a/base/trace_event/trace_buffer.cc +++ b/base/trace_event/trace_buffer.cc @@ -246,7 +246,7 @@ class TraceBufferVector : public TraceBuffer { TraceBufferChunk::TraceBufferChunk(uint32_t seq) : next_free_(0), seq_(seq) {} -TraceBufferChunk::~TraceBufferChunk() {} +TraceBufferChunk::~TraceBufferChunk() = default; void TraceBufferChunk::Reset(uint32_t new_seq) { for (size_t i = 0; i < next_free_; ++i) @@ -312,7 +312,7 @@ void TraceResultBuffer::SimpleOutput::Append( TraceResultBuffer::TraceResultBuffer() : append_comma_(false) {} -TraceResultBuffer::~TraceResultBuffer() {} +TraceResultBuffer::~TraceResultBuffer() = default; void TraceResultBuffer::SetOutputCallback( const OutputCallback& json_chunk_callback) { diff --git a/base/trace_event/trace_config.cc b/base/trace_event/trace_config.cc index 38356d8dc00fe4..5926c9541bdc8d 100644 --- a/base/trace_event/trace_config.cc +++ b/base/trace_event/trace_config.cc @@ -57,7 +57,7 @@ class ConvertableTraceConfigToTraceFormat explicit ConvertableTraceConfigToTraceFormat(const TraceConfig& trace_config) : trace_config_(trace_config) {} - ~ConvertableTraceConfigToTraceFormat() override {} + ~ConvertableTraceConfigToTraceFormat() override = default; void AppendAsTraceFormat(std::string* out) const override { out->append(trace_config_.ToString()); @@ -91,12 +91,12 @@ void TraceConfig::ResetMemoryDumpConfig( memory_dump_config_ = memory_dump_config; } -TraceConfig::MemoryDumpConfig::MemoryDumpConfig() {} +TraceConfig::MemoryDumpConfig::MemoryDumpConfig() = default; TraceConfig::MemoryDumpConfig::MemoryDumpConfig( const MemoryDumpConfig& other) = default; -TraceConfig::MemoryDumpConfig::~MemoryDumpConfig() {} +TraceConfig::MemoryDumpConfig::~MemoryDumpConfig() = default; void TraceConfig::MemoryDumpConfig::Clear() { allowed_dump_modes.clear(); @@ -119,7 +119,7 @@ TraceConfig::EventFilterConfig::EventFilterConfig( const std::string& predicate_name) : predicate_name_(predicate_name) {} -TraceConfig::EventFilterConfig::~EventFilterConfig() {} +TraceConfig::EventFilterConfig::~EventFilterConfig() = default; TraceConfig::EventFilterConfig::EventFilterConfig(const EventFilterConfig& tc) { *this = tc; @@ -224,16 +224,9 @@ TraceConfig::TraceConfig(StringPiece config_string) { InitializeDefault(); } -TraceConfig::TraceConfig(const TraceConfig& tc) - : record_mode_(tc.record_mode_), - enable_systrace_(tc.enable_systrace_), - enable_argument_filter_(tc.enable_argument_filter_), - category_filter_(tc.category_filter_), - memory_dump_config_(tc.memory_dump_config_), - event_filters_(tc.event_filters_) {} +TraceConfig::TraceConfig(const TraceConfig& tc) = default; -TraceConfig::~TraceConfig() { -} +TraceConfig::~TraceConfig() = default; TraceConfig& TraceConfig::operator=(const TraceConfig& rhs) { if (this == &rhs) diff --git a/base/trace_event/trace_config_category_filter.cc b/base/trace_event/trace_config_category_filter.cc index de78c04e97fa44..d1884307a949c8 100644 --- a/base/trace_event/trace_config_category_filter.cc +++ b/base/trace_event/trace_config_category_filter.cc @@ -20,23 +20,15 @@ const char kIncludedCategoriesParam[] = "included_categories"; const char kExcludedCategoriesParam[] = "excluded_categories"; } -TraceConfigCategoryFilter::TraceConfigCategoryFilter() {} +TraceConfigCategoryFilter::TraceConfigCategoryFilter() = default; TraceConfigCategoryFilter::TraceConfigCategoryFilter( - const TraceConfigCategoryFilter& other) - : included_categories_(other.included_categories_), - disabled_categories_(other.disabled_categories_), - excluded_categories_(other.excluded_categories_) {} + const TraceConfigCategoryFilter& other) = default; -TraceConfigCategoryFilter::~TraceConfigCategoryFilter() {} +TraceConfigCategoryFilter::~TraceConfigCategoryFilter() = default; TraceConfigCategoryFilter& TraceConfigCategoryFilter::operator=( - const TraceConfigCategoryFilter& rhs) { - included_categories_ = rhs.included_categories_; - disabled_categories_ = rhs.disabled_categories_; - excluded_categories_ = rhs.excluded_categories_; - return *this; -} + const TraceConfigCategoryFilter& rhs) = default; void TraceConfigCategoryFilter::InitializeFromString( const StringPiece& category_filter_string) { diff --git a/base/trace_event/trace_event_filter.cc b/base/trace_event/trace_event_filter.cc index 626529586477d1..d0b116ee044b49 100644 --- a/base/trace_event/trace_event_filter.cc +++ b/base/trace_event/trace_event_filter.cc @@ -7,8 +7,8 @@ namespace base { namespace trace_event { -TraceEventFilter::TraceEventFilter() {} -TraceEventFilter::~TraceEventFilter() {} +TraceEventFilter::TraceEventFilter() = default; +TraceEventFilter::~TraceEventFilter() = default; void TraceEventFilter::EndEvent(const char* category_name, const char* event_name) const {} diff --git a/base/trace_event/trace_event_filter_test_utils.cc b/base/trace_event/trace_event_filter_test_utils.cc index 06548b049a2f1e..85b4cfa2768355 100644 --- a/base/trace_event/trace_event_filter_test_utils.cc +++ b/base/trace_event/trace_event_filter_test_utils.cc @@ -26,8 +26,8 @@ std::unique_ptr TestEventFilter::Factory( return res; } -TestEventFilter::TestEventFilter() {} -TestEventFilter::~TestEventFilter() {} +TestEventFilter::TestEventFilter() = default; +TestEventFilter::~TestEventFilter() = default; bool TestEventFilter::FilterTraceEvent(const TraceEvent& trace_event) const { if (g_hits_counter) diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc index 08654cca3e4850..2b7f98acc51582 100644 --- a/base/trace_event/trace_event_impl.cc +++ b/base/trace_event/trace_event_impl.cc @@ -55,8 +55,7 @@ TraceEvent::TraceEvent() memset(arg_values_, 0, sizeof(arg_values_)); } -TraceEvent::~TraceEvent() { -} +TraceEvent::~TraceEvent() = default; void TraceEvent::MoveFrom(std::unique_ptr other) { timestamp_ = other->timestamp_; diff --git a/base/trace_event/trace_event_memory_overhead.cc b/base/trace_event/trace_event_memory_overhead.cc index bb6edfba7035b1..d5875f8b4f86fd 100644 --- a/base/trace_event/trace_event_memory_overhead.cc +++ b/base/trace_event/trace_event_memory_overhead.cc @@ -58,7 +58,7 @@ const char* ObjectTypeToString(TraceEventMemoryOverhead::ObjectType type) { TraceEventMemoryOverhead::TraceEventMemoryOverhead() : allocated_objects_() {} -TraceEventMemoryOverhead::~TraceEventMemoryOverhead() {} +TraceEventMemoryOverhead::~TraceEventMemoryOverhead() = default; void TraceEventMemoryOverhead::AddInternal(ObjectType object_type, size_t count, diff --git a/base/trace_event/trace_event_system_stats_monitor.cc b/base/trace_event/trace_event_system_stats_monitor.cc index 52e1cdcc3d9f16..7e082f348ecf4c 100644 --- a/base/trace_event/trace_event_system_stats_monitor.cc +++ b/base/trace_event/trace_event_system_stats_monitor.cc @@ -27,8 +27,8 @@ namespace { // Holds profiled system stats until the tracing system needs to serialize it. class SystemStatsHolder : public base::trace_event::ConvertableToTraceFormat { public: - SystemStatsHolder() { } - ~SystemStatsHolder() override {} + SystemStatsHolder() = default; + ~SystemStatsHolder() override = default; // Fills system_metrics_ with profiled system memory and disk stats. // Uses the previous stats to compute rates if this is not the first profile. diff --git a/base/trace_event/trace_event_system_stats_monitor_unittest.cc b/base/trace_event/trace_event_system_stats_monitor_unittest.cc index cf9bdb7c9d46ec..52a05ba9cd05e6 100644 --- a/base/trace_event/trace_event_system_stats_monitor_unittest.cc +++ b/base/trace_event/trace_event_system_stats_monitor_unittest.cc @@ -22,8 +22,8 @@ namespace trace_event { // Exists as a class so it can be a friend of TraceEventSystemStatsMonitor. class TraceSystemStatsMonitorTest : public testing::Test { public: - TraceSystemStatsMonitorTest() {} - ~TraceSystemStatsMonitorTest() override {} + TraceSystemStatsMonitorTest() = default; + ~TraceSystemStatsMonitorTest() override = default; private: DISALLOW_COPY_AND_ASSIGN(TraceSystemStatsMonitorTest); diff --git a/base/trace_event/trace_event_unittest.cc b/base/trace_event/trace_event_unittest.cc index 755dd61ec368d9..625168f64177a0 100644 --- a/base/trace_event/trace_event_unittest.cc +++ b/base/trace_event/trace_event_unittest.cc @@ -1277,8 +1277,8 @@ TEST_F(TraceEventTestFixture, EnabledObserverFiresOnDisable) { class AfterStateChangeEnabledStateObserver : public TraceLog::EnabledStateObserver { public: - AfterStateChangeEnabledStateObserver() {} - ~AfterStateChangeEnabledStateObserver() override {} + AfterStateChangeEnabledStateObserver() = default; + ~AfterStateChangeEnabledStateObserver() override = default; // TraceLog::EnabledStateObserver overrides: void OnTraceLogEnabled() override { @@ -1308,8 +1308,8 @@ TEST_F(TraceEventTestFixture, ObserversFireAfterStateChange) { class SelfRemovingEnabledStateObserver : public TraceLog::EnabledStateObserver { public: - SelfRemovingEnabledStateObserver() {} - ~SelfRemovingEnabledStateObserver() override {} + SelfRemovingEnabledStateObserver() = default; + ~SelfRemovingEnabledStateObserver() override = default; // TraceLog::EnabledStateObserver overrides: void OnTraceLogEnabled() override {} @@ -1406,7 +1406,7 @@ TEST_F(TraceEventTestFixture, AddMetadataEvent) { class Convertable : public ConvertableToTraceFormat { public: explicit Convertable(int* num_calls) : num_calls_(num_calls) {} - ~Convertable() override {} + ~Convertable() override = default; void AppendAsTraceFormat(std::string* out) const override { (*num_calls_)++; out->append("\"metadata_value\""); @@ -2153,8 +2153,8 @@ TEST_F(TraceEventTestFixture, TraceWithDisabledByDefaultCategoryFilters) { class MyData : public ConvertableToTraceFormat { public: - MyData() {} - ~MyData() override {} + MyData() = default; + ~MyData() override = default; void AppendAsTraceFormat(std::string* out) const override { out->append("{\"foo\":1}"); diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc index 509adf66a52e1e..92fccb9360165a 100644 --- a/base/trace_event/trace_log.cc +++ b/base/trace_event/trace_log.cc @@ -327,7 +327,7 @@ void TraceLog::ThreadLocalEventBuffer::FlushWhileLocked() { struct TraceLog::RegisteredAsyncObserver { explicit RegisteredAsyncObserver(WeakPtr observer) : observer(observer), task_runner(ThreadTaskRunnerHandle::Get()) {} - ~RegisteredAsyncObserver() {} + ~RegisteredAsyncObserver() = default; WeakPtr observer; scoped_refptr task_runner; @@ -335,7 +335,7 @@ struct TraceLog::RegisteredAsyncObserver { TraceLogStatus::TraceLogStatus() : event_capacity(0), event_count(0) {} -TraceLogStatus::~TraceLogStatus() {} +TraceLogStatus::~TraceLogStatus() = default; // static TraceLog* TraceLog::GetInstance() { @@ -369,7 +369,7 @@ TraceLog::TraceLog() nullptr); } -TraceLog::~TraceLog() {} +TraceLog::~TraceLog() = default; void TraceLog::InitializeThreadLocalEventBufferIfSupported() { // A ThreadLocalEventBuffer needs the message loop diff --git a/base/trace_event/tracing_agent.cc b/base/trace_event/tracing_agent.cc index 0af90f3c724365..cfbaad9f3b3e62 100644 --- a/base/trace_event/tracing_agent.cc +++ b/base/trace_event/tracing_agent.cc @@ -7,7 +7,7 @@ namespace base { namespace trace_event { -TracingAgent::~TracingAgent() {} +TracingAgent::~TracingAgent() = default; bool TracingAgent::SupportsExplicitClockSync() { return false; diff --git a/base/tuple_unittest.cc b/base/tuple_unittest.cc index 730985c769c2fd..321c549bfcc034 100644 --- a/base/tuple_unittest.cc +++ b/base/tuple_unittest.cc @@ -16,14 +16,14 @@ void DoAdd(int a, int b, int c, int* res) { } struct Addy { - Addy() { } + Addy() = default; void DoAdd(int a, int b, int c, int d, int* res) { *res = a + b + c + d; } }; struct Addz { - Addz() { } + Addz() = default; void DoAdd(int a, int b, int c, int d, int e, int* res) { *res = a + b + c + d + e; } @@ -68,7 +68,7 @@ namespace { struct CopyLogger { CopyLogger() { ++TimesConstructed; } CopyLogger(const CopyLogger& tocopy) { ++TimesConstructed; ++TimesCopied; } - ~CopyLogger() { } + ~CopyLogger() = default; static int TimesCopied; static int TimesConstructed; diff --git a/base/values.cc b/base/values.cc index f3e891f607c834..261d9dc40c69d8 100644 --- a/base/values.cc +++ b/base/values.cc @@ -1113,7 +1113,7 @@ DictionaryValue::Iterator::Iterator(const DictionaryValue& target) DictionaryValue::Iterator::Iterator(const Iterator& other) = default; -DictionaryValue::Iterator::~Iterator() {} +DictionaryValue::Iterator::~Iterator() = default; DictionaryValue* DictionaryValue::DeepCopy() const { return new DictionaryValue(dict_); @@ -1355,11 +1355,9 @@ std::unique_ptr ListValue::CreateDeepCopy() const { return std::make_unique(list_); } -ValueSerializer::~ValueSerializer() { -} +ValueSerializer::~ValueSerializer() = default; -ValueDeserializer::~ValueDeserializer() { -} +ValueDeserializer::~ValueDeserializer() = default; std::ostream& operator<<(std::ostream& out, const Value& value) { std::string json; diff --git a/base/version.cc b/base/version.cc index ca97a842226891..7e897b238aaa15 100644 --- a/base/version.cc +++ b/base/version.cc @@ -77,13 +77,11 @@ int CompareVersionComponents(const std::vector& components1, } // namespace -Version::Version() { -} +Version::Version() = default; Version::Version(const Version& other) = default; -Version::~Version() { -} +Version::~Version() = default; Version::Version(const std::string& version_str) { std::vector parsed; diff --git a/base/vlog.cc b/base/vlog.cc index bf808209045882..fbe18976fa6d89 100644 --- a/base/vlog.cc +++ b/base/vlog.cc @@ -78,7 +78,7 @@ VlogInfo::VlogInfo(const std::string& v_switch, } } -VlogInfo::~VlogInfo() {} +VlogInfo::~VlogInfo() = default; namespace {