Modernize code

- Replace DISALLOW_COPY_AND_ASSIGN with =delete.
- Replace some NULLs with nullptrs;
- Use the override keyword when appropriate.
- Use =default when appropriate.

Change-Id: I99e1d7f349dd4c32aa5d05e2ebdce7a86e47f551
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/4527718
Reviewed-by: Ivan Penkov <ivanpe@chromium.org>
This commit is contained in:
Lei Zhang 2023-05-12 11:13:43 -07:00
parent 463ae7cd60
commit 5850e262b1
8 changed files with 119 additions and 126 deletions

View file

@ -49,9 +49,11 @@ namespace {
class CrashGenerationClientImpl : public CrashGenerationClient {
public:
explicit CrashGenerationClientImpl(int server_fd) : server_fd_(server_fd) {}
virtual ~CrashGenerationClientImpl() {}
CrashGenerationClientImpl(const CrashGenerationClientImpl&) = delete;
void operator=(const CrashGenerationClientImpl&) = delete;
~CrashGenerationClientImpl() override = default;
virtual bool RequestDump(const void* blob, size_t blob_size) {
bool RequestDump(const void* blob, size_t blob_size) override {
int fds[2];
if (sys_pipe(fds) < 0)
return false;
@ -92,8 +94,6 @@ class CrashGenerationClientImpl : public CrashGenerationClient {
private:
int server_fd_;
DISALLOW_COPY_AND_ASSIGN(CrashGenerationClientImpl);
};
} // namespace

View file

@ -29,8 +29,6 @@
#ifndef CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
#define CLIENT_LINUX_CRASH_GENERATION_CRASH_GENERATION_CLIENT_H_
#include "common/basictypes.h"
#include <stddef.h>
namespace google_breakpad {
@ -41,8 +39,10 @@ namespace google_breakpad {
// via a remote process.
class CrashGenerationClient {
public:
CrashGenerationClient() {}
virtual ~CrashGenerationClient() {}
CrashGenerationClient() = default;
CrashGenerationClient(const CrashGenerationClient&) = delete;
void operator=(const CrashGenerationClient&) = delete;
virtual ~CrashGenerationClient() = default;
// Request the crash server to generate a dump. |blob| is an opaque
// CrashContext pointer from exception_handler.h.
@ -54,9 +54,6 @@ class CrashGenerationClient {
// The returned CrashGenerationClient* is owned by the caller of
// this function.
static CrashGenerationClient* TryCreate(int server_fd);
private:
DISALLOW_COPY_AND_ASSIGN(CrashGenerationClient);
};
} // namespace google_breakpad

View file

@ -29,14 +29,6 @@
#ifndef COMMON_BASICTYPES_H_
#define COMMON_BASICTYPES_H_
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#ifndef DISALLOW_COPY_AND_ASSIGN
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
void operator=(const TypeName&)
#endif // DISALLOW_COPY_AND_ASSIGN
namespace google_breakpad {
// Used to explicitly mark the return value of a function as unused. If you are

View file

@ -33,7 +33,7 @@
#define COMMON_LINUX_MEMORY_MAPPED_FILE_H_
#include <stddef.h>
#include "common/basictypes.h"
#include "common/memory_range.h"
namespace google_breakpad {
@ -49,6 +49,9 @@ class MemoryMappedFile {
// If Map() fails, the object behaves as if it is default constructed.
MemoryMappedFile(const char* path, size_t offset);
MemoryMappedFile(const MemoryMappedFile&) = delete;
void operator=(const MemoryMappedFile&) = delete;
~MemoryMappedFile();
// Maps a file at |path| into memory, which can then be accessed via
@ -77,8 +80,6 @@ class MemoryMappedFile {
private:
// Mapped file content as a MemoryRange object.
MemoryRange content_;
DISALLOW_COPY_AND_ASSIGN(MemoryMappedFile);
};
} // namespace google_breakpad

View file

@ -32,8 +32,6 @@
#include <assert.h>
#include <string.h>
#include "common/basictypes.h"
namespace google_breakpad {
// Opaque type for the serialized representation of a NonAllocatingMap. One is
@ -80,6 +78,8 @@ class NonAllocatingMap {
: map_(map),
current_(0) {
}
Iterator(const Iterator&) = delete;
void operator=(const Iterator&) = delete;
// Returns the next entry in the map, or NULL if at the end of the
// collection.
@ -90,14 +90,12 @@ class NonAllocatingMap {
return entry;
}
}
return NULL;
return nullptr;
}
private:
const NonAllocatingMap& map_;
size_t current_;
DISALLOW_COPY_AND_ASSIGN(Iterator);
};
NonAllocatingMap() : entries_() {

View file

@ -31,7 +31,6 @@
#include <string>
#include "common/basictypes.h"
#include "common/windows/module_info.h"
namespace google_breakpad {
@ -44,6 +43,8 @@ using std::wstring;
class PESourceLineWriter {
public:
explicit PESourceLineWriter(const wstring& pe_file);
PESourceLineWriter(const PESourceLineWriter&) = delete;
void operator=(const PESourceLineWriter&) = delete;
~PESourceLineWriter();
// Writes Breakpad symbols from the pe file to |symbol_file|.
@ -58,9 +59,7 @@ public:
bool GetPEInfo(PEModuleInfo* info);
private:
const wstring pe_file_;
DISALLOW_COPY_AND_ASSIGN(PESourceLineWriter);
const wstring pe_file_;
};
} // namespace google_breakpad

View file

@ -89,7 +89,6 @@
#include <string>
#include <vector>
#include "common/basictypes.h"
#include "common/using_std_string.h"
#include "google_breakpad/processor/code_module.h"
#include "google_breakpad/processor/code_modules.h"
@ -114,7 +113,7 @@ template<typename AddressType, typename EntryType> class RangeMap;
// itself.
class MinidumpObject : public DumpObject {
public:
virtual ~MinidumpObject() {}
virtual ~MinidumpObject() = default;
protected:
explicit MinidumpObject(Minidump* minidump);
@ -136,7 +135,9 @@ class MinidumpObject : public DumpObject {
// same interface, and may be derived from this class.
class MinidumpStream : public MinidumpObject {
public:
virtual ~MinidumpStream() {}
MinidumpStream(const MinidumpStream&) = delete;
void operator=(const MinidumpStream&) = delete;
~MinidumpStream() override = default;
protected:
explicit MinidumpStream(Minidump* minidump);
@ -150,8 +151,6 @@ class MinidumpStream : public MinidumpObject {
// that implements MinidumpStream can compare expected_size to a
// known size as an integrity check.
virtual bool Read(uint32_t expected_size) = 0;
DISALLOW_COPY_AND_ASSIGN(MinidumpStream);
};
@ -167,7 +166,9 @@ class MinidumpStream : public MinidumpObject {
// user wants).
class MinidumpContext : public DumpContext {
public:
virtual ~MinidumpContext();
MinidumpContext(const MinidumpContext&) = delete;
void operator=(const MinidumpContext&) = delete;
~MinidumpContext() override;
protected:
explicit MinidumpContext(Minidump* minidump);
@ -192,8 +193,6 @@ class MinidumpContext : public DumpContext {
// for access to data about the minidump file itself, such as whether
// it should be byte-swapped.
Minidump* minidump_;
DISALLOW_COPY_AND_ASSIGN(MinidumpContext);
};
@ -208,7 +207,7 @@ class MinidumpContext : public DumpContext {
class MinidumpMemoryRegion : public MinidumpObject,
public MemoryRegion {
public:
virtual ~MinidumpMemoryRegion();
~MinidumpMemoryRegion() override;
static void set_max_bytes(uint32_t max_bytes) { max_bytes_ = max_bytes; }
static uint32_t max_bytes() { return max_bytes_; }
@ -219,22 +218,22 @@ class MinidumpMemoryRegion : public MinidumpObject,
const uint8_t* GetMemory() const;
// The address of the base of the memory region.
uint64_t GetBase() const;
uint64_t GetBase() const override;
// The size, in bytes, of the memory region.
uint32_t GetSize() const;
uint32_t GetSize() const override;
// Frees the cached memory region, if cached.
void FreeMemory();
// Obtains the value of memory at the pointer specified by address.
bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const;
bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const;
bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const;
bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const;
bool GetMemoryAtAddress(uint64_t address, uint8_t* value) const override;
bool GetMemoryAtAddress(uint64_t address, uint16_t* value) const override;
bool GetMemoryAtAddress(uint64_t address, uint32_t* value) const override;
bool GetMemoryAtAddress(uint64_t address, uint64_t* value) const override;
// Print a human-readable representation of the object to stdout.
void Print() const;
void Print() const override;
void SetPrintMode(bool hexdump, unsigned int width);
protected:
@ -277,9 +276,9 @@ class MinidumpMemoryRegion : public MinidumpObject,
// contain a memory region or context.
class MinidumpThread : public MinidumpObject {
public:
virtual ~MinidumpThread();
~MinidumpThread() override;
const MDRawThread* thread() const { return valid_ ? &thread_ : NULL; }
const MDRawThread* thread() const { return valid_ ? &thread_ : nullptr; }
// GetMemory may return NULL even if the MinidumpThread is valid,
// if the thread memory cannot be read.
virtual MinidumpMemoryRegion* GetMemory();
@ -322,7 +321,9 @@ class MinidumpThread : public MinidumpObject {
// a process.
class MinidumpThreadList : public MinidumpStream {
public:
virtual ~MinidumpThreadList();
MinidumpThreadList(const MinidumpThreadList&) = delete;
void operator=(const MinidumpThreadList&) = delete;
~MinidumpThreadList() override;
static void set_max_threads(uint32_t max_threads) {
max_threads_ = max_threads;
@ -364,18 +365,16 @@ class MinidumpThreadList : public MinidumpStream {
// The list of threads.
MinidumpThreads* threads_;
uint32_t thread_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadList);
uint32_t thread_count_;
};
// MinidumpThreadName contains the name of a thread.
class MinidumpThreadName : public MinidumpObject {
public:
virtual ~MinidumpThreadName();
~MinidumpThreadName() override;
const MDRawThreadName* thread_name() const {
return valid_ ? &thread_name_ : NULL;
return valid_ ? &thread_name_ : nullptr;
}
// Gets the thread ID.
@ -419,7 +418,9 @@ class MinidumpThreadName : public MinidumpObject {
// MinidumpThreadNames) in a process.
class MinidumpThreadNameList : public MinidumpStream {
public:
virtual ~MinidumpThreadNameList();
MinidumpThreadNameList(const MinidumpThreadNameList&) = delete;
void operator=(const MinidumpThreadNameList&) = delete;
~MinidumpThreadNameList() override;
virtual unsigned int thread_name_count() const {
return valid_ ? thread_name_count_ : 0;
@ -446,8 +447,6 @@ class MinidumpThreadNameList : public MinidumpStream {
// The list of thread names.
MinidumpThreadNames* thread_names_;
uint32_t thread_name_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadNameList);
};
// MinidumpModule wraps MDRawModule, which contains information about loaded
@ -457,7 +456,7 @@ class MinidumpThreadNameList : public MinidumpStream {
class MinidumpModule : public MinidumpObject,
public CodeModule {
public:
virtual ~MinidumpModule();
~MinidumpModule() override;
static void set_max_cv_bytes(uint32_t max_cv_bytes) {
max_cv_bytes_ = max_cv_bytes;
@ -469,27 +468,27 @@ class MinidumpModule : public MinidumpObject,
}
static uint32_t max_misc_bytes() { return max_misc_bytes_; }
const MDRawModule* module() const { return valid_ ? &module_ : NULL; }
const MDRawModule* module() const { return valid_ ? &module_ : nullptr; }
// CodeModule implementation
virtual uint64_t base_address() const {
uint64_t base_address() const override {
return valid_ ? module_.base_of_image : static_cast<uint64_t>(-1);
}
virtual uint64_t size() const { return valid_ ? module_.size_of_image : 0; }
virtual string code_file() const;
virtual string code_identifier() const;
virtual string debug_file() const;
virtual string debug_identifier() const;
virtual string version() const;
virtual CodeModule* Copy() const;
virtual bool is_unloaded() const { return false; }
uint64_t size() const override { return valid_ ? module_.size_of_image : 0; }
string code_file() const override;
string code_identifier() const override;
string debug_file() const override;
string debug_identifier() const override;
string version() const override;
CodeModule* Copy() const override;
bool is_unloaded() const override { return false; }
// Getter and setter for shrink_down_delta. This is used when the address
// range for a module is shrunk down due to address range conflicts with
// other modules. The base_address and size fields are not updated and they
// should always reflect the original values (reported in the minidump).
virtual uint64_t shrink_down_delta() const;
virtual void SetShrinkDownDelta(uint64_t shrink_down_delta);
uint64_t shrink_down_delta() const override;
void SetShrinkDownDelta(uint64_t shrink_down_delta) override;
// The CodeView record, which contains information to locate the module's
// debugging information (pdb). This is returned as uint8_t* because
@ -580,7 +579,9 @@ class MinidumpModule : public MinidumpObject,
class MinidumpModuleList : public MinidumpStream,
public CodeModules {
public:
virtual ~MinidumpModuleList();
MinidumpModuleList(const MinidumpModuleList&) = delete;
void operator=(const MinidumpModuleList&) = delete;
~MinidumpModuleList() override;
static void set_max_modules(uint32_t max_modules) {
max_modules_ = max_modules;
@ -588,19 +589,19 @@ class MinidumpModuleList : public MinidumpStream,
static uint32_t max_modules() { return max_modules_; }
// CodeModules implementation.
virtual unsigned int module_count() const {
unsigned int module_count() const override {
return valid_ ? module_count_ : 0;
}
virtual const MinidumpModule* GetModuleForAddress(uint64_t address) const;
virtual const MinidumpModule* GetMainModule() const;
virtual const MinidumpModule* GetModuleAtSequence(
unsigned int sequence) const;
virtual const MinidumpModule* GetModuleAtIndex(unsigned int index) const;
virtual const CodeModules* Copy() const;
const MinidumpModule* GetModuleForAddress(uint64_t address) const override;
const MinidumpModule* GetMainModule() const override;
const MinidumpModule* GetModuleAtSequence(
unsigned int sequence) const override;
const MinidumpModule* GetModuleAtIndex(unsigned int index) const override;
const CodeModules* Copy() const override;
// Returns a vector of all modules which address ranges needed to be shrunk
// down due to address range conflicts with other modules.
virtual vector<linked_ptr<const CodeModule> > GetShrunkRangeModules() const;
vector<linked_ptr<const CodeModule>> GetShrunkRangeModules() const override;
// Print a human-readable representation of the object to stdout.
void Print();
@ -615,7 +616,7 @@ class MinidumpModuleList : public MinidumpStream,
static const uint32_t kStreamType = MD_MODULE_LIST_STREAM;
bool Read(uint32_t expected_size);
bool Read(uint32_t expected_size) override;
bool StoreRange(const MinidumpModule& module,
uint64_t base_address,
@ -632,8 +633,6 @@ class MinidumpModuleList : public MinidumpStream,
MinidumpModules* modules_;
uint32_t module_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleList);
};
@ -648,7 +647,9 @@ class MinidumpModuleList : public MinidumpStream,
// memory minidumps contain all of a process' mapped memory.
class MinidumpMemoryList : public MinidumpStream {
public:
virtual ~MinidumpMemoryList();
MinidumpMemoryList(const MinidumpMemoryList&) = delete;
void operator=(const MinidumpMemoryList&) = delete;
~MinidumpMemoryList() override;
static void set_max_regions(uint32_t max_regions) {
max_regions_ = max_regions;
@ -696,8 +697,6 @@ class MinidumpMemoryList : public MinidumpStream {
// The list of regions.
MemoryRegions* regions_;
uint32_t region_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryList);
};
@ -709,10 +708,12 @@ class MinidumpMemoryList : public MinidumpStream {
// occurred.
class MinidumpException : public MinidumpStream {
public:
virtual ~MinidumpException();
MinidumpException(const MinidumpException&) = delete;
void operator=(const MinidumpException&) = delete;
~MinidumpException() override;
const MDRawExceptionStream* exception() const {
return valid_ ? &exception_ : NULL;
return valid_ ? &exception_ : nullptr;
}
// The thread ID is used to determine if a thread is the exception thread,
@ -736,19 +737,19 @@ class MinidumpException : public MinidumpStream {
bool Read(uint32_t expected_size) override;
MDRawExceptionStream exception_;
MinidumpContext* context_;
DISALLOW_COPY_AND_ASSIGN(MinidumpException);
MinidumpContext* context_;
};
// MinidumpAssertion wraps MDRawAssertionInfo, which contains information
// about an assertion that caused the minidump to be generated.
class MinidumpAssertion : public MinidumpStream {
public:
virtual ~MinidumpAssertion();
MinidumpAssertion(const MinidumpAssertion&) = delete;
void operator=(const MinidumpAssertion&) = delete;
~MinidumpAssertion() override;
const MDRawAssertionInfo* assertion() const {
return valid_ ? &assertion_ : NULL;
return valid_ ? &assertion_ : nullptr;
}
string expression() const {
@ -779,8 +780,6 @@ class MinidumpAssertion : public MinidumpStream {
string expression_;
string function_;
string file_;
DISALLOW_COPY_AND_ASSIGN(MinidumpAssertion);
};
@ -788,10 +787,12 @@ class MinidumpAssertion : public MinidumpStream {
// the system on which the minidump was generated. See also MinidumpMiscInfo.
class MinidumpSystemInfo : public MinidumpStream {
public:
virtual ~MinidumpSystemInfo();
MinidumpSystemInfo(const MinidumpSystemInfo&) = delete;
void operator=(const MinidumpSystemInfo&) = delete;
~MinidumpSystemInfo() override;
const MDRawSystemInfo* system_info() const {
return valid_ ? &system_info_ : NULL;
return valid_ ? &system_info_ : nullptr;
}
// GetOS and GetCPU return textual representations of the operating system
@ -834,8 +835,6 @@ class MinidumpSystemInfo : public MinidumpStream {
// A string identifying the CPU vendor, if known.
const string* cpu_vendor_;
DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfo);
};
@ -846,7 +845,7 @@ class MinidumpUnloadedModule : public MinidumpObject,
~MinidumpUnloadedModule() override;
const MDRawUnloadedModule* module() const {
return valid_ ? &unloaded_module_ : NULL;
return valid_ ? &unloaded_module_ : nullptr;
}
// CodeModule implementation
@ -903,6 +902,8 @@ class MinidumpUnloadedModule : public MinidumpObject,
class MinidumpUnloadedModuleList : public MinidumpStream,
public CodeModules {
public:
MinidumpUnloadedModuleList(const MinidumpUnloadedModuleList&) = delete;
void operator=(const MinidumpUnloadedModuleList&) = delete;
~MinidumpUnloadedModuleList() override;
static void set_max_modules(uint32_t max_modules) {
@ -945,8 +946,6 @@ class MinidumpUnloadedModuleList : public MinidumpStream,
MinidumpUnloadedModules* unloaded_modules_;
uint32_t module_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleList);
};
@ -955,8 +954,11 @@ class MinidumpUnloadedModuleList : public MinidumpStream,
// information. See also MinidumpSystemInfo.
class MinidumpMiscInfo : public MinidumpStream {
public:
MinidumpMiscInfo(const MinidumpMiscInfo&) = delete;
void operator=(const MinidumpMiscInfo&) = delete;
const MDRawMiscInfo* misc_info() const {
return valid_ ? &misc_info_ : NULL;
return valid_ ? &misc_info_ : nullptr;
}
// Print a human-readable representation of the object to stdout.
@ -980,8 +982,6 @@ class MinidumpMiscInfo : public MinidumpStream {
string daylight_name_;
string build_string_;
string dbg_bld_str_;
DISALLOW_COPY_AND_ASSIGN(MinidumpMiscInfo);
};
@ -990,8 +990,11 @@ class MinidumpMiscInfo : public MinidumpStream {
// at the time the minidump was generated.
class MinidumpBreakpadInfo : public MinidumpStream {
public:
MinidumpBreakpadInfo(const MinidumpBreakpadInfo&) = delete;
void operator=(const MinidumpBreakpadInfo&) = delete;
const MDRawBreakpadInfo* breakpad_info() const {
return valid_ ? &breakpad_info_ : NULL;
return valid_ ? &breakpad_info_ : nullptr;
}
// These thread IDs are used to determine if threads deserve special
@ -1014,8 +1017,6 @@ class MinidumpBreakpadInfo : public MinidumpStream {
bool Read(uint32_t expected_size_) override;
MDRawBreakpadInfo breakpad_info_;
DISALLOW_COPY_AND_ASSIGN(MinidumpBreakpadInfo);
};
// MinidumpMemoryInfo wraps MDRawMemoryInfo, which provides information
@ -1023,7 +1024,9 @@ class MinidumpBreakpadInfo : public MinidumpStream {
// and protection.
class MinidumpMemoryInfo : public MinidumpObject {
public:
const MDRawMemoryInfo* info() const { return valid_ ? &memory_info_ : NULL; }
const MDRawMemoryInfo* info() const {
return valid_ ? &memory_info_ : nullptr;
}
// The address of the base of the memory region.
uint64_t GetBase() const { return valid_ ? memory_info_.base_address : 0; }
@ -1060,7 +1063,9 @@ class MinidumpMemoryInfo : public MinidumpObject {
// info corresponding to a specific address.
class MinidumpMemoryInfoList : public MinidumpStream {
public:
virtual ~MinidumpMemoryInfoList();
MinidumpMemoryInfoList(const MinidumpMemoryInfoList&) = delete;
void operator=(const MinidumpMemoryInfoList&) = delete;
~MinidumpMemoryInfoList() override;
unsigned int info_count() const { return valid_ ? info_count_ : 0; }
@ -1086,14 +1091,15 @@ class MinidumpMemoryInfoList : public MinidumpStream {
MinidumpMemoryInfos* infos_;
uint32_t info_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpMemoryInfoList);
};
// MinidumpLinuxMaps wraps information about a single mapped memory region
// from /proc/self/maps.
class MinidumpLinuxMaps : public MinidumpObject {
public:
MinidumpLinuxMaps(const MinidumpLinuxMaps&) = delete;
void operator=(const MinidumpLinuxMaps&) = delete;
// The memory address of the base of the mapped region.
uint64_t GetBase() const { return valid_ ? region_.start : 0; }
// The size of the mapped region.
@ -1139,8 +1145,6 @@ class MinidumpLinuxMaps : public MinidumpObject {
// The memory region struct that this class wraps.
MappedMemoryRegion region_;
DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMaps);
};
// MinidumpLinuxMapsList corresponds to the Linux-exclusive MD_LINUX_MAPS
@ -1148,7 +1152,9 @@ class MinidumpLinuxMaps : public MinidumpObject {
// the mapped memory regions and their access permissions.
class MinidumpLinuxMapsList : public MinidumpStream {
public:
virtual ~MinidumpLinuxMapsList();
MinidumpLinuxMapsList(const MinidumpLinuxMapsList&) = delete;
void operator=(const MinidumpLinuxMapsList&) = delete;
~MinidumpLinuxMapsList() override;
// Get number of mappings.
unsigned int get_maps_count() const { return valid_ ? maps_count_ : 0; }
@ -1180,8 +1186,6 @@ class MinidumpLinuxMapsList : public MinidumpStream {
MinidumpLinuxMappings* maps_;
// The number of mappings.
uint32_t maps_count_;
DISALLOW_COPY_AND_ASSIGN(MinidumpLinuxMapsList);
};
// MinidumpCrashpadInfo wraps MDRawCrashpadInfo, which is an optional stream in
@ -1196,12 +1200,12 @@ class MinidumpCrashpadInfo : public MinidumpStream {
};
const MDRawCrashpadInfo* crashpad_info() const {
return valid_ ? &crashpad_info_ : NULL;
return valid_ ? &crashpad_info_ : nullptr;
}
const std::vector<std::vector<AnnotationObject>>*
GetModuleCrashpadInfoAnnotationObjects() const {
return valid_ ? &module_crashpad_info_annotation_objects_ : NULL;
return valid_ ? &module_crashpad_info_annotation_objects_ : nullptr;
}
// Print a human-readable representation of the object to stdout.
@ -1242,6 +1246,9 @@ class Minidump {
// is valid as long as the Minidump object is.
explicit Minidump(std::istream& input);
Minidump(const Minidump&) = delete;
void operator=(const Minidump&) = delete;
virtual ~Minidump();
// path may be empty if the minidump was not opened from a file
@ -1258,7 +1265,9 @@ class Minidump {
}
static uint32_t max_string_length() { return max_string_length_; }
virtual const MDRawHeader* header() const { return valid_ ? &header_ : NULL; }
virtual const MDRawHeader* header() const {
return valid_ ? &header_ : nullptr;
}
// Reads the CPU information from the system info stream and generates the
// appropriate CPU flags. The returned context_cpu_flags are the same as
@ -1374,7 +1383,7 @@ class Minidump {
// the Minidump object locate interesting streams quickly, and
// provides a convenient place to stash MinidumpStream objects.
struct MinidumpStreamInfo {
MinidumpStreamInfo() : stream_index(0), stream(NULL) {}
MinidumpStreamInfo() : stream_index(0), stream(nullptr) {}
~MinidumpStreamInfo() { delete stream; }
// Index into the MinidumpDirectoryEntries vector
@ -1436,8 +1445,6 @@ class Minidump {
// Knobs for controlling display of memory printing.
bool hexdump_;
unsigned int hexdump_width_;
DISALLOW_COPY_AND_ASSIGN(Minidump);
};

View file

@ -36,7 +36,6 @@
#ifndef PROCESSOR_STACKWALKER_ADDRESS_LIST_H_
#define PROCESSOR_STACKWALKER_ADDRESS_LIST_H_
#include "common/basictypes.h"
#include "google_breakpad/common/breakpad_types.h"
#include "google_breakpad/processor/stackwalker.h"
@ -53,6 +52,8 @@ class StackwalkerAddressList : public Stackwalker {
size_t frame_count,
const CodeModules* modules,
StackFrameSymbolizer* frame_symbolizer);
StackwalkerAddressList(const StackwalkerAddressList&) = delete;
void operator=(const StackwalkerAddressList&) = delete;
private:
// Implementation of Stackwalker.
@ -62,8 +63,6 @@ class StackwalkerAddressList : public Stackwalker {
const uint64_t* frames_;
size_t frame_count_;
DISALLOW_COPY_AND_ASSIGN(StackwalkerAddressList);
};
} // namespace google_breakpad