Use exactly one of final, override, and virtual.

This change was generated mechanically by running:

  find . \
      \( -name \*.cc -or -name \*.mm -or -name \*.h \) \
      -and -not -path ./third_party/\* -and -not -path ./out/\* -exec \
      sed -i '' -E -e 's/virtual (.*) override final/\1 final/' {} +

  find . \
      \( -name \*.cc -or -name \*.mm -or -name \*.h \) \
      -and -not -path ./third_party/\* -and -not -path ./out/\* -exec \
      sed -i '' -E -e 's/virtual (.*) override/\1 override/' {} +

Additional changes were made manually based on:

  git grep -E '^ {3,}.*override[;{]'

http://google-styleguide.googlecode.com/svn/trunk/cppguide.html?showone=The__define_Guard#Inheritance

TEST=*_test
BUG=
R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/654933002
This commit is contained in:
Mark Mentovai 2014-10-14 11:11:57 -04:00
Родитель 5d74f120fc
Коммит 525de2c35a
33 изменённых файлов: 203 добавлений и 210 удалений

Просмотреть файл

@ -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_;

Просмотреть файл

@ -86,13 +86,13 @@ class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
protected:
// MinidumpWritable:
virtual bool Freeze() override;
virtual size_t SizeOfObject() override;
virtual std::vector<MinidumpWritable*> Children() override;
virtual bool WriteObject(FileWriterInterface* file_writer) override;
bool Freeze() override;
size_t SizeOfObject() override;
std::vector<MinidumpWritable*> Children() override;
bool WriteObject(FileWriterInterface* file_writer) override;
// MinidumpStreamWriter:
virtual MinidumpStreamType StreamType() const override;
MinidumpStreamType StreamType() const override;
private:
MINIDUMP_EXCEPTION_STREAM exception_;

Просмотреть файл

@ -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<MinidumpWritable*> 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<MinidumpWritable*> Children() override;
bool WillWriteAtOffsetImpl(off_t offset) override;
bool WriteObject(FileWriterInterface* file_writer) override;
private:
MINIDUMP_HEADER header_;

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -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 objects 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 objects 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<MinidumpWritable*> Children() override;
virtual bool WriteObject(FileWriterInterface* file_writer) override;
bool Freeze() override;
size_t SizeOfObject() override;
std::vector<MinidumpWritable*> 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_;

Просмотреть файл

@ -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<MinidumpWritable*> Children() override {
std::vector<MinidumpWritable*> Children() override {
EXPECT_GE(state(), kStateFrozen);
std::vector<MinidumpWritable*> children(1, memory());
return children;
}
virtual bool WriteObject(FileWriterInterface* file_writer) override {
bool WriteObject(FileWriterInterface* file_writer) override {
EXPECT_EQ(kStateWritable, state());
return true;
}

Просмотреть файл

@ -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_;

Просмотреть файл

@ -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

Просмотреть файл

@ -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 records 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<MinidumpWritable*> Children() override;
virtual bool WriteObject(FileWriterInterface* file_writer) override;
bool Freeze() override;
size_t SizeOfObject() override;
std::vector<MinidumpWritable*> 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<MinidumpWritable*> Children() override;
virtual bool WriteObject(FileWriterInterface* file_writer) override;
bool Freeze() override;
size_t SizeOfObject() override;
std::vector<MinidumpWritable*> 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_;

Просмотреть файл

@ -51,7 +51,7 @@ class MinidumpStreamWriter : public MinidumpWritable {
~MinidumpStreamWriter() {}
// MinidumpWritable:
virtual bool Freeze() override;
bool Freeze() override;
private:
MINIDUMP_DIRECTORY directory_list_entry_;

Просмотреть файл

@ -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.
//!

Просмотреть файл

@ -166,13 +166,13 @@ class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter {
protected:
// MinidumpWritable:
virtual bool Freeze() override;
virtual size_t SizeOfObject() override;
virtual std::vector<MinidumpWritable*> Children() override;
virtual bool WriteObject(FileWriterInterface* file_writer) override;
bool Freeze() override;
size_t SizeOfObject() override;
std::vector<MinidumpWritable*> Children() override;
bool WriteObject(FileWriterInterface* file_writer) override;
// MinidumpStreamWriter:
virtual MinidumpStreamType StreamType() const override;
MinidumpStreamType StreamType() const override;
private:
MINIDUMP_SYSTEM_INFO system_info_;

Просмотреть файл

@ -107,10 +107,10 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable {
protected:
// MinidumpWritable:
virtual bool Freeze() override;
virtual size_t SizeOfObject() override;
virtual std::vector<MinidumpWritable*> Children() override;
virtual bool WriteObject(FileWriterInterface* file_writer) override;
bool Freeze() override;
size_t SizeOfObject() override;
std::vector<MinidumpWritable*> 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<MinidumpWritable*> Children() override;
virtual bool WriteObject(FileWriterInterface* file_writer) override;
bool Freeze() override;
size_t SizeOfObject() override;
std::vector<MinidumpWritable*> 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_;

Просмотреть файл

@ -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<MinidumpWritable*> Children() override {
std::vector<MinidumpWritable*> Children() override {
EXPECT_GE(state(), kStateFrozen);
if (!children_.empty()) {
std::vector<MinidumpWritable*> 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_;

Просмотреть файл

@ -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<uint64_t>& 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<uint64_t>& Codes() const override;
private:
#if defined(ARCH_CPU_X86_FAMILY)

Просмотреть файл

@ -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

Просмотреть файл

@ -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_;

Просмотреть файл

@ -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");

Просмотреть файл

@ -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)

Просмотреть файл

@ -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<WritableIoVec>* iovecs) override;
bool WriteIoVec(std::vector<WritableIoVec>* 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_;

Просмотреть файл

@ -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<WritableIoVec>* 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<WritableIoVec>* iovecs) override;
off_t Seek(off_t offset, int whence) override;
private:
//! \brief The virtual files contents.

Просмотреть файл

@ -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_,

Просмотреть файл

@ -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_;

Просмотреть файл

@ -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_);

Просмотреть файл

@ -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();
}

Просмотреть файл

@ -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;

Просмотреть файл

@ -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());
}

Просмотреть файл

@ -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.
//!

Просмотреть файл

@ -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);
};

Просмотреть файл

@ -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.

Просмотреть файл

@ -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<std::string> arguments_;

Просмотреть файл

@ -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);

Просмотреть файл

@ -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) {