snapshot: Make destructors of interface classes public and virtual.

R=rsesek@chromium.org

Review URL: https://codereview.chromium.org/689483003
This commit is contained in:
Mark Mentovai 2014-10-29 17:31:23 -04:00
parent 84b44610cf
commit 4ee00568b7
13 changed files with 21 additions and 28 deletions

View File

@ -27,6 +27,8 @@ struct CPUContext;
//! snapshot process sustained and triggered the snapshot being taken.
class ExceptionSnapshot {
public:
virtual ~ExceptionSnapshot() {}
//! \brief Returns a CPUContext object corresponding to the exception threads
//! CPU context at the time of the exception.
//!
@ -86,9 +88,6 @@ class ExceptionSnapshot {
//! and the values of `code[0]` and `code[1]` as received by a Mach exception
//! handler.
virtual const std::vector<uint64_t>& Codes() const = 0;
protected:
~ExceptionSnapshot() {}
};
} // namespace crashpad

View File

@ -37,7 +37,7 @@ namespace internal {
class ExceptionSnapshotMac final : public ExceptionSnapshot {
public:
ExceptionSnapshotMac();
~ExceptionSnapshotMac();
~ExceptionSnapshotMac() override;
//! \brief Initializes the object.
//!

View File

@ -31,7 +31,7 @@ namespace internal {
class MemorySnapshotMac final : public MemorySnapshot {
public:
MemorySnapshotMac();
~MemorySnapshotMac();
~MemorySnapshotMac() override;
//! \brief Initializes the object.
//!

View File

@ -39,7 +39,7 @@ namespace internal {
class ModuleSnapshotMac final : public ModuleSnapshot {
public:
ModuleSnapshotMac();
~ModuleSnapshotMac();
~ModuleSnapshotMac() override;
//! \brief Initializes the object.
//!

View File

@ -43,7 +43,7 @@ namespace crashpad {
class ProcessSnapshotMac final : public ProcessSnapshot {
public:
ProcessSnapshotMac();
~ProcessSnapshotMac();
~ProcessSnapshotMac() override;
//! \brief Initializes the object.
//!

View File

@ -34,7 +34,7 @@ namespace internal {
class SystemSnapshotMac final : public SystemSnapshot {
public:
SystemSnapshotMac();
~SystemSnapshotMac();
~SystemSnapshotMac() override;
//! \brief Initializes the object.
//!

View File

@ -37,7 +37,7 @@ namespace internal {
class ThreadSnapshotMac final : public ThreadSnapshot {
public:
ThreadSnapshotMac();
~ThreadSnapshotMac();
~ThreadSnapshotMac() override;
//! \brief Initializes the object.
//!

View File

@ -32,6 +32,8 @@ class MemorySnapshot {
//! data is read, it will be passed to a delegate method.
class Delegate {
public:
virtual ~Delegate() {}
//! \brief Called by MemorySnapshot::Read() to provide data requested by a
//! call to that method.
//!
@ -43,11 +45,10 @@ class MemorySnapshot {
//! \return `true` on success, `false` on failure. MemoryDelegate::Read()
//! will use this as its own return value.
virtual bool MemorySnapshotDelegateRead(void* data, size_t size) = 0;
protected:
~Delegate() {}
};
virtual ~MemorySnapshot() {}
//! \brief The base address of the memory snapshot in the snapshot process
//! address space.
virtual uint64_t Address() const = 0;
@ -68,9 +69,6 @@ class MemorySnapshot {
//! Delegate::MemorySnapshotDelegateRead(), which should be `true` on
//! success and `false` on failure.
virtual bool Read(Delegate* delegate) const = 0;
protected:
~MemorySnapshot() {}
};
} // namespace crashpad

View File

@ -30,6 +30,8 @@ namespace crashpad {
//! (binary image) loaded into a snapshot process.
class ModuleSnapshot {
public:
virtual ~ModuleSnapshot() {}
//! \brief A modules type.
enum ModuleType {
//! \brief The modules type is unknown.
@ -145,9 +147,6 @@ class ModuleSnapshot {
//! The annotations returned by this method do not duplicate those returned by
//! AnnotationsVector().
virtual std::map<std::string, std::string> AnnotationsSimpleMap() const = 0;
protected:
~ModuleSnapshot() {}
};
} // namespace crashpad

View File

@ -38,6 +38,8 @@ class ThreadSnapshot;
//! objects corresponding to thread stacks.
class ProcessSnapshot {
public:
virtual ~ProcessSnapshot() {}
//! \brief Returns the snapshot process process ID.
virtual pid_t ProcessID() const = 0;
@ -106,9 +108,6 @@ class ProcessSnapshot {
//! object that it was obtained from. If the snapshot is not a result of
//! an exception, returns `nullptr`.
virtual const ExceptionSnapshot* Exception() const = 0;
protected:
~ProcessSnapshot() {}
};
} // namespace crashpad

View File

@ -29,6 +29,8 @@ namespace crashpad {
//! other characteristics.
class SystemSnapshot {
public:
virtual ~SystemSnapshot() {}
//! \brief A systems operating system family.
enum OperatingSystem {
//! \brief The snapshot systems operating system is unknown.
@ -255,9 +257,6 @@ class SystemSnapshot {
int* daylight_offset_seconds,
std::string* standard_name,
std::string* daylight_name) const = 0;
protected:
~SystemSnapshot() {}
};
} // namespace crashpad

View File

@ -33,7 +33,7 @@ namespace test {
class TestModuleSnapshot final : public ModuleSnapshot {
public:
TestModuleSnapshot();
~TestModuleSnapshot();
~TestModuleSnapshot() override;
void SetName(const std::string& name) { name_ = name; }
void SetAddressAndSize(uint64_t address, uint64_t size) {

View File

@ -26,6 +26,8 @@ class MemorySnapshot;
//! (lightweight process) present in a snapshot process.
class ThreadSnapshot {
public:
virtual ~ThreadSnapshot() {}
//! \brief Returns a CPUContext object corresponding to the threads CPU
//! context.
//!
@ -59,9 +61,6 @@ class ThreadSnapshot {
//! \brief Returns the base address of a region used to store thread-specific
//! data.
virtual uint64_t ThreadSpecificDataAddress() const = 0;
protected:
~ThreadSnapshot() {}
};
} // namespace crashpad