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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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