diff --git a/minidump/minidump_context_writer.h b/minidump/minidump_context_writer.h index 91e7367..3b50b36 100644 --- a/minidump/minidump_context_writer.h +++ b/minidump/minidump_context_writer.h @@ -41,7 +41,7 @@ class MinidumpContextWriter : public internal::MinidumpWritable { virtual size_t ContextSize() const = 0; // MinidumpWritable: - virtual size_t SizeOfObject() override final; + size_t SizeOfObject() final; private: DISALLOW_COPY_AND_ASSIGN(MinidumpContextWriter); @@ -67,10 +67,10 @@ class MinidumpContextX86Writer final : public MinidumpContextWriter { protected: // MinidumpWritable: - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpContextWriter: - virtual size_t ContextSize() const override; + size_t ContextSize() const override; private: MinidumpContextX86 context_; @@ -98,11 +98,11 @@ class MinidumpContextAMD64Writer final : public MinidumpContextWriter { protected: // MinidumpWritable: - virtual size_t Alignment() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + size_t Alignment() override; + bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpContextWriter: - virtual size_t ContextSize() const override; + size_t ContextSize() const override; private: MinidumpContextAMD64 context_; diff --git a/minidump/minidump_exception_writer.h b/minidump/minidump_exception_writer.h index b18eefa..dc4ad6c 100644 --- a/minidump/minidump_exception_writer.h +++ b/minidump/minidump_exception_writer.h @@ -86,13 +86,13 @@ class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpStreamWriter: - virtual MinidumpStreamType StreamType() const override; + MinidumpStreamType StreamType() const override; private: MINIDUMP_EXCEPTION_STREAM exception_; diff --git a/minidump/minidump_file_writer.h b/minidump/minidump_file_writer.h index bc9753d..2faa35b 100644 --- a/minidump/minidump_file_writer.h +++ b/minidump/minidump_file_writer.h @@ -62,15 +62,15 @@ class MinidumpFileWriter final : public internal::MinidumpWritable { //! rewinds to the beginning of the file and writes the correct value for this //! field. This prevents incompletely-written minidump files from being //! mistaken for valid ones. - virtual bool WriteEverything(FileWriterInterface* file_writer) override; + bool WriteEverything(FileWriterInterface* file_writer) override; protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WillWriteAtOffsetImpl(off_t offset) override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WillWriteAtOffsetImpl(off_t offset) override; + bool WriteObject(FileWriterInterface* file_writer) override; private: MINIDUMP_HEADER header_; diff --git a/minidump/minidump_file_writer_test.cc b/minidump/minidump_file_writer_test.cc index c05e65e..0e92576 100644 --- a/minidump/minidump_file_writer_test.cc +++ b/minidump/minidump_file_writer_test.cc @@ -52,18 +52,18 @@ class TestStream final : public internal::MinidumpStreamWriter { ~TestStream() {} // MinidumpStreamWriter: - virtual MinidumpStreamType StreamType() const override { + MinidumpStreamType StreamType() const override { return stream_type_; } protected: // MinidumpWritable: - virtual size_t SizeOfObject() override { + size_t SizeOfObject() override { EXPECT_GE(state(), kStateFrozen); return stream_data_.size(); } - virtual bool WriteObject(FileWriterInterface* file_writer) override { + bool WriteObject(FileWriterInterface* file_writer) override { EXPECT_EQ(state(), kStateWritable); return file_writer->Write(&stream_data_[0], stream_data_.size()); } diff --git a/minidump/minidump_memory_writer.h b/minidump/minidump_memory_writer.h index 555915b..0f3c509 100644 --- a/minidump/minidump_memory_writer.h +++ b/minidump/minidump_memory_writer.h @@ -75,8 +75,8 @@ class MinidumpMemoryWriter : public internal::MinidumpWritable { virtual size_t MemoryRangeSize() const = 0; // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override final; + bool Freeze() override; + size_t SizeOfObject() final; //! \brief Returns the object’s desired byte-boundary alignment. //! @@ -87,9 +87,9 @@ class MinidumpMemoryWriter : public internal::MinidumpWritable { //! \return `16`. //! //! \note Valid in #kStateFrozen or any subsequent state. - virtual size_t Alignment() override; + size_t Alignment() override; - virtual bool WillWriteAtOffsetImpl(off_t offset) override; + bool WillWriteAtOffsetImpl(off_t offset) override; //! \brief Returns the object’s desired write phase. //! @@ -100,7 +100,7 @@ class MinidumpMemoryWriter : public internal::MinidumpWritable { //! \return #kPhaseLate. //! //! \note Valid in any state. - virtual Phase WritePhase() override final; + Phase WritePhase() final; private: MINIDUMP_MEMORY_DESCRIPTOR memory_descriptor_; @@ -144,13 +144,13 @@ class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpStreamWriter: - virtual MinidumpStreamType StreamType() const override; + MinidumpStreamType StreamType() const override; private: MINIDUMP_MEMORY_LIST memory_list_base_; diff --git a/minidump/minidump_memory_writer_test.cc b/minidump/minidump_memory_writer_test.cc index b13f712..a59edcd 100644 --- a/minidump/minidump_memory_writer_test.cc +++ b/minidump/minidump_memory_writer_test.cc @@ -200,24 +200,24 @@ class TestMemoryStream final : public internal::MinidumpStreamWriter { TestMinidumpMemoryWriter* memory() { return &memory_; } // MinidumpStreamWriter: - virtual MinidumpStreamType StreamType() const override { + MinidumpStreamType StreamType() const override { return kBogusStreamType; } protected: // MinidumpWritable: - virtual size_t SizeOfObject() override { + size_t SizeOfObject() override { EXPECT_GE(state(), kStateFrozen); return 0; } - virtual std::vector Children() override { + std::vector Children() override { EXPECT_GE(state(), kStateFrozen); std::vector children(1, memory()); return children; } - virtual bool WriteObject(FileWriterInterface* file_writer) override { + bool WriteObject(FileWriterInterface* file_writer) override { EXPECT_EQ(kStateWritable, state()); return true; } diff --git a/minidump/minidump_memory_writer_test_util.h b/minidump/minidump_memory_writer_test_util.h index 69b2aeb..5299f68 100644 --- a/minidump/minidump_memory_writer_test_util.h +++ b/minidump/minidump_memory_writer_test_util.h @@ -39,12 +39,12 @@ class TestMinidumpMemoryWriter final : public MinidumpMemoryWriter { protected: // MinidumpMemoryWriter: - virtual uint64_t MemoryRangeBaseAddress() const override; - virtual size_t MemoryRangeSize() const override; + uint64_t MemoryRangeBaseAddress() const override; + size_t MemoryRangeSize() const override; // MinidumpWritable: - virtual bool WillWriteAtOffsetImpl(off_t offset) override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool WillWriteAtOffsetImpl(off_t offset) override; + bool WriteObject(FileWriterInterface* file_writer) override; private: uint64_t base_address_; diff --git a/minidump/minidump_misc_info_writer.h b/minidump/minidump_misc_info_writer.h index f51f38c..f68d1be 100644 --- a/minidump/minidump_misc_info_writer.h +++ b/minidump/minidump_misc_info_writer.h @@ -82,10 +82,10 @@ class MinidumpMiscInfoWriter final : public internal::MinidumpStreamWriter { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; - virtual MinidumpStreamType StreamType() const override; + bool Freeze() override; + size_t SizeOfObject() override; + bool WriteObject(FileWriterInterface* file_writer) override; + MinidumpStreamType StreamType() const override; private: //! \brief Returns the size of the object to be written based on diff --git a/minidump/minidump_module_writer.h b/minidump/minidump_module_writer.h index 401a5bd..a745f16 100644 --- a/minidump/minidump_module_writer.h +++ b/minidump/minidump_module_writer.h @@ -66,8 +66,8 @@ class MinidumpModuleCodeViewRecordPDBLinkWriter virtual ~MinidumpModuleCodeViewRecordPDBLinkWriter(); // MinidumpWritable: - virtual size_t SizeOfObject() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + size_t SizeOfObject() override; + bool WriteObject(FileWriterInterface* file_writer) override; //! \brief Returns a pointer to the raw CodeView record’s data. //! @@ -154,9 +154,9 @@ class MinidumpModuleMiscDebugRecordWriter final protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + bool WriteObject(FileWriterInterface* file_writer) override; private: IMAGE_DEBUG_MISC image_debug_misc_; @@ -273,10 +273,10 @@ class MinidumpModuleWriter final : public internal::MinidumpWritable { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WriteObject(FileWriterInterface* file_writer) override; private: MINIDUMP_MODULE module_; @@ -304,13 +304,13 @@ class MinidumpModuleListWriter final : public internal::MinidumpStreamWriter { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpStreamWriter: - virtual MinidumpStreamType StreamType() const override; + MinidumpStreamType StreamType() const override; private: MINIDUMP_MODULE_LIST module_list_base_; diff --git a/minidump/minidump_stream_writer.h b/minidump/minidump_stream_writer.h index a901aae..6eddbab 100644 --- a/minidump/minidump_stream_writer.h +++ b/minidump/minidump_stream_writer.h @@ -51,7 +51,7 @@ class MinidumpStreamWriter : public MinidumpWritable { ~MinidumpStreamWriter() {} // MinidumpWritable: - virtual bool Freeze() override; + bool Freeze() override; private: MINIDUMP_DIRECTORY directory_list_entry_; diff --git a/minidump/minidump_string_writer.h b/minidump/minidump_string_writer.h index 9f5fceb..237d0d3 100644 --- a/minidump/minidump_string_writer.h +++ b/minidump/minidump_string_writer.h @@ -60,9 +60,9 @@ class MinidumpStringWriter : public MinidumpWritable { typedef typename Traits::MinidumpStringType MinidumpStringType; typedef typename Traits::StringType StringType; - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + bool WriteObject(FileWriterInterface* file_writer) override; //! \brief Sets the string to be written. //! diff --git a/minidump/minidump_system_info_writer.h b/minidump/minidump_system_info_writer.h index eeeb7f5..3d21959 100644 --- a/minidump/minidump_system_info_writer.h +++ b/minidump/minidump_system_info_writer.h @@ -166,13 +166,13 @@ class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpStreamWriter: - virtual MinidumpStreamType StreamType() const override; + MinidumpStreamType StreamType() const override; private: MINIDUMP_SYSTEM_INFO system_info_; diff --git a/minidump/minidump_thread_writer.h b/minidump/minidump_thread_writer.h index db7ce43..92f2215 100644 --- a/minidump/minidump_thread_writer.h +++ b/minidump/minidump_thread_writer.h @@ -107,10 +107,10 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WriteObject(FileWriterInterface* file_writer) override; private: MINIDUMP_THREAD thread_; @@ -164,13 +164,13 @@ class MinidumpThreadListWriter final : public internal::MinidumpStreamWriter { protected: // MinidumpWritable: - virtual bool Freeze() override; - virtual size_t SizeOfObject() override; - virtual std::vector Children() override; - virtual bool WriteObject(FileWriterInterface* file_writer) override; + bool Freeze() override; + size_t SizeOfObject() override; + std::vector Children() override; + bool WriteObject(FileWriterInterface* file_writer) override; // MinidumpStreamWriter: - virtual MinidumpStreamType StreamType() const override; + MinidumpStreamType StreamType() const override; private: MINIDUMP_THREAD_LIST thread_list_base_; diff --git a/minidump/minidump_writable_test.cc b/minidump/minidump_writable_test.cc index 6e345af..00e3257 100644 --- a/minidump/minidump_writable_test.cc +++ b/minidump/minidump_writable_test.cc @@ -60,7 +60,7 @@ class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable { } protected: - virtual bool Freeze() override { + bool Freeze() override { EXPECT_EQ(kStateMutable, state()); bool rv = MinidumpWritable::Freeze(); EXPECT_TRUE(rv); @@ -68,12 +68,12 @@ class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable { return rv; } - virtual size_t Alignment() override { + size_t Alignment() override { EXPECT_GE(state(), kStateFrozen); return has_alignment_ ? alignment_ : MinidumpWritable::Alignment(); } - virtual std::vector Children() override { + std::vector Children() override { EXPECT_GE(state(), kStateFrozen); if (!children_.empty()) { std::vector children; @@ -85,11 +85,11 @@ class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable { return MinidumpWritable::Children(); } - virtual Phase WritePhase() override { + Phase WritePhase() override { return has_phase_ ? phase_ : MinidumpWritable::Phase(); } - virtual bool WillWriteAtOffsetImpl(off_t offset) override { + bool WillWriteAtOffsetImpl(off_t offset) override { EXPECT_EQ(state(), kStateFrozen); expected_offset_ = offset; bool rv = MinidumpWritable::WillWriteAtOffsetImpl(offset); @@ -97,7 +97,7 @@ class BaseTestMinidumpWritable : public crashpad::internal::MinidumpWritable { return rv; } - virtual bool WriteObject(FileWriterInterface* file_writer) override { + bool WriteObject(FileWriterInterface* file_writer) override { EXPECT_EQ(state(), kStateWritable); EXPECT_EQ(expected_offset_, file_writer->Seek(0, SEEK_CUR)); @@ -126,12 +126,12 @@ class TestStringMinidumpWritable final : public BaseTestMinidumpWritable { void SetData(const std::string& string) { data_ = string; } protected: - virtual size_t SizeOfObject() override { + size_t SizeOfObject() override { EXPECT_GE(state(), kStateFrozen); return data_.size(); } - virtual bool WriteObject(FileWriterInterface* file_writer) override { + bool WriteObject(FileWriterInterface* file_writer) override { BaseTestMinidumpWritable::WriteObject(file_writer); bool rv = file_writer->Write(&data_[0], data_.size()); EXPECT_TRUE(rv); @@ -491,12 +491,12 @@ class TestRVAMinidumpWritable final : public BaseTestMinidumpWritable { void SetRVA(MinidumpWritable* other) { other->RegisterRVA(&rva_); } protected: - virtual size_t SizeOfObject() override { + size_t SizeOfObject() override { EXPECT_GE(state(), kStateFrozen); return sizeof(rva_); } - virtual bool WriteObject(FileWriterInterface* file_writer) override { + bool WriteObject(FileWriterInterface* file_writer) override { BaseTestMinidumpWritable::WriteObject(file_writer); EXPECT_TRUE(file_writer->Write(&rva_, sizeof(rva_))); return true; @@ -628,13 +628,13 @@ class TestLocationDescriptorMinidumpWritable final void SetString(const std::string& string) { string_ = string; } protected: - virtual size_t SizeOfObject() override { + size_t SizeOfObject() override { EXPECT_GE(state(), kStateFrozen); // NUL-terminate. return sizeof(location_descriptor_) + string_.size() + 1; } - virtual bool WriteObject(FileWriterInterface* file_writer) override { + bool WriteObject(FileWriterInterface* file_writer) override { BaseTestMinidumpWritable::WriteObject(file_writer); WritableIoVec iov; iov.iov_base = &location_descriptor_; diff --git a/snapshot/exception_snapshot_mac.h b/snapshot/exception_snapshot_mac.h index 7f6fb0b..f0fc8e6 100644 --- a/snapshot/exception_snapshot_mac.h +++ b/snapshot/exception_snapshot_mac.h @@ -60,12 +60,12 @@ class ExceptionSnapshotMac final : public ExceptionSnapshot { // ExceptionSnapshot: - virtual const CPUContext* Context() const override; - virtual uint64_t ThreadID() const override; - virtual uint32_t Exception() const override; - virtual uint32_t ExceptionInfo() const override; - virtual uint64_t ExceptionAddress() const override; - virtual const std::vector& Codes() const override; + const CPUContext* Context() const override; + uint64_t ThreadID() const override; + uint32_t Exception() const override; + uint32_t ExceptionInfo() const override; + uint64_t ExceptionAddress() const override; + const std::vector& Codes() const override; private: #if defined(ARCH_CPU_X86_FAMILY) diff --git a/snapshot/memory_snapshot_mac.h b/snapshot/memory_snapshot_mac.h index 4964a77..6754b42 100644 --- a/snapshot/memory_snapshot_mac.h +++ b/snapshot/memory_snapshot_mac.h @@ -49,9 +49,9 @@ class MemorySnapshotMac final : public MemorySnapshot { // MemorySnapshot: - virtual uint64_t Address() const override; - virtual size_t Size() const override; - virtual bool Read(Delegate* delegate) const override; + uint64_t Address() const override; + size_t Size() const override; + bool Read(Delegate* delegate) const override; private: ProcessReader* process_reader_; // weak diff --git a/snapshot/system_snapshot_mac.h b/snapshot/system_snapshot_mac.h index 104c6da..3eadc37 100644 --- a/snapshot/system_snapshot_mac.h +++ b/snapshot/system_snapshot_mac.h @@ -58,31 +58,28 @@ class SystemSnapshotMac final : public SystemSnapshot { // SystemSnapshot: - virtual CPUArchitecture GetCPUArchitecture() const override; - virtual uint32_t CPURevision() const override; - virtual uint8_t CPUCount() const override; - virtual std::string CPUVendor() const override; - virtual void CPUFrequency(uint64_t* current_hz, - uint64_t* max_hz) const override; - virtual uint32_t CPUX86Signature() const override; - virtual uint64_t CPUX86Features() const override; - virtual uint64_t CPUX86ExtendedFeatures() const override; - virtual uint32_t CPUX86Leaf7Features() const override; - virtual bool CPUX86SupportsDAZ() const override; - virtual OperatingSystem GetOperatingSystem() const override; - virtual bool OSServer() const override; - virtual void OSVersion(int* major, - int* minor, - int* bugfix, - std::string* build) const override; - virtual std::string OSVersionFull() const override; - virtual bool NXEnabled() const override; - virtual std::string MachineDescription() const override; - virtual void TimeZone(DaylightSavingTimeStatus* dst_status, - int* standard_offset_seconds, - int* daylight_offset_seconds, - std::string* standard_name, - std::string* daylight_name) const override; + CPUArchitecture GetCPUArchitecture() const override; + uint32_t CPURevision() const override; + uint8_t CPUCount() const override; + std::string CPUVendor() const override; + void CPUFrequency(uint64_t* current_hz, uint64_t* max_hz) const override; + uint32_t CPUX86Signature() const override; + uint64_t CPUX86Features() const override; + uint64_t CPUX86ExtendedFeatures() const override; + uint32_t CPUX86Leaf7Features() const override; + bool CPUX86SupportsDAZ() const override; + OperatingSystem GetOperatingSystem() const override; + bool OSServer() const override; + void OSVersion( + int* major, int* minor, int* bugfix, std::string* build) const override; + std::string OSVersionFull() const override; + bool NXEnabled() const override; + std::string MachineDescription() const override; + void TimeZone(DaylightSavingTimeStatus* dst_status, + int* standard_offset_seconds, + int* daylight_offset_seconds, + std::string* standard_name, + std::string* daylight_name) const override; private: std::string os_version_full_; diff --git a/snapshot/system_snapshot_mac_test.cc b/snapshot/system_snapshot_mac_test.cc index 3d0c813..f7f1652 100644 --- a/snapshot/system_snapshot_mac_test.cc +++ b/snapshot/system_snapshot_mac_test.cc @@ -48,7 +48,7 @@ class SystemSnapshotMacTest : public testing::Test { } // testing::Test: - virtual void SetUp() override { + void SetUp() override { ASSERT_TRUE(process_reader_.Initialize(mach_task_self())); ASSERT_EQ(0, gettimeofday(&snapshot_time_, nullptr)) << ErrnoMessage("gettimeofday"); diff --git a/snapshot/thread_snapshot_mac.h b/snapshot/thread_snapshot_mac.h index dc6c5b9..b998209 100644 --- a/snapshot/thread_snapshot_mac.h +++ b/snapshot/thread_snapshot_mac.h @@ -53,12 +53,12 @@ class ThreadSnapshotMac final : public ThreadSnapshot { // ThreadSnapshot: - virtual const CPUContext* Context() const override; - virtual const MemorySnapshot* Stack() const override; - virtual uint64_t ThreadID() const override; - virtual int SuspendCount() const override; - virtual int Priority() const override; - virtual uint64_t ThreadSpecificDataAddress() const override; + const CPUContext* Context() const override; + const MemorySnapshot* Stack() const override; + uint64_t ThreadID() const override; + int SuspendCount() const override; + int Priority() const override; + uint64_t ThreadSpecificDataAddress() const override; private: #if defined(ARCH_CPU_X86_FAMILY) diff --git a/util/file/file_writer.h b/util/file/file_writer.h index e454848..54c59c9 100644 --- a/util/file/file_writer.h +++ b/util/file/file_writer.h @@ -105,19 +105,19 @@ class FileWriter : public FileWriterInterface { //! //! \note It is only valid to call this method between a successful Open() and //! a Close(). - virtual bool Write(const void* data, size_t size) override; + bool Write(const void* data, size_t size) override; //! \copydoc FileWriterInterface::WriteIoVec() //! //! \note It is only valid to call this method between a successful Open() and //! a Close(). - virtual bool WriteIoVec(std::vector* iovecs) override; + bool WriteIoVec(std::vector* iovecs) override; //! \copydoc FileWriterInterface::Seek() //! //! \note It is only valid to call this method between a successful Open() and //! a Close(). - virtual off_t Seek(off_t offset, int whence) override; + off_t Seek(off_t offset, int whence) override; private: base::ScopedFD fd_; diff --git a/util/file/string_file_writer.h b/util/file/string_file_writer.h index 4b4002b..fa1e7de 100644 --- a/util/file/string_file_writer.h +++ b/util/file/string_file_writer.h @@ -45,9 +45,9 @@ class StringFileWriter : public FileWriterInterface { void Reset(); // FileWriterInterface: - virtual bool Write(const void* data, size_t size) override; - virtual bool WriteIoVec(std::vector* iovecs) override; - virtual off_t Seek(off_t offset, int whence) override; + bool Write(const void* data, size_t size) override; + bool WriteIoVec(std::vector* iovecs) override; + off_t Seek(off_t offset, int whence) override; private: //! \brief The virtual file’s contents. diff --git a/util/mach/exc_client_variants_test.cc b/util/mach/exc_client_variants_test.cc index b299189..0aa0882 100644 --- a/util/mach/exc_client_variants_test.cc +++ b/util/mach/exc_client_variants_test.cc @@ -133,7 +133,7 @@ class TestExcClientVariants : public UniversalMachExcServer, private: // MachMultiprocess: - virtual void MachMultiprocessParent() override { + void MachMultiprocessParent() override { kern_return_t kr = MachMessageServer::Run(this, LocalPort(), MACH_MSG_OPTION_NONE, @@ -146,7 +146,7 @@ class TestExcClientVariants : public UniversalMachExcServer, EXPECT_TRUE(handled_); } - virtual void MachMultiprocessChild() override { + void MachMultiprocessChild() override { const exception_type_t exception = exception_; const mach_exception_data_type_t code[] = { exception_code_, diff --git a/util/mach/exc_server_variants.h b/util/mach/exc_server_variants.h index b06d3bf..15ab08c 100644 --- a/util/mach/exc_server_variants.h +++ b/util/mach/exc_server_variants.h @@ -103,13 +103,12 @@ class ExcServer : public MachMessageServer::Interface { // MachMessageServer::Interface: - virtual bool MachMessageServerFunction( - const mach_msg_header_t* in_header, - mach_msg_header_t* out_header, - bool* destroy_complex_request) override; + bool MachMessageServerFunction(const mach_msg_header_t* in_header, + mach_msg_header_t* out_header, + bool* destroy_complex_request) override; - virtual mach_msg_size_t MachMessageServerRequestSize() override; - virtual mach_msg_size_t MachMessageServerReplySize() override; + mach_msg_size_t MachMessageServerRequestSize() override; + mach_msg_size_t MachMessageServerReplySize() override; private: Interface* interface_; // weak @@ -191,13 +190,12 @@ class MachExcServer : public MachMessageServer::Interface { // MachMessageServer::Interface: - virtual bool MachMessageServerFunction( - const mach_msg_header_t* in_header, - mach_msg_header_t* out_header, - bool* destroy_complex_request) override; + bool MachMessageServerFunction(const mach_msg_header_t* in_header, + mach_msg_header_t* out_header, + bool* destroy_complex_request) override; - virtual mach_msg_size_t MachMessageServerRequestSize() override; - virtual mach_msg_size_t MachMessageServerReplySize() override; + mach_msg_size_t MachMessageServerRequestSize() override; + mach_msg_size_t MachMessageServerReplySize() override; private: Interface* interface_; // weak @@ -249,14 +247,14 @@ class SimplifiedExcServer : public ExcServer, public ExcServer::Interface { // ExcServer::Interface: - virtual kern_return_t CatchExceptionRaise(exception_handler_t exception_port, - thread_t thread, - task_t task, - exception_type_t exception, - const exception_data_type_t* code, - mach_msg_type_number_t code_count, - bool* destroy_request) override; - virtual kern_return_t CatchExceptionRaiseState( + kern_return_t CatchExceptionRaise(exception_handler_t exception_port, + thread_t thread, + task_t task, + exception_type_t exception, + const exception_data_type_t* code, + mach_msg_type_number_t code_count, + bool* destroy_request) override; + kern_return_t CatchExceptionRaiseState( exception_handler_t exception_port, exception_type_t exception, const exception_data_type_t* code, @@ -266,7 +264,7 @@ class SimplifiedExcServer : public ExcServer, public ExcServer::Interface { mach_msg_type_number_t old_state_count, thread_state_t new_state, mach_msg_type_number_t* new_state_count) override; - virtual kern_return_t CatchExceptionRaiseStateIdentity( + kern_return_t CatchExceptionRaiseStateIdentity( exception_handler_t exception_port, thread_t thread, task_t task, @@ -340,15 +338,14 @@ class SimplifiedMachExcServer : public MachExcServer, // MachExcServer::Interface: - virtual kern_return_t CatchMachExceptionRaise( - exception_handler_t exception_port, - thread_t thread, - task_t task, - exception_type_t exception, - const mach_exception_data_type_t* code, - mach_msg_type_number_t code_count, - bool* destroy_request) override; - virtual kern_return_t CatchMachExceptionRaiseState( + kern_return_t CatchMachExceptionRaise(exception_handler_t exception_port, + thread_t thread, + task_t task, + exception_type_t exception, + const mach_exception_data_type_t* code, + mach_msg_type_number_t code_count, + bool* destroy_request) override; + kern_return_t CatchMachExceptionRaiseState( exception_handler_t exception_port, exception_type_t exception, const mach_exception_data_type_t* code, @@ -358,7 +355,7 @@ class SimplifiedMachExcServer : public MachExcServer, mach_msg_type_number_t old_state_count, thread_state_t new_state, mach_msg_type_number_t* new_state_count) override; - virtual kern_return_t CatchMachExceptionRaiseStateIdentity( + kern_return_t CatchMachExceptionRaiseStateIdentity( exception_handler_t exception_port, thread_t thread, task_t task, @@ -400,29 +397,28 @@ class UniversalMachExcServer // MachMessageServer::Interface: - virtual bool MachMessageServerFunction( - const mach_msg_header_t* in_header, - mach_msg_header_t* out_header, - bool* destroy_complex_request) override; + bool MachMessageServerFunction(const mach_msg_header_t* in_header, + mach_msg_header_t* out_header, + bool* destroy_complex_request) override; - virtual mach_msg_size_t MachMessageServerRequestSize() override; - virtual mach_msg_size_t MachMessageServerReplySize() override; + mach_msg_size_t MachMessageServerRequestSize() override; + mach_msg_size_t MachMessageServerReplySize() override; // internal::SimplifiedExcServer::Interface: - virtual kern_return_t CatchException(exception_behavior_t behavior, - exception_handler_t exception_port, - thread_t thread, - task_t task, - exception_type_t exception, - const exception_data_type_t* code, - mach_msg_type_number_t code_count, - thread_state_flavor_t* flavor, - const natural_t* old_state, - mach_msg_type_number_t old_state_count, - thread_state_t new_state, - mach_msg_type_number_t* new_state_count, - bool* destroy_complex_request) override; + kern_return_t CatchException(exception_behavior_t behavior, + exception_handler_t exception_port, + thread_t thread, + task_t task, + exception_type_t exception, + const exception_data_type_t* code, + mach_msg_type_number_t code_count, + thread_state_flavor_t* flavor, + const natural_t* old_state, + mach_msg_type_number_t old_state_count, + thread_state_t new_state, + mach_msg_type_number_t* new_state_count, + bool* destroy_complex_request) override; private: internal::SimplifiedExcServer exc_server_; diff --git a/util/mach/exc_server_variants_test.cc b/util/mach/exc_server_variants_test.cc index c5450f0..598c3bc 100644 --- a/util/mach/exc_server_variants_test.cc +++ b/util/mach/exc_server_variants_test.cc @@ -940,7 +940,7 @@ class TestExcServerVariants : public UniversalMachExcServer, private: // MachMultiprocess: - virtual void MachMultiprocessParent() override { + void MachMultiprocessParent() override { kern_return_t kr = MachMessageServer::Run(this, LocalPort(), MACH_MSG_OPTION_NONE, @@ -953,7 +953,7 @@ class TestExcServerVariants : public UniversalMachExcServer, EXPECT_TRUE(handled_); } - virtual void MachMultiprocessChild() override { + void MachMultiprocessChild() override { // Set the parent as the exception handler for EXC_CRASH. kern_return_t kr = task_set_exception_ports( mach_task_self(), EXC_MASK_CRASH, RemotePort(), behavior_, flavor_); diff --git a/util/mach/exception_ports_test.cc b/util/mach/exception_ports_test.cc index 9007305..1b1f38e 100644 --- a/util/mach/exception_ports_test.cc +++ b/util/mach/exception_ports_test.cc @@ -352,7 +352,7 @@ class TestExceptionPorts : public UniversalMachExcServer, // MachMultiprocess: - virtual void MachMultiprocessParent() override { + void MachMultiprocessParent() override { // Wait for the child process to be ready. It needs to have all of its // threads set up before proceeding if in kSetOutOfProcess mode. char c; @@ -460,7 +460,7 @@ class TestExceptionPorts : public UniversalMachExcServer, CheckedReadFDAtEOF(ReadPipeFD()); } - virtual void MachMultiprocessChild() override { + void MachMultiprocessChild() override { Child child(this); child.Run(); } diff --git a/util/mach/mach_message_server_test.cc b/util/mach/mach_message_server_test.cc index fe6f0ed..b4862ec 100644 --- a/util/mach/mach_message_server_test.cc +++ b/util/mach/mach_message_server_test.cc @@ -271,11 +271,11 @@ class TestMachMessageServer : public MachMessageServer::Interface, return true; } - virtual mach_msg_size_t MachMessageServerRequestSize() override { + mach_msg_size_t MachMessageServerRequestSize() override { return sizeof(RequestMessage); } - virtual mach_msg_size_t MachMessageServerReplySize() override { + mach_msg_size_t MachMessageServerReplySize() override { return sizeof(ReplyMessage); } @@ -304,7 +304,7 @@ class TestMachMessageServer : public MachMessageServer::Interface, // MachMultiprocess: - virtual void MachMultiprocessParent() override { + void MachMultiprocessParent() override { mach_port_t local_port = LocalPort(); kern_return_t kr; @@ -381,7 +381,7 @@ class TestMachMessageServer : public MachMessageServer::Interface, } } - virtual void MachMultiprocessChild() override { + void MachMultiprocessChild() override { if (options_.child_wait_for_parent_pipe_early) { // Wait until the parent is done setting things up on its end. char c; diff --git a/util/mach/scoped_task_suspend_test.cc b/util/mach/scoped_task_suspend_test.cc index c8606a0..76def55 100644 --- a/util/mach/scoped_task_suspend_test.cc +++ b/util/mach/scoped_task_suspend_test.cc @@ -50,7 +50,7 @@ class ScopedTaskSuspendTest final : public MachMultiprocess { private: // MachMultiprocess: - virtual void MachMultiprocessParent() override { + void MachMultiprocessParent() override { task_t child_task = ChildTask(); EXPECT_EQ(0, SuspendCount(child_task)); @@ -70,7 +70,7 @@ class ScopedTaskSuspendTest final : public MachMultiprocess { EXPECT_EQ(0, SuspendCount(child_task)); } - virtual void MachMultiprocessChild() override { + void MachMultiprocessChild() override { CheckedReadFDAtEOF(ReadPipeFD()); } diff --git a/util/test/mac/mach_multiprocess.h b/util/test/mac/mach_multiprocess.h index e709533..85139d5 100644 --- a/util/test/mac/mach_multiprocess.h +++ b/util/test/mac/mach_multiprocess.h @@ -49,7 +49,7 @@ class MachMultiprocess : public Multiprocess { ~MachMultiprocess(); // Multiprocess: - virtual void PreFork() override; + void PreFork() override; //! \brief Returns a receive right for the local port. //! @@ -79,7 +79,7 @@ class MachMultiprocess : public Multiprocess { //! MachMultiprocessParent(). //! //! Subclasses must override MachMultiprocessParent() instead of this method. - virtual void MultiprocessParent() override final; + void MultiprocessParent() final; //! \brief Runs the child side of the test. //! @@ -88,7 +88,7 @@ class MachMultiprocess : public Multiprocess { //! assertion) is detected, the child will exit with a failure status. //! //! Subclasses must override MachMultiprocessChild() instead of this method. - virtual void MultiprocessChild() override final; + void MultiprocessChild() final; //! \brief The subclass-provided parent routine. //! diff --git a/util/test/mac/mach_multiprocess_test.cc b/util/test/mac/mach_multiprocess_test.cc index 388831f..dc9f7e9 100644 --- a/util/test/mac/mach_multiprocess_test.cc +++ b/util/test/mac/mach_multiprocess_test.cc @@ -32,9 +32,9 @@ class TestMachMultiprocess final : public MachMultiprocess { private: // MachMultiprocess will have already exercised the Mach ports for IPC and the // child task port. - virtual void MachMultiprocessParent() override {} + void MachMultiprocessParent() override {} - virtual void MachMultiprocessChild() override {} + void MachMultiprocessChild() override {} DISALLOW_COPY_AND_ASSIGN(TestMachMultiprocess); }; diff --git a/util/test/multiprocess.h b/util/test/multiprocess.h index c4eadde..c3a7949 100644 --- a/util/test/multiprocess.h +++ b/util/test/multiprocess.h @@ -92,7 +92,7 @@ class Multiprocess { //! provided that they call the superclass’ implementation first as follows: //! //! \code - //! virtual void PreFork() override { + //! void PreFork() override { //! ASSERT_NO_FATAL_FAILURE(Multiprocess::PreFork()); //! //! // Place subclass-specific pre-fork code here. diff --git a/util/test/multiprocess_exec.h b/util/test/multiprocess_exec.h index fecdfb3..5b5f7a2 100644 --- a/util/test/multiprocess_exec.h +++ b/util/test/multiprocess_exec.h @@ -54,11 +54,11 @@ class MultiprocessExec : public Multiprocess { ~MultiprocessExec(); // Multiprocess: - virtual void PreFork() override; + void PreFork() override; private: // Multiprocess: - virtual void MultiprocessChild() override; + void MultiprocessChild() override; std::string command_; std::vector arguments_; diff --git a/util/test/multiprocess_exec_test.cc b/util/test/multiprocess_exec_test.cc index 3111602..c30843e 100644 --- a/util/test/multiprocess_exec_test.cc +++ b/util/test/multiprocess_exec_test.cc @@ -32,7 +32,7 @@ class TestMultiprocessExec final : public MultiprocessExec { ~TestMultiprocessExec() {} private: - virtual void MultiprocessParent() override { + void MultiprocessParent() override { char c = 'z'; CheckedWriteFD(WritePipeFD(), &c, 1); diff --git a/util/test/multiprocess_test.cc b/util/test/multiprocess_test.cc index a766585..92dc6cf 100644 --- a/util/test/multiprocess_test.cc +++ b/util/test/multiprocess_test.cc @@ -35,7 +35,7 @@ class TestMultiprocess final : public Multiprocess { private: // Multiprocess: - virtual void MultiprocessParent() override { + void MultiprocessParent() override { int read_fd = ReadPipeFD(); char c; CheckedReadFD(read_fd, &c, 1); @@ -53,7 +53,7 @@ class TestMultiprocess final : public Multiprocess { CheckedReadFDAtEOF(read_fd); } - virtual void MultiprocessChild() override { + void MultiprocessChild() override { int write_fd = WritePipeFD(); char c = 'M'; @@ -102,10 +102,10 @@ class TestMultiprocessUnclean final : public Multiprocess { // Multiprocess: - virtual void MultiprocessParent() override { + void MultiprocessParent() override { } - virtual void MultiprocessChild() override { + void MultiprocessChild() override { if (type_ == kAbort) { abort(); } else { @@ -216,7 +216,7 @@ class TestMultiprocessClosePipe final : public Multiprocess { // Multiprocess: - virtual void MultiprocessParent() override { + void MultiprocessParent() override { ASSERT_NO_FATAL_FAILURE(VerifyInitial()); if (who_closes_ == kParentCloses) { @@ -226,7 +226,7 @@ class TestMultiprocessClosePipe final : public Multiprocess { } } - virtual void MultiprocessChild() override { + void MultiprocessChild() override { ASSERT_NO_FATAL_FAILURE(VerifyInitial()); if (who_closes_ == kChildCloses) {