mirror of
https://github.com/chromium/crashpad.git
synced 2025-03-08 21:26:04 +00:00
Convert from scoped_ptr to std::unique_ptr
Follows https://codereview.chromium.org/1911823002/ but fixes includes that were messed up there. Change-Id: Ic4bad7d095ee6f5a1c9f8ca2d11ac9e67d55a626 Reviewed-on: https://chromium-review.googlesource.com/340497 Reviewed-by: Robert Sesek <rsesek@chromium.org>
This commit is contained in:
parent
d6d726a0eb
commit
a02ba24006
@ -17,12 +17,12 @@
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "util/file/file_io.h"
|
||||
#include "util/misc/uuid.h"
|
||||
|
||||
@ -176,7 +176,8 @@ class CrashReportDatabase {
|
||||
//! logged.
|
||||
//!
|
||||
//! \sa InitializeWithoutCreating
|
||||
static scoped_ptr<CrashReportDatabase> Initialize(const base::FilePath& path);
|
||||
static std::unique_ptr<CrashReportDatabase> Initialize(
|
||||
const base::FilePath& path);
|
||||
|
||||
//! \brief Opens an existing database of crash reports.
|
||||
//!
|
||||
@ -190,7 +191,7 @@ class CrashReportDatabase {
|
||||
//! logged.
|
||||
//!
|
||||
//! \sa Initialize
|
||||
static scoped_ptr<CrashReportDatabase> InitializeWithoutCreating(
|
||||
static std::unique_ptr<CrashReportDatabase> InitializeWithoutCreating(
|
||||
const base::FilePath& path);
|
||||
|
||||
//! \brief Returns the Settings object for this database.
|
||||
|
@ -273,7 +273,7 @@ CrashReportDatabase::OperationStatus
|
||||
CrashReportDatabaseMac::PrepareNewCrashReport(NewReport** out_report) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<NewReport> report(new NewReport());
|
||||
std::unique_ptr<NewReport> report(new NewReport());
|
||||
|
||||
uuid_t uuid_gen;
|
||||
uuid_generate(uuid_gen);
|
||||
@ -312,7 +312,7 @@ CrashReportDatabaseMac::FinishedWritingCrashReport(NewReport* report,
|
||||
base::ScopedFD lock(report->handle);
|
||||
|
||||
// Take ownership of the report.
|
||||
scoped_ptr<NewReport> scoped_report(report);
|
||||
std::unique_ptr<NewReport> scoped_report(report);
|
||||
|
||||
// Get the report's UUID to return.
|
||||
std::string uuid_string;
|
||||
@ -355,7 +355,7 @@ CrashReportDatabaseMac::ErrorWritingCrashReport(NewReport* report) {
|
||||
base::ScopedFD lock(report->handle);
|
||||
|
||||
// Take ownership of the report.
|
||||
scoped_ptr<NewReport> scoped_report(report);
|
||||
std::unique_ptr<NewReport> scoped_report(report);
|
||||
|
||||
// Remove the file that the report would have been written to had no error
|
||||
// occurred.
|
||||
@ -413,7 +413,7 @@ CrashReportDatabaseMac::GetReportForUploading(const UUID& uuid,
|
||||
if (report_path.empty())
|
||||
return kReportNotFound;
|
||||
|
||||
scoped_ptr<UploadReport> upload_report(new UploadReport());
|
||||
std::unique_ptr<UploadReport> upload_report(new UploadReport());
|
||||
upload_report->file_path = report_path;
|
||||
|
||||
base::ScopedFD lock(ObtainReportLock(report_path));
|
||||
@ -441,7 +441,7 @@ CrashReportDatabaseMac::RecordUploadAttempt(const Report* report,
|
||||
if (report_path.empty())
|
||||
return kReportNotFound;
|
||||
|
||||
scoped_ptr<const UploadReport> upload_report(
|
||||
std::unique_ptr<const UploadReport> upload_report(
|
||||
static_cast<const UploadReport*>(report));
|
||||
|
||||
base::ScopedFD lock(upload_report->lock_fd);
|
||||
@ -647,27 +647,28 @@ std::string CrashReportDatabaseMac::XattrName(const base::StringPiece& name) {
|
||||
return XattrNameInternal(name, xattr_new_names_);
|
||||
}
|
||||
|
||||
scoped_ptr<CrashReportDatabase> InitializeInternal(const base::FilePath& path,
|
||||
bool may_create) {
|
||||
scoped_ptr<CrashReportDatabaseMac> database_mac(
|
||||
std::unique_ptr<CrashReportDatabase> InitializeInternal(
|
||||
const base::FilePath& path,
|
||||
bool may_create) {
|
||||
std::unique_ptr<CrashReportDatabaseMac> database_mac(
|
||||
new CrashReportDatabaseMac(path));
|
||||
if (!database_mac->Initialize(may_create))
|
||||
database_mac.reset();
|
||||
|
||||
return scoped_ptr<CrashReportDatabase>(database_mac.release());
|
||||
return std::unique_ptr<CrashReportDatabase>(database_mac.release());
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize(
|
||||
std::unique_ptr<CrashReportDatabase> CrashReportDatabase::Initialize(
|
||||
const base::FilePath& path) {
|
||||
return InitializeInternal(path, true);
|
||||
}
|
||||
|
||||
// static
|
||||
scoped_ptr<CrashReportDatabase> CrashReportDatabase::InitializeWithoutCreating(
|
||||
const base::FilePath& path) {
|
||||
std::unique_ptr<CrashReportDatabase>
|
||||
CrashReportDatabase::InitializeWithoutCreating(const base::FilePath& path) {
|
||||
return InitializeInternal(path, false);
|
||||
}
|
||||
|
||||
|
@ -104,7 +104,7 @@ class CrashReportDatabaseTest : public testing::Test {
|
||||
|
||||
private:
|
||||
ScopedTempDir temp_dir_;
|
||||
scoped_ptr<CrashReportDatabase> db_;
|
||||
std::unique_ptr<CrashReportDatabase> db_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(CrashReportDatabaseTest);
|
||||
};
|
||||
|
@ -191,8 +191,8 @@ class Metadata {
|
||||
//! handle.
|
||||
~Metadata();
|
||||
|
||||
static scoped_ptr<Metadata> Create(const base::FilePath& metadata_file,
|
||||
const base::FilePath& report_dir);
|
||||
static std::unique_ptr<Metadata> Create(const base::FilePath& metadata_file,
|
||||
const base::FilePath& report_dir);
|
||||
|
||||
//! \brief Adds a new report to the set.
|
||||
//!
|
||||
@ -282,8 +282,8 @@ Metadata::~Metadata() {
|
||||
}
|
||||
|
||||
// static
|
||||
scoped_ptr<Metadata> Metadata::Create(const base::FilePath& metadata_file,
|
||||
const base::FilePath& report_dir) {
|
||||
std::unique_ptr<Metadata> Metadata::Create(const base::FilePath& metadata_file,
|
||||
const base::FilePath& report_dir) {
|
||||
// It is important that dwShareMode be non-zero so that concurrent access to
|
||||
// this file results in a successful open. This allows us to get to LockFileEx
|
||||
// which then blocks to guard access.
|
||||
@ -295,7 +295,7 @@ scoped_ptr<Metadata> Metadata::Create(const base::FilePath& metadata_file,
|
||||
FILE_ATTRIBUTE_NORMAL,
|
||||
nullptr);
|
||||
if (handle == kInvalidFileHandle)
|
||||
return scoped_ptr<Metadata>();
|
||||
return std::unique_ptr<Metadata>();
|
||||
// Not actually async, LockFileEx requires the Offset fields.
|
||||
OVERLAPPED overlapped = {0};
|
||||
if (!LockFileEx(handle,
|
||||
@ -305,10 +305,10 @@ scoped_ptr<Metadata> Metadata::Create(const base::FilePath& metadata_file,
|
||||
MAXDWORD,
|
||||
&overlapped)) {
|
||||
PLOG(ERROR) << "LockFileEx";
|
||||
return scoped_ptr<Metadata>();
|
||||
return std::unique_ptr<Metadata>();
|
||||
}
|
||||
|
||||
scoped_ptr<Metadata> metadata(new Metadata(handle, report_dir));
|
||||
std::unique_ptr<Metadata> metadata(new Metadata(handle, report_dir));
|
||||
// If Read() fails, for whatever reason (corruption, etc.) metadata will not
|
||||
// have been modified and will be in a clean empty state. We continue on and
|
||||
// return an empty database to hopefully recover. This means that existing
|
||||
@ -579,7 +579,7 @@ class CrashReportDatabaseWin : public CrashReportDatabase {
|
||||
OperationStatus DeleteReport(const UUID& uuid) override;
|
||||
|
||||
private:
|
||||
scoped_ptr<Metadata> AcquireMetadata();
|
||||
std::unique_ptr<Metadata> AcquireMetadata();
|
||||
|
||||
base::FilePath base_dir_;
|
||||
Settings settings_;
|
||||
@ -629,7 +629,7 @@ OperationStatus CrashReportDatabaseWin::PrepareNewCrashReport(
|
||||
NewReport** report) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<NewReport> new_report(new NewReport());
|
||||
std::unique_ptr<NewReport> new_report(new NewReport());
|
||||
if (!new_report->uuid.InitializeWithNew())
|
||||
return kFileSystemError;
|
||||
new_report->path = base_dir_.Append(kReportsDirectory)
|
||||
@ -651,11 +651,11 @@ OperationStatus CrashReportDatabaseWin::FinishedWritingCrashReport(
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
// Take ownership of the report.
|
||||
scoped_ptr<NewReport> scoped_report(report);
|
||||
std::unique_ptr<NewReport> scoped_report(report);
|
||||
// Take ownership of the file handle.
|
||||
ScopedFileHandle handle(report->handle);
|
||||
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
if (!metadata)
|
||||
return kDatabaseError;
|
||||
metadata->AddNewRecord(ReportDisk(scoped_report->uuid,
|
||||
@ -671,7 +671,7 @@ OperationStatus CrashReportDatabaseWin::ErrorWritingCrashReport(
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
// Take ownership of the report.
|
||||
scoped_ptr<NewReport> scoped_report(report);
|
||||
std::unique_ptr<NewReport> scoped_report(report);
|
||||
|
||||
// Close the outstanding handle.
|
||||
LoggingCloseFile(report->handle);
|
||||
@ -691,7 +691,7 @@ OperationStatus CrashReportDatabaseWin::LookUpCrashReport(const UUID& uuid,
|
||||
Report* report) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
if (!metadata)
|
||||
return kDatabaseError;
|
||||
// Find and return a copy of the matching report.
|
||||
@ -706,7 +706,7 @@ OperationStatus CrashReportDatabaseWin::GetPendingReports(
|
||||
std::vector<Report>* reports) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
return metadata ? metadata->FindReports(ReportState::kPending, reports)
|
||||
: kDatabaseError;
|
||||
}
|
||||
@ -715,7 +715,7 @@ OperationStatus CrashReportDatabaseWin::GetCompletedReports(
|
||||
std::vector<Report>* reports) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
return metadata ? metadata->FindReports(ReportState::kCompleted, reports)
|
||||
: kDatabaseError;
|
||||
}
|
||||
@ -725,7 +725,7 @@ OperationStatus CrashReportDatabaseWin::GetReportForUploading(
|
||||
const Report** report) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
if (!metadata)
|
||||
return kDatabaseError;
|
||||
// TODO(scottmg): After returning this report to the client, there is no way
|
||||
@ -757,8 +757,8 @@ OperationStatus CrashReportDatabaseWin::RecordUploadAttempt(
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
// Take ownership, allocated in GetReportForUploading.
|
||||
scoped_ptr<const Report> upload_report(report);
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<const Report> upload_report(report);
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
if (!metadata)
|
||||
return kDatabaseError;
|
||||
ReportDisk* report_disk;
|
||||
@ -785,7 +785,7 @@ OperationStatus CrashReportDatabaseWin::RecordUploadAttempt(
|
||||
OperationStatus CrashReportDatabaseWin::DeleteReport(const UUID& uuid) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
if (!metadata)
|
||||
return kDatabaseError;
|
||||
|
||||
@ -805,7 +805,7 @@ OperationStatus CrashReportDatabaseWin::DeleteReport(const UUID& uuid) {
|
||||
OperationStatus CrashReportDatabaseWin::SkipReportUpload(const UUID& uuid) {
|
||||
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
|
||||
|
||||
scoped_ptr<Metadata> metadata(AcquireMetadata());
|
||||
std::unique_ptr<Metadata> metadata(AcquireMetadata());
|
||||
if (!metadata)
|
||||
return kDatabaseError;
|
||||
ReportDisk* report_disk;
|
||||
@ -816,31 +816,32 @@ OperationStatus CrashReportDatabaseWin::SkipReportUpload(const UUID& uuid) {
|
||||
return os;
|
||||
}
|
||||
|
||||
scoped_ptr<Metadata> CrashReportDatabaseWin::AcquireMetadata() {
|
||||
std::unique_ptr<Metadata> CrashReportDatabaseWin::AcquireMetadata() {
|
||||
base::FilePath metadata_file = base_dir_.Append(kMetadataFileName);
|
||||
return Metadata::Create(metadata_file, base_dir_.Append(kReportsDirectory));
|
||||
}
|
||||
|
||||
scoped_ptr<CrashReportDatabase> InitializeInternal(
|
||||
const base::FilePath& path, bool may_create) {
|
||||
scoped_ptr<CrashReportDatabaseWin> database_win(
|
||||
std::unique_ptr<CrashReportDatabase> InitializeInternal(
|
||||
const base::FilePath& path,
|
||||
bool may_create) {
|
||||
std::unique_ptr<CrashReportDatabaseWin> database_win(
|
||||
new CrashReportDatabaseWin(path));
|
||||
return database_win->Initialize(may_create)
|
||||
? std::move(database_win)
|
||||
: scoped_ptr<CrashReportDatabaseWin>();
|
||||
: std::unique_ptr<CrashReportDatabaseWin>();
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
scoped_ptr<CrashReportDatabase> CrashReportDatabase::Initialize(
|
||||
std::unique_ptr<CrashReportDatabase> CrashReportDatabase::Initialize(
|
||||
const base::FilePath& path) {
|
||||
return InitializeInternal(path, true);
|
||||
}
|
||||
|
||||
// static
|
||||
scoped_ptr<CrashReportDatabase> CrashReportDatabase::InitializeWithoutCreating(
|
||||
const base::FilePath& path) {
|
||||
std::unique_ptr<CrashReportDatabase>
|
||||
CrashReportDatabase::InitializeWithoutCreating(const base::FilePath& path) {
|
||||
return InitializeInternal(path, false);
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
@ -146,7 +147,7 @@ class HandlerStarter final : public NotifyServer::DefaultInterface {
|
||||
DCHECK_EQ(right_type,
|
||||
implicit_cast<mach_msg_type_name_t>(MACH_MSG_TYPE_PORT_SEND));
|
||||
|
||||
scoped_ptr<HandlerStarter> handler_restarter;
|
||||
std::unique_ptr<HandlerStarter> handler_restarter;
|
||||
if (restartable) {
|
||||
handler_restarter.reset(new HandlerStarter());
|
||||
if (!handler_restarter->notify_port_.is_valid()) {
|
||||
|
@ -18,9 +18,10 @@
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/atomicops.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/scoped_generic.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
@ -255,7 +256,7 @@ bool CrashpadClient::StartHandler(
|
||||
startup_info.StartupInfo.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||
|
||||
std::vector<HANDLE> handle_list;
|
||||
scoped_ptr<uint8_t[]> proc_thread_attribute_list_storage;
|
||||
std::unique_ptr<uint8_t[]> proc_thread_attribute_list_storage;
|
||||
ScopedProcThreadAttributeList proc_thread_attribute_list_owner;
|
||||
|
||||
static const auto initialize_proc_thread_attribute_list =
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "build/build_config.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -66,11 +67,13 @@ void PruneCrashReportDatabase(CrashReportDatabase* database,
|
||||
}
|
||||
|
||||
// static
|
||||
scoped_ptr<PruneCondition> PruneCondition::GetDefault() {
|
||||
std::unique_ptr<PruneCondition> PruneCondition::GetDefault() {
|
||||
// DatabaseSizePruneCondition must be the LHS so that it is always evaluated,
|
||||
// due to the short-circuting behavior of BinaryPruneCondition.
|
||||
return make_scoped_ptr(new BinaryPruneCondition(BinaryPruneCondition::OR,
|
||||
new DatabaseSizePruneCondition(1024 * 128), new AgePruneCondition(365)));
|
||||
return base::WrapUnique(
|
||||
new BinaryPruneCondition(BinaryPruneCondition::OR,
|
||||
new DatabaseSizePruneCondition(1024 * 128),
|
||||
new AgePruneCondition(365)));
|
||||
}
|
||||
|
||||
static const time_t kSecondsInDay = 60 * 60 * 24;
|
||||
|
@ -18,8 +18,9 @@
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "client/crash_report_database.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -39,7 +40,7 @@ class PruneCondition;
|
||||
void PruneCrashReportDatabase(CrashReportDatabase* database,
|
||||
PruneCondition* condition);
|
||||
|
||||
scoped_ptr<PruneCondition> GetDefaultDatabasePruneCondition();
|
||||
std::unique_ptr<PruneCondition> GetDefaultDatabasePruneCondition();
|
||||
|
||||
//! \brief An abstract base class for evaluating crash reports for deletion.
|
||||
//!
|
||||
@ -56,7 +57,7 @@ class PruneCondition {
|
||||
//! of 128 MB.
|
||||
//!
|
||||
//! \return A PruneCondition for use with PruneCrashReportDatabase().
|
||||
static scoped_ptr<PruneCondition> GetDefault();
|
||||
static std::unique_ptr<PruneCondition> GetDefault();
|
||||
|
||||
virtual ~PruneCondition() {}
|
||||
|
||||
@ -136,8 +137,8 @@ class BinaryPruneCondition final : public PruneCondition {
|
||||
|
||||
private:
|
||||
const Operator op_;
|
||||
scoped_ptr<PruneCondition> lhs_;
|
||||
scoped_ptr<PruneCondition> rhs_;
|
||||
std::unique_ptr<PruneCondition> lhs_;
|
||||
std::unique_ptr<PruneCondition> rhs_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(BinaryPruneCondition);
|
||||
};
|
||||
|
@ -18,10 +18,10 @@
|
||||
#include <time.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
#include "client/settings.h"
|
||||
@ -316,7 +316,7 @@ CrashReportUploadThread::UploadResult CrashReportUploadThread::UploadReport(
|
||||
report->file_path,
|
||||
"application/octet-stream");
|
||||
|
||||
scoped_ptr<HTTPTransport> http_transport(HTTPTransport::Create());
|
||||
std::unique_ptr<HTTPTransport> http_transport(HTTPTransport::Create());
|
||||
http_transport->SetURL(url_);
|
||||
HTTPHeaders::value_type content_type =
|
||||
http_multipart_builder.GetContentType();
|
||||
|
@ -15,10 +15,10 @@
|
||||
#ifndef CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_
|
||||
#define CRASHPAD_HANDLER_CRASH_REPORT_UPLOAD_THREAD_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "client/crash_report_database.h"
|
||||
#include "util/thread/worker_thread.h"
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
@ -26,7 +27,6 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/scoped_generic.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
@ -386,7 +386,7 @@ int HandlerMain(int argc, char* argv[]) {
|
||||
}
|
||||
#endif // OS_MACOSX
|
||||
|
||||
scoped_ptr<CrashReportDatabase> database(CrashReportDatabase::Initialize(
|
||||
std::unique_ptr<CrashReportDatabase> database(CrashReportDatabase::Initialize(
|
||||
base::FilePath(ToolSupport::CommandLineArgumentToFilePathStringType(
|
||||
options.database))));
|
||||
if (!database) {
|
||||
|
@ -22,7 +22,7 @@ namespace crashpad {
|
||||
|
||||
PruneCrashReportThread::PruneCrashReportThread(
|
||||
CrashReportDatabase* database,
|
||||
scoped_ptr<PruneCondition> condition)
|
||||
std::unique_ptr<PruneCondition> condition)
|
||||
: thread_(60 * 60 * 24, this),
|
||||
condition_(std::move(condition)),
|
||||
database_(database) {}
|
||||
|
@ -15,8 +15,9 @@
|
||||
#ifndef CRASHPAD_HANDLER_PRUNE_CRASH_REPORTS_THREAD_H_
|
||||
#define CRASHPAD_HANDLER_PRUNE_CRASH_REPORTS_THREAD_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "util/thread/worker_thread.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -38,7 +39,7 @@ class PruneCrashReportThread : public WorkerThread::Delegate {
|
||||
//! \param[in] condition The condition used to evaluate crash reports for
|
||||
//! pruning.
|
||||
PruneCrashReportThread(CrashReportDatabase* database,
|
||||
scoped_ptr<PruneCondition> condition);
|
||||
std::unique_ptr<PruneCondition> condition);
|
||||
~PruneCrashReportThread();
|
||||
|
||||
//! \brief Starts a dedicated pruning thread.
|
||||
@ -64,7 +65,7 @@ class PruneCrashReportThread : public WorkerThread::Delegate {
|
||||
void DoWork(const WorkerThread* thread) override;
|
||||
|
||||
WorkerThread thread_;
|
||||
scoped_ptr<PruneCondition> condition_;
|
||||
std::unique_ptr<PruneCondition> condition_;
|
||||
CrashReportDatabase* database_; // weak
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(PruneCrashReportThread);
|
||||
|
@ -28,9 +28,9 @@ MinidumpContextWriter::~MinidumpContextWriter() {
|
||||
}
|
||||
|
||||
// static
|
||||
scoped_ptr<MinidumpContextWriter> MinidumpContextWriter::CreateFromSnapshot(
|
||||
const CPUContext* context_snapshot) {
|
||||
scoped_ptr<MinidumpContextWriter> context;
|
||||
std::unique_ptr<MinidumpContextWriter>
|
||||
MinidumpContextWriter::CreateFromSnapshot(const CPUContext* context_snapshot) {
|
||||
std::unique_ptr<MinidumpContextWriter> context;
|
||||
|
||||
switch (context_snapshot->architecture) {
|
||||
case kCPUArchitectureX86: {
|
||||
|
@ -17,8 +17,9 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_context.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
|
||||
@ -43,7 +44,7 @@ class MinidumpContextWriter : public internal::MinidumpWritable {
|
||||
//! context_snapshot. The returned object is initialized using the source
|
||||
//! data in \a context_snapshot. If \a context_snapshot is an unknown CPU
|
||||
//! type’s context, logs a message and returns `nullptr`.
|
||||
static scoped_ptr<MinidumpContextWriter> CreateFromSnapshot(
|
||||
static std::unique_ptr<MinidumpContextWriter> CreateFromSnapshot(
|
||||
const CPUContext* context_snapshot);
|
||||
|
||||
protected:
|
||||
|
@ -116,7 +116,7 @@ TEST(MinidumpContextWriter, CreateFromSnapshot_X86) {
|
||||
context_snapshot.x86 = &context_snapshot_x86;
|
||||
InitializeCPUContextX86(&context_snapshot, kSeed);
|
||||
|
||||
scoped_ptr<MinidumpContextWriter> context_writer =
|
||||
std::unique_ptr<MinidumpContextWriter> context_writer =
|
||||
MinidumpContextWriter::CreateFromSnapshot(&context_snapshot);
|
||||
ASSERT_TRUE(context_writer);
|
||||
|
||||
@ -138,7 +138,7 @@ TEST(MinidumpContextWriter, CreateFromSnapshot_AMD64) {
|
||||
context_snapshot.x86_64 = &context_snapshot_x86_64;
|
||||
InitializeCPUContextX86_64(&context_snapshot, kSeed);
|
||||
|
||||
scoped_ptr<MinidumpContextWriter> context_writer =
|
||||
std::unique_ptr<MinidumpContextWriter> context_writer =
|
||||
MinidumpContextWriter::CreateFromSnapshot(&context_snapshot);
|
||||
ASSERT_TRUE(context_writer);
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "minidump/minidump_module_crashpad_info_writer.h"
|
||||
#include "minidump/minidump_simple_string_dictionary_writer.h"
|
||||
#include "snapshot/process_snapshot.h"
|
||||
@ -49,14 +50,14 @@ void MinidumpCrashpadInfoWriter::InitializeFromSnapshot(
|
||||
SetClientID(client_id);
|
||||
|
||||
auto simple_annotations =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryWriter());
|
||||
simple_annotations->InitializeFromMap(
|
||||
process_snapshot->AnnotationsSimpleMap());
|
||||
if (simple_annotations->IsUseful()) {
|
||||
SetSimpleAnnotations(std::move(simple_annotations));
|
||||
}
|
||||
|
||||
auto modules = make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
|
||||
auto modules = base::WrapUnique(new MinidumpModuleCrashpadInfoListWriter());
|
||||
modules->InitializeFromSnapshot(process_snapshot->Modules());
|
||||
|
||||
if (modules->IsUseful()) {
|
||||
@ -77,14 +78,14 @@ void MinidumpCrashpadInfoWriter::SetClientID(const UUID& client_id) {
|
||||
}
|
||||
|
||||
void MinidumpCrashpadInfoWriter::SetSimpleAnnotations(
|
||||
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations) {
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
simple_annotations_ = std::move(simple_annotations);
|
||||
}
|
||||
|
||||
void MinidumpCrashpadInfoWriter::SetModuleList(
|
||||
scoped_ptr<MinidumpModuleCrashpadInfoListWriter> module_list) {
|
||||
std::unique_ptr<MinidumpModuleCrashpadInfoListWriter> module_list) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
module_list_ = std::move(module_list);
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "util/misc/uuid.h"
|
||||
@ -69,7 +69,7 @@ class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetSimpleAnnotations(
|
||||
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations);
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations);
|
||||
|
||||
//! \brief Arranges for MinidumpCrashpadInfo::module_list to point to the
|
||||
//! MinidumpModuleCrashpadInfoList object to be written by \a
|
||||
@ -80,7 +80,7 @@ class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetModuleList(
|
||||
scoped_ptr<MinidumpModuleCrashpadInfoListWriter> module_list);
|
||||
std::unique_ptr<MinidumpModuleCrashpadInfoListWriter> module_list);
|
||||
|
||||
//! \brief Determines whether the object is useful.
|
||||
//!
|
||||
@ -103,8 +103,8 @@ class MinidumpCrashpadInfoWriter final : public internal::MinidumpStreamWriter {
|
||||
|
||||
private:
|
||||
MinidumpCrashpadInfo crashpad_info_;
|
||||
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
||||
scoped_ptr<MinidumpModuleCrashpadInfoListWriter> module_list_;
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
||||
std::unique_ptr<MinidumpModuleCrashpadInfoListWriter> module_list_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpCrashpadInfoWriter);
|
||||
};
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_file_writer.h"
|
||||
@ -65,7 +66,8 @@ void GetCrashpadInfoStream(
|
||||
|
||||
TEST(MinidumpCrashpadInfoWriter, Empty) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto crashpad_info_writer = make_scoped_ptr(new MinidumpCrashpadInfoWriter());
|
||||
auto crashpad_info_writer =
|
||||
base::WrapUnique(new MinidumpCrashpadInfoWriter());
|
||||
EXPECT_FALSE(crashpad_info_writer->IsUseful());
|
||||
|
||||
minidump_file_writer.AddStream(std::move(crashpad_info_writer));
|
||||
@ -89,7 +91,8 @@ TEST(MinidumpCrashpadInfoWriter, Empty) {
|
||||
|
||||
TEST(MinidumpCrashpadInfoWriter, ReportAndClientID) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto crashpad_info_writer = make_scoped_ptr(new MinidumpCrashpadInfoWriter());
|
||||
auto crashpad_info_writer =
|
||||
base::WrapUnique(new MinidumpCrashpadInfoWriter());
|
||||
|
||||
UUID report_id;
|
||||
ASSERT_TRUE(
|
||||
@ -124,7 +127,8 @@ TEST(MinidumpCrashpadInfoWriter, ReportAndClientID) {
|
||||
|
||||
TEST(MinidumpCrashpadInfoWriter, SimpleAnnotations) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto crashpad_info_writer = make_scoped_ptr(new MinidumpCrashpadInfoWriter());
|
||||
auto crashpad_info_writer =
|
||||
base::WrapUnique(new MinidumpCrashpadInfoWriter());
|
||||
|
||||
const char kKey[] =
|
||||
"a thing that provides a means of gaining access to or understanding "
|
||||
@ -133,9 +137,9 @@ TEST(MinidumpCrashpadInfoWriter, SimpleAnnotations) {
|
||||
"the numerical amount denoted by an algebraic term; a magnitude, "
|
||||
"quantity, or number";
|
||||
auto simple_string_dictionary_writer =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryWriter());
|
||||
auto simple_string_dictionary_entry_writer =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
simple_string_dictionary_entry_writer->SetKeyValue(kKey, kValue);
|
||||
simple_string_dictionary_writer->AddEntry(
|
||||
std::move(simple_string_dictionary_entry_writer));
|
||||
@ -173,11 +177,12 @@ TEST(MinidumpCrashpadInfoWriter, CrashpadModuleList) {
|
||||
const uint32_t kMinidumpModuleListIndex = 3;
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto crashpad_info_writer = make_scoped_ptr(new MinidumpCrashpadInfoWriter());
|
||||
auto crashpad_info_writer =
|
||||
base::WrapUnique(new MinidumpCrashpadInfoWriter());
|
||||
|
||||
auto module_list_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
|
||||
auto module_writer = make_scoped_ptr(new MinidumpModuleCrashpadInfoWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoListWriter());
|
||||
auto module_writer = base::WrapUnique(new MinidumpModuleCrashpadInfoWriter());
|
||||
module_list_writer->AddModule(std::move(module_writer),
|
||||
kMinidumpModuleListIndex);
|
||||
crashpad_info_writer->SetModuleList(std::move(module_list_writer));
|
||||
@ -231,12 +236,12 @@ TEST(MinidumpCrashpadInfoWriter, InitializeFromSnapshot) {
|
||||
|
||||
// Test with a useless module, one that doesn’t carry anything that would
|
||||
// require MinidumpCrashpadInfo or any child object.
|
||||
auto process_snapshot = make_scoped_ptr(new TestProcessSnapshot());
|
||||
auto process_snapshot = base::WrapUnique(new TestProcessSnapshot());
|
||||
|
||||
auto module_snapshot = make_scoped_ptr(new TestModuleSnapshot());
|
||||
auto module_snapshot = base::WrapUnique(new TestModuleSnapshot());
|
||||
process_snapshot->AddModule(std::move(module_snapshot));
|
||||
|
||||
auto info_writer = make_scoped_ptr(new MinidumpCrashpadInfoWriter());
|
||||
auto info_writer = base::WrapUnique(new MinidumpCrashpadInfoWriter());
|
||||
info_writer->InitializeFromSnapshot(process_snapshot.get());
|
||||
EXPECT_FALSE(info_writer->IsUseful());
|
||||
|
||||
|
@ -46,13 +46,13 @@ void MinidumpExceptionWriter::InitializeFromSnapshot(
|
||||
SetExceptionAddress(exception_snapshot->ExceptionAddress());
|
||||
SetExceptionInformation(exception_snapshot->Codes());
|
||||
|
||||
scoped_ptr<MinidumpContextWriter> context =
|
||||
std::unique_ptr<MinidumpContextWriter> context =
|
||||
MinidumpContextWriter::CreateFromSnapshot(exception_snapshot->Context());
|
||||
SetContext(std::move(context));
|
||||
}
|
||||
|
||||
void MinidumpExceptionWriter::SetContext(
|
||||
scoped_ptr<MinidumpContextWriter> context) {
|
||||
std::unique_ptr<MinidumpContextWriter> context) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
context_ = std::move(context);
|
||||
|
@ -20,10 +20,10 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_thread_id_map.h"
|
||||
|
||||
@ -63,7 +63,7 @@ class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
|
||||
//! overall tree of internal::MinidumpWritable objects.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetContext(scoped_ptr<MinidumpContextWriter> context);
|
||||
void SetContext(std::unique_ptr<MinidumpContextWriter> context);
|
||||
|
||||
//! \brief Sets MINIDUMP_EXCEPTION_STREAM::ThreadId.
|
||||
void SetThreadID(uint32_t thread_id) { exception_.ThreadId = thread_id; }
|
||||
@ -116,7 +116,7 @@ class MinidumpExceptionWriter final : public internal::MinidumpStreamWriter {
|
||||
|
||||
private:
|
||||
MINIDUMP_EXCEPTION_STREAM exception_;
|
||||
scoped_ptr<MinidumpContextWriter> context_;
|
||||
std::unique_ptr<MinidumpContextWriter> context_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpExceptionWriter);
|
||||
};
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_context.h"
|
||||
#include "minidump/minidump_context_writer.h"
|
||||
@ -93,11 +94,11 @@ void ExpectExceptionStream(const MINIDUMP_EXCEPTION_STREAM* expected,
|
||||
|
||||
TEST(MinidumpExceptionWriter, Minimal) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter());
|
||||
auto exception_writer = base::WrapUnique(new MinidumpExceptionWriter());
|
||||
|
||||
const uint32_t kSeed = 100;
|
||||
|
||||
auto context_x86_writer = make_scoped_ptr(new MinidumpContextX86Writer());
|
||||
auto context_x86_writer = base::WrapUnique(new MinidumpContextX86Writer());
|
||||
InitializeMinidumpContextX86(context_x86_writer->context(), kSeed);
|
||||
exception_writer->SetContext(std::move(context_x86_writer));
|
||||
|
||||
@ -125,7 +126,7 @@ TEST(MinidumpExceptionWriter, Minimal) {
|
||||
|
||||
TEST(MinidumpExceptionWriter, Standard) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter());
|
||||
auto exception_writer = base::WrapUnique(new MinidumpExceptionWriter());
|
||||
|
||||
const uint32_t kSeed = 200;
|
||||
const uint32_t kThreadID = 1;
|
||||
@ -137,7 +138,7 @@ TEST(MinidumpExceptionWriter, Standard) {
|
||||
const uint64_t kExceptionInformation1 = 7;
|
||||
const uint64_t kExceptionInformation2 = 7;
|
||||
|
||||
auto context_x86_writer = make_scoped_ptr(new MinidumpContextX86Writer());
|
||||
auto context_x86_writer = base::WrapUnique(new MinidumpContextX86Writer());
|
||||
InitializeMinidumpContextX86(context_x86_writer->context(), kSeed);
|
||||
exception_writer->SetContext(std::move(context_x86_writer));
|
||||
|
||||
@ -229,7 +230,7 @@ TEST(MinidumpExceptionWriter, InitializeFromSnapshot) {
|
||||
MinidumpThreadIDMap thread_id_map;
|
||||
thread_id_map[kThreadID] = expect_exception.ThreadId;
|
||||
|
||||
auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter());
|
||||
auto exception_writer = base::WrapUnique(new MinidumpExceptionWriter());
|
||||
exception_writer->InitializeFromSnapshot(&exception_snapshot, thread_id_map);
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
@ -253,7 +254,7 @@ TEST(MinidumpExceptionWriter, InitializeFromSnapshot) {
|
||||
|
||||
TEST(MinidumpExceptionWriterDeathTest, NoContext) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto exception_writer = make_scoped_ptr(new MinidumpExceptionWriter());
|
||||
auto exception_writer = base::WrapUnique(new MinidumpExceptionWriter());
|
||||
|
||||
minidump_file_writer.AddStream(std::move(exception_writer));
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "minidump/minidump_crashpad_info_writer.h"
|
||||
#include "minidump/minidump_exception_writer.h"
|
||||
#include "minidump/minidump_handle_writer.h"
|
||||
@ -71,16 +72,16 @@ void MinidumpFileWriter::InitializeFromSnapshot(
|
||||
SetTimestamp(snapshot_time.tv_sec);
|
||||
|
||||
const SystemSnapshot* system_snapshot = process_snapshot->System();
|
||||
auto system_info = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
system_info->InitializeFromSnapshot(system_snapshot);
|
||||
AddStream(std::move(system_info));
|
||||
|
||||
auto misc_info = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
misc_info->InitializeFromSnapshot(process_snapshot);
|
||||
AddStream(std::move(misc_info));
|
||||
|
||||
auto memory_list = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto thread_list = make_scoped_ptr(new MinidumpThreadListWriter());
|
||||
auto memory_list = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
auto thread_list = base::WrapUnique(new MinidumpThreadListWriter());
|
||||
thread_list->SetMemoryListWriter(memory_list.get());
|
||||
MinidumpThreadIDMap thread_id_map;
|
||||
thread_list->InitializeFromSnapshot(process_snapshot->Threads(),
|
||||
@ -89,18 +90,18 @@ void MinidumpFileWriter::InitializeFromSnapshot(
|
||||
|
||||
const ExceptionSnapshot* exception_snapshot = process_snapshot->Exception();
|
||||
if (exception_snapshot) {
|
||||
auto exception = make_scoped_ptr(new MinidumpExceptionWriter());
|
||||
auto exception = base::WrapUnique(new MinidumpExceptionWriter());
|
||||
exception->InitializeFromSnapshot(exception_snapshot, thread_id_map);
|
||||
AddStream(std::move(exception));
|
||||
}
|
||||
|
||||
auto module_list = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_list = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
module_list->InitializeFromSnapshot(process_snapshot->Modules());
|
||||
AddStream(std::move(module_list));
|
||||
|
||||
for (const auto& module : process_snapshot->Modules()) {
|
||||
for (const UserMinidumpStream* stream : module->CustomMinidumpStreams()) {
|
||||
auto user_stream = make_scoped_ptr(new MinidumpUserStreamWriter());
|
||||
auto user_stream = base::WrapUnique(new MinidumpUserStreamWriter());
|
||||
user_stream->InitializeFromSnapshot(stream);
|
||||
AddStream(std::move(user_stream));
|
||||
}
|
||||
@ -109,12 +110,12 @@ void MinidumpFileWriter::InitializeFromSnapshot(
|
||||
auto unloaded_modules = process_snapshot->UnloadedModules();
|
||||
if (!unloaded_modules.empty()) {
|
||||
auto unloaded_module_list =
|
||||
make_scoped_ptr(new MinidumpUnloadedModuleListWriter());
|
||||
base::WrapUnique(new MinidumpUnloadedModuleListWriter());
|
||||
unloaded_module_list->InitializeFromSnapshot(unloaded_modules);
|
||||
AddStream(std::move(unloaded_module_list));
|
||||
}
|
||||
|
||||
auto crashpad_info = make_scoped_ptr(new MinidumpCrashpadInfoWriter());
|
||||
auto crashpad_info = base::WrapUnique(new MinidumpCrashpadInfoWriter());
|
||||
crashpad_info->InitializeFromSnapshot(process_snapshot);
|
||||
|
||||
// Since the MinidumpCrashpadInfo stream is an extension, it’s safe to not add
|
||||
@ -126,14 +127,15 @@ void MinidumpFileWriter::InitializeFromSnapshot(
|
||||
std::vector<const MemoryMapRegionSnapshot*> memory_map_snapshot =
|
||||
process_snapshot->MemoryMap();
|
||||
if (!memory_map_snapshot.empty()) {
|
||||
auto memory_info_list = make_scoped_ptr(new MinidumpMemoryInfoListWriter());
|
||||
auto memory_info_list =
|
||||
base::WrapUnique(new MinidumpMemoryInfoListWriter());
|
||||
memory_info_list->InitializeFromSnapshot(memory_map_snapshot);
|
||||
AddStream(std::move(memory_info_list));
|
||||
}
|
||||
|
||||
std::vector<HandleSnapshot> handles_snapshot = process_snapshot->Handles();
|
||||
if (!handles_snapshot.empty()) {
|
||||
auto handle_data_writer = make_scoped_ptr(new MinidumpHandleDataWriter());
|
||||
auto handle_data_writer = base::WrapUnique(new MinidumpHandleDataWriter());
|
||||
handle_data_writer->InitializeFromSnapshot(handles_snapshot);
|
||||
AddStream(std::move(handle_data_writer));
|
||||
}
|
||||
@ -152,7 +154,7 @@ void MinidumpFileWriter::SetTimestamp(time_t timestamp) {
|
||||
}
|
||||
|
||||
void MinidumpFileWriter::AddStream(
|
||||
scoped_ptr<internal::MinidumpStreamWriter> stream) {
|
||||
std::unique_ptr<internal::MinidumpStreamWriter> stream) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
MinidumpStreamType stream_type = stream->StreamType();
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include <dbghelp.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
@ -88,7 +88,7 @@ class MinidumpFileWriter final : public internal::MinidumpWritable {
|
||||
//! streams with the same stream type.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddStream(scoped_ptr<internal::MinidumpStreamWriter> stream);
|
||||
void AddStream(std::unique_ptr<internal::MinidumpStreamWriter> stream);
|
||||
|
||||
// MinidumpWritable:
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
@ -96,7 +97,7 @@ TEST(MinidumpFileWriter, OneStream) {
|
||||
const MinidumpStreamType kStreamType = static_cast<MinidumpStreamType>(0x4d);
|
||||
const uint8_t kStreamValue = 0x5a;
|
||||
auto stream =
|
||||
make_scoped_ptr(new TestStream(kStreamType, kStreamSize, kStreamValue));
|
||||
base::WrapUnique(new TestStream(kStreamType, kStreamSize, kStreamValue));
|
||||
minidump_file.AddStream(std::move(stream));
|
||||
|
||||
StringFile string_file;
|
||||
@ -134,7 +135,7 @@ TEST(MinidumpFileWriter, ThreeStreams) {
|
||||
const size_t kStream0Size = 5;
|
||||
const MinidumpStreamType kStream0Type = static_cast<MinidumpStreamType>(0x6d);
|
||||
const uint8_t kStream0Value = 0x5a;
|
||||
auto stream0 = make_scoped_ptr(
|
||||
auto stream0 = base::WrapUnique(
|
||||
new TestStream(kStream0Type, kStream0Size, kStream0Value));
|
||||
minidump_file.AddStream(std::move(stream0));
|
||||
|
||||
@ -144,14 +145,14 @@ TEST(MinidumpFileWriter, ThreeStreams) {
|
||||
const size_t kStream1Size = 3;
|
||||
const MinidumpStreamType kStream1Type = static_cast<MinidumpStreamType>(0x4d);
|
||||
const uint8_t kStream1Value = 0xa5;
|
||||
auto stream1 = make_scoped_ptr(
|
||||
auto stream1 = base::WrapUnique(
|
||||
new TestStream(kStream1Type, kStream1Size, kStream1Value));
|
||||
minidump_file.AddStream(std::move(stream1));
|
||||
|
||||
const size_t kStream2Size = 1;
|
||||
const MinidumpStreamType kStream2Type = static_cast<MinidumpStreamType>(0x7e);
|
||||
const uint8_t kStream2Value = 0x36;
|
||||
auto stream2 = make_scoped_ptr(
|
||||
auto stream2 = base::WrapUnique(
|
||||
new TestStream(kStream2Type, kStream2Size, kStream2Value));
|
||||
minidump_file.AddStream(std::move(stream2));
|
||||
|
||||
@ -219,7 +220,7 @@ TEST(MinidumpFileWriter, ZeroLengthStream) {
|
||||
|
||||
const size_t kStreamSize = 0;
|
||||
const MinidumpStreamType kStreamType = static_cast<MinidumpStreamType>(0x4d);
|
||||
auto stream = make_scoped_ptr(new TestStream(kStreamType, kStreamSize, 0));
|
||||
auto stream = base::WrapUnique(new TestStream(kStreamType, kStreamSize, 0));
|
||||
minidump_file.AddStream(std::move(stream));
|
||||
|
||||
StringFile string_file;
|
||||
@ -249,12 +250,12 @@ TEST(MinidumpFileWriter, InitializeFromSnapshot_Basic) {
|
||||
TestProcessSnapshot process_snapshot;
|
||||
process_snapshot.SetSnapshotTime(kSnapshotTimeval);
|
||||
|
||||
auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot());
|
||||
auto system_snapshot = base::WrapUnique(new TestSystemSnapshot());
|
||||
system_snapshot->SetCPUArchitecture(kCPUArchitectureX86_64);
|
||||
system_snapshot->SetOperatingSystem(SystemSnapshot::kOperatingSystemMacOSX);
|
||||
process_snapshot.SetSystem(std::move(system_snapshot));
|
||||
|
||||
auto peb_snapshot = make_scoped_ptr(new TestMemorySnapshot());
|
||||
auto peb_snapshot = base::WrapUnique(new TestMemorySnapshot());
|
||||
const uint64_t kPebAddress = 0x07f90000;
|
||||
peb_snapshot->SetAddress(kPebAddress);
|
||||
const size_t kPebSize = 0x280;
|
||||
@ -313,16 +314,16 @@ TEST(MinidumpFileWriter, InitializeFromSnapshot_Exception) {
|
||||
TestProcessSnapshot process_snapshot;
|
||||
process_snapshot.SetSnapshotTime(kSnapshotTimeval);
|
||||
|
||||
auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot());
|
||||
auto system_snapshot = base::WrapUnique(new TestSystemSnapshot());
|
||||
system_snapshot->SetCPUArchitecture(kCPUArchitectureX86_64);
|
||||
system_snapshot->SetOperatingSystem(SystemSnapshot::kOperatingSystemMacOSX);
|
||||
process_snapshot.SetSystem(std::move(system_snapshot));
|
||||
|
||||
auto thread_snapshot = make_scoped_ptr(new TestThreadSnapshot());
|
||||
auto thread_snapshot = base::WrapUnique(new TestThreadSnapshot());
|
||||
InitializeCPUContextX86_64(thread_snapshot->MutableContext(), 5);
|
||||
process_snapshot.AddThread(std::move(thread_snapshot));
|
||||
|
||||
auto exception_snapshot = make_scoped_ptr(new TestExceptionSnapshot());
|
||||
auto exception_snapshot = base::WrapUnique(new TestExceptionSnapshot());
|
||||
InitializeCPUContextX86_64(exception_snapshot->MutableContext(), 11);
|
||||
process_snapshot.SetException(std::move(exception_snapshot));
|
||||
|
||||
@ -330,7 +331,7 @@ TEST(MinidumpFileWriter, InitializeFromSnapshot_Exception) {
|
||||
// MinidumpModuleCrashpadInfo structure, so no such structure is expected to
|
||||
// be present, which will in turn suppress the addition of a
|
||||
// MinidumpCrashpadInfo stream.
|
||||
auto module_snapshot = make_scoped_ptr(new TestModuleSnapshot());
|
||||
auto module_snapshot = base::WrapUnique(new TestModuleSnapshot());
|
||||
process_snapshot.AddModule(std::move(module_snapshot));
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
@ -377,22 +378,22 @@ TEST(MinidumpFileWriter, InitializeFromSnapshot_CrashpadInfo) {
|
||||
TestProcessSnapshot process_snapshot;
|
||||
process_snapshot.SetSnapshotTime(kSnapshotTimeval);
|
||||
|
||||
auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot());
|
||||
auto system_snapshot = base::WrapUnique(new TestSystemSnapshot());
|
||||
system_snapshot->SetCPUArchitecture(kCPUArchitectureX86_64);
|
||||
system_snapshot->SetOperatingSystem(SystemSnapshot::kOperatingSystemMacOSX);
|
||||
process_snapshot.SetSystem(std::move(system_snapshot));
|
||||
|
||||
auto thread_snapshot = make_scoped_ptr(new TestThreadSnapshot());
|
||||
auto thread_snapshot = base::WrapUnique(new TestThreadSnapshot());
|
||||
InitializeCPUContextX86_64(thread_snapshot->MutableContext(), 5);
|
||||
process_snapshot.AddThread(std::move(thread_snapshot));
|
||||
|
||||
auto exception_snapshot = make_scoped_ptr(new TestExceptionSnapshot());
|
||||
auto exception_snapshot = base::WrapUnique(new TestExceptionSnapshot());
|
||||
InitializeCPUContextX86_64(exception_snapshot->MutableContext(), 11);
|
||||
process_snapshot.SetException(std::move(exception_snapshot));
|
||||
|
||||
// The module needs an annotation for the MinidumpCrashpadInfo stream to be
|
||||
// considered useful and be included.
|
||||
auto module_snapshot = make_scoped_ptr(new TestModuleSnapshot());
|
||||
auto module_snapshot = base::WrapUnique(new TestModuleSnapshot());
|
||||
std::vector<std::string> annotations_list(1, std::string("annotation"));
|
||||
module_snapshot->SetAnnotationsVector(annotations_list);
|
||||
process_snapshot.AddModule(std::move(module_snapshot));
|
||||
@ -444,7 +445,7 @@ TEST(MinidumpFileWriterDeathTest, SameStreamType) {
|
||||
const size_t kStream0Size = 5;
|
||||
const MinidumpStreamType kStream0Type = static_cast<MinidumpStreamType>(0x4d);
|
||||
const uint8_t kStream0Value = 0x5a;
|
||||
auto stream0 = make_scoped_ptr(
|
||||
auto stream0 = base::WrapUnique(
|
||||
new TestStream(kStream0Type, kStream0Size, kStream0Value));
|
||||
minidump_file.AddStream(std::move(stream0));
|
||||
|
||||
@ -452,7 +453,7 @@ TEST(MinidumpFileWriterDeathTest, SameStreamType) {
|
||||
const size_t kStream1Size = 3;
|
||||
const MinidumpStreamType kStream1Type = static_cast<MinidumpStreamType>(0x4d);
|
||||
const uint8_t kStream1Value = 0xa5;
|
||||
auto stream1 = make_scoped_ptr(
|
||||
auto stream1 = base::WrapUnique(
|
||||
new TestStream(kStream1Type, kStream1Size, kStream1Value));
|
||||
ASSERT_DEATH_CHECK(minidump_file.AddStream(std::move(stream1)),
|
||||
"already present");
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_file_writer.h"
|
||||
@ -57,7 +58,7 @@ void GetHandleDataStream(
|
||||
|
||||
TEST(MinidumpHandleDataWriter, Empty) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto handle_data_writer = make_scoped_ptr(new MinidumpHandleDataWriter());
|
||||
auto handle_data_writer = base::WrapUnique(new MinidumpHandleDataWriter());
|
||||
minidump_file_writer.AddStream(std::move(handle_data_writer));
|
||||
|
||||
StringFile string_file;
|
||||
@ -76,7 +77,7 @@ TEST(MinidumpHandleDataWriter, Empty) {
|
||||
|
||||
TEST(MinidumpHandleDataWriter, OneHandle) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto handle_data_writer = make_scoped_ptr(new MinidumpHandleDataWriter());
|
||||
auto handle_data_writer = base::WrapUnique(new MinidumpHandleDataWriter());
|
||||
|
||||
HandleSnapshot handle_snapshot;
|
||||
handle_snapshot.handle = 0x1234;
|
||||
@ -125,7 +126,7 @@ TEST(MinidumpHandleDataWriter, OneHandle) {
|
||||
|
||||
TEST(MinidumpHandleDataWriter, RepeatedTypeName) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto handle_data_writer = make_scoped_ptr(new MinidumpHandleDataWriter());
|
||||
auto handle_data_writer = base::WrapUnique(new MinidumpHandleDataWriter());
|
||||
|
||||
HandleSnapshot handle_snapshot;
|
||||
handle_snapshot.handle = 0x1234;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_file_writer.h"
|
||||
#include "minidump/test/minidump_file_writer_test_util.h"
|
||||
@ -58,7 +59,7 @@ void GetMemoryInfoListStream(
|
||||
TEST(MinidumpMemoryInfoWriter, Empty) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto memory_info_list_writer =
|
||||
make_scoped_ptr(new MinidumpMemoryInfoListWriter());
|
||||
base::WrapUnique(new MinidumpMemoryInfoListWriter());
|
||||
minidump_file_writer.AddStream(std::move(memory_info_list_writer));
|
||||
|
||||
StringFile string_file;
|
||||
@ -78,9 +79,9 @@ TEST(MinidumpMemoryInfoWriter, Empty) {
|
||||
TEST(MinidumpMemoryInfoWriter, OneRegion) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto memory_info_list_writer =
|
||||
make_scoped_ptr(new MinidumpMemoryInfoListWriter());
|
||||
base::WrapUnique(new MinidumpMemoryInfoListWriter());
|
||||
|
||||
auto memory_map_region = make_scoped_ptr(new TestMemoryMapRegionSnapshot());
|
||||
auto memory_map_region = base::WrapUnique(new TestMemoryMapRegionSnapshot());
|
||||
|
||||
MINIDUMP_MEMORY_INFO mmi = {0};
|
||||
mmi.BaseAddress = 0x12340000;
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "base/auto_reset.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "snapshot/memory_snapshot.h"
|
||||
#include "util/file/file_writer.h"
|
||||
#include "util/numeric/safe_assignment.h"
|
||||
@ -81,9 +82,9 @@ class SnapshotMinidumpMemoryWriter final : public MinidumpMemoryWriter,
|
||||
MinidumpMemoryWriter::~MinidumpMemoryWriter() {
|
||||
}
|
||||
|
||||
scoped_ptr<MinidumpMemoryWriter> MinidumpMemoryWriter::CreateFromSnapshot(
|
||||
std::unique_ptr<MinidumpMemoryWriter> MinidumpMemoryWriter::CreateFromSnapshot(
|
||||
const MemorySnapshot* memory_snapshot) {
|
||||
return make_scoped_ptr(new SnapshotMinidumpMemoryWriter(memory_snapshot));
|
||||
return base::WrapUnique(new SnapshotMinidumpMemoryWriter(memory_snapshot));
|
||||
}
|
||||
|
||||
const MINIDUMP_MEMORY_DESCRIPTOR*
|
||||
@ -177,14 +178,14 @@ void MinidumpMemoryListWriter::AddFromSnapshot(
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
for (const MemorySnapshot* memory_snapshot : memory_snapshots) {
|
||||
scoped_ptr<MinidumpMemoryWriter> memory =
|
||||
std::unique_ptr<MinidumpMemoryWriter> memory =
|
||||
MinidumpMemoryWriter::CreateFromSnapshot(memory_snapshot);
|
||||
AddMemory(std::move(memory));
|
||||
}
|
||||
}
|
||||
|
||||
void MinidumpMemoryListWriter::AddMemory(
|
||||
scoped_ptr<MinidumpMemoryWriter> memory_writer) {
|
||||
std::unique_ptr<MinidumpMemoryWriter> memory_writer) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
AddExtraMemory(memory_writer.get());
|
||||
|
@ -20,10 +20,10 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
#include "util/file/file_io.h"
|
||||
@ -52,7 +52,7 @@ class MinidumpMemoryWriter : public internal::MinidumpWritable {
|
||||
//!
|
||||
//! \return An object of a MinidumpMemoryWriter subclass initialized using the
|
||||
//! source data in \a memory_snapshot.
|
||||
static scoped_ptr<MinidumpMemoryWriter> CreateFromSnapshot(
|
||||
static std::unique_ptr<MinidumpMemoryWriter> CreateFromSnapshot(
|
||||
const MemorySnapshot* memory_snapshot);
|
||||
|
||||
//! \brief Returns a MINIDUMP_MEMORY_DESCRIPTOR referencing the data that this
|
||||
@ -152,7 +152,7 @@ class MinidumpMemoryListWriter final : public internal::MinidumpStreamWriter {
|
||||
//! the overall tree of internal::MinidumpWritable objects.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddMemory(scoped_ptr<MinidumpMemoryWriter> memory_writer);
|
||||
void AddMemory(std::unique_ptr<MinidumpMemoryWriter> memory_writer);
|
||||
|
||||
//! \brief Adds a MinidumpMemoryWriter that’s a child of another
|
||||
//! internal::MinidumpWritable object to the MINIDUMP_MEMORY_LIST.
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "base/format_macros.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
@ -76,7 +77,7 @@ void GetMemoryListStream(const std::string& file_contents,
|
||||
|
||||
TEST(MinidumpMemoryWriter, EmptyMemoryList) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto memory_list_writer = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto memory_list_writer = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
|
||||
minidump_file_writer.AddStream(std::move(memory_list_writer));
|
||||
|
||||
@ -96,13 +97,13 @@ TEST(MinidumpMemoryWriter, EmptyMemoryList) {
|
||||
|
||||
TEST(MinidumpMemoryWriter, OneMemoryRegion) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto memory_list_writer = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto memory_list_writer = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
|
||||
const uint64_t kBaseAddress = 0xfedcba9876543210;
|
||||
const uint64_t kSize = 0x1000;
|
||||
const uint8_t kValue = 'm';
|
||||
|
||||
auto memory_writer = make_scoped_ptr(
|
||||
auto memory_writer = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kBaseAddress, kSize, kValue));
|
||||
memory_list_writer->AddMemory(std::move(memory_writer));
|
||||
|
||||
@ -131,7 +132,7 @@ TEST(MinidumpMemoryWriter, OneMemoryRegion) {
|
||||
|
||||
TEST(MinidumpMemoryWriter, TwoMemoryRegions) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto memory_list_writer = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto memory_list_writer = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
|
||||
const uint64_t kBaseAddress0 = 0xc0ffee;
|
||||
const uint64_t kSize0 = 0x0100;
|
||||
@ -140,10 +141,10 @@ TEST(MinidumpMemoryWriter, TwoMemoryRegions) {
|
||||
const uint64_t kSize1 = 0x0200;
|
||||
const uint8_t kValue1 = '!';
|
||||
|
||||
auto memory_writer_0 = make_scoped_ptr(
|
||||
auto memory_writer_0 = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kBaseAddress0, kSize0, kValue0));
|
||||
memory_list_writer->AddMemory(std::move(memory_writer_0));
|
||||
auto memory_writer_1 = make_scoped_ptr(
|
||||
auto memory_writer_1 = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kBaseAddress1, kSize1, kValue1));
|
||||
memory_list_writer->AddMemory(std::move(memory_writer_1));
|
||||
|
||||
@ -241,9 +242,9 @@ TEST(MinidumpMemoryWriter, ExtraMemory) {
|
||||
const size_t kSize0 = 0x0400;
|
||||
const uint8_t kValue0 = '1';
|
||||
auto test_memory_stream =
|
||||
make_scoped_ptr(new TestMemoryStream(kBaseAddress0, kSize0, kValue0));
|
||||
base::WrapUnique(new TestMemoryStream(kBaseAddress0, kSize0, kValue0));
|
||||
|
||||
auto memory_list_writer = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto memory_list_writer = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
memory_list_writer->AddExtraMemory(test_memory_stream->memory());
|
||||
|
||||
minidump_file_writer.AddStream(std::move(test_memory_stream));
|
||||
@ -252,7 +253,7 @@ TEST(MinidumpMemoryWriter, ExtraMemory) {
|
||||
const size_t kSize1 = 0x0400;
|
||||
const uint8_t kValue1 = 'm';
|
||||
|
||||
auto memory_writer = make_scoped_ptr(
|
||||
auto memory_writer = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kBaseAddress1, kSize1, kValue1));
|
||||
memory_list_writer->AddMemory(std::move(memory_writer));
|
||||
|
||||
@ -330,7 +331,7 @@ TEST(MinidumpMemoryWriter, AddFromSnapshot) {
|
||||
memory_snapshots.push_back(memory_snapshot);
|
||||
}
|
||||
|
||||
auto memory_list_writer = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto memory_list_writer = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
memory_list_writer->AddFromSnapshot(memory_snapshots);
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
|
@ -16,12 +16,13 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "gtest/gtest.h"
|
||||
@ -165,7 +166,7 @@ void ExpectMiscInfoEqual<MINIDUMP_MISC_INFO_4>(
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, Empty) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
minidump_file_writer.AddStream(std::move(misc_info_writer));
|
||||
|
||||
@ -182,7 +183,7 @@ TEST(MinidumpMiscInfoWriter, Empty) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, ProcessId) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kProcessId = 12345;
|
||||
|
||||
@ -205,7 +206,7 @@ TEST(MinidumpMiscInfoWriter, ProcessId) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, ProcessTimes) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const time_t kProcessCreateTime = 0x15252f00;
|
||||
const uint32_t kProcessUserTime = 10;
|
||||
@ -233,7 +234,7 @@ TEST(MinidumpMiscInfoWriter, ProcessTimes) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, ProcessorPowerInfo) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kProcessorMaxMhz = 2800;
|
||||
const uint32_t kProcessorCurrentMhz = 2300;
|
||||
@ -268,7 +269,7 @@ TEST(MinidumpMiscInfoWriter, ProcessorPowerInfo) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, ProcessIntegrityLevel) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kProcessIntegrityLevel = 0x2000;
|
||||
|
||||
@ -291,7 +292,7 @@ TEST(MinidumpMiscInfoWriter, ProcessIntegrityLevel) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, ProcessExecuteFlags) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kProcessExecuteFlags = 0x13579bdf;
|
||||
|
||||
@ -314,7 +315,7 @@ TEST(MinidumpMiscInfoWriter, ProcessExecuteFlags) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, ProtectedProcess) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kProtectedProcess = 1;
|
||||
|
||||
@ -337,7 +338,7 @@ TEST(MinidumpMiscInfoWriter, ProtectedProcess) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, TimeZone) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kTimeZoneId = 2;
|
||||
const int32_t kBias = 300;
|
||||
@ -394,7 +395,7 @@ TEST(MinidumpMiscInfoWriter, TimeZoneStringsOverflow) {
|
||||
// to the widths of their fields.
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kTimeZoneId = 2;
|
||||
const int32_t kBias = 300;
|
||||
@ -452,7 +453,7 @@ TEST(MinidumpMiscInfoWriter, TimeZoneStringsOverflow) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, BuildStrings) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const char kBuildString[] = "build string";
|
||||
const char kDebugBuildString[] = "debug build string";
|
||||
@ -487,7 +488,7 @@ TEST(MinidumpMiscInfoWriter, BuildStringsOverflow) {
|
||||
// widths of their fields.
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
MINIDUMP_MISC_INFO_4 tmp;
|
||||
ALLOW_UNUSED_LOCAL(tmp);
|
||||
@ -521,7 +522,7 @@ TEST(MinidumpMiscInfoWriter, BuildStringsOverflow) {
|
||||
|
||||
TEST(MinidumpMiscInfoWriter, Everything) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
|
||||
const uint32_t kProcessId = 12345;
|
||||
const time_t kProcessCreateTime = 0x15252f00;
|
||||
@ -686,7 +687,7 @@ TEST(MinidumpMiscInfoWriter, InitializeFromSnapshot) {
|
||||
process_snapshot.SetProcessStartTime(kStartTime);
|
||||
process_snapshot.SetProcessCPUTimes(kUserCPUTime, kSystemCPUTime);
|
||||
|
||||
auto system_snapshot = make_scoped_ptr(new TestSystemSnapshot());
|
||||
auto system_snapshot = base::WrapUnique(new TestSystemSnapshot());
|
||||
const uint64_t kHzPerMHz = static_cast<uint64_t>(1E6);
|
||||
system_snapshot->SetCPUFrequency(
|
||||
expect_misc_info.ProcessorCurrentMhz * kHzPerMHz,
|
||||
@ -702,7 +703,7 @@ TEST(MinidumpMiscInfoWriter, InitializeFromSnapshot) {
|
||||
|
||||
process_snapshot.SetSystem(std::move(system_snapshot));
|
||||
|
||||
auto misc_info_writer = make_scoped_ptr(new MinidumpMiscInfoWriter());
|
||||
auto misc_info_writer = base::WrapUnique(new MinidumpMiscInfoWriter());
|
||||
misc_info_writer->InitializeFromSnapshot(&process_snapshot);
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "minidump/minidump_simple_string_dictionary_writer.h"
|
||||
#include "snapshot/module_snapshot.h"
|
||||
#include "util/file/file_writer.h"
|
||||
@ -41,14 +42,14 @@ void MinidumpModuleCrashpadInfoWriter::InitializeFromSnapshot(
|
||||
DCHECK(!list_annotations_);
|
||||
DCHECK(!simple_annotations_);
|
||||
|
||||
auto list_annotations = make_scoped_ptr(new MinidumpUTF8StringListWriter());
|
||||
auto list_annotations = base::WrapUnique(new MinidumpUTF8StringListWriter());
|
||||
list_annotations->InitializeFromVector(module_snapshot->AnnotationsVector());
|
||||
if (list_annotations->IsUseful()) {
|
||||
SetListAnnotations(std::move(list_annotations));
|
||||
}
|
||||
|
||||
auto simple_annotations =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryWriter());
|
||||
simple_annotations->InitializeFromMap(
|
||||
module_snapshot->AnnotationsSimpleMap());
|
||||
if (simple_annotations->IsUseful()) {
|
||||
@ -57,14 +58,14 @@ void MinidumpModuleCrashpadInfoWriter::InitializeFromSnapshot(
|
||||
}
|
||||
|
||||
void MinidumpModuleCrashpadInfoWriter::SetListAnnotations(
|
||||
scoped_ptr<MinidumpUTF8StringListWriter> list_annotations) {
|
||||
std::unique_ptr<MinidumpUTF8StringListWriter> list_annotations) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
list_annotations_ = std::move(list_annotations);
|
||||
}
|
||||
|
||||
void MinidumpModuleCrashpadInfoWriter::SetSimpleAnnotations(
|
||||
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations) {
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
simple_annotations_ = std::move(simple_annotations);
|
||||
@ -141,7 +142,7 @@ void MinidumpModuleCrashpadInfoListWriter::InitializeFromSnapshot(
|
||||
for (size_t index = 0; index < count; ++index) {
|
||||
const ModuleSnapshot* module_snapshot = module_snapshots[index];
|
||||
|
||||
auto module = make_scoped_ptr(new MinidumpModuleCrashpadInfoWriter());
|
||||
auto module = base::WrapUnique(new MinidumpModuleCrashpadInfoWriter());
|
||||
module->InitializeFromSnapshot(module_snapshot);
|
||||
if (module->IsUseful()) {
|
||||
AddModule(std::move(module), index);
|
||||
@ -150,7 +151,7 @@ void MinidumpModuleCrashpadInfoListWriter::InitializeFromSnapshot(
|
||||
}
|
||||
|
||||
void MinidumpModuleCrashpadInfoListWriter::AddModule(
|
||||
scoped_ptr<MinidumpModuleCrashpadInfoWriter> module_crashpad_info,
|
||||
std::unique_ptr<MinidumpModuleCrashpadInfoWriter> module_crashpad_info,
|
||||
size_t minidump_module_list_index) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
DCHECK_EQ(module_crashpad_infos_.size(), module_crashpad_info_links_.size());
|
||||
|
@ -18,10 +18,10 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_string_writer.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
@ -62,7 +62,7 @@ class MinidumpModuleCrashpadInfoWriter final
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetListAnnotations(
|
||||
scoped_ptr<MinidumpUTF8StringListWriter> list_annotations);
|
||||
std::unique_ptr<MinidumpUTF8StringListWriter> list_annotations);
|
||||
|
||||
//! \brief Arranges for MinidumpModuleCrashpadInfo::simple_annotations to
|
||||
//! point to the MinidumpSimpleStringDictionaryWriter object to be written
|
||||
@ -73,7 +73,7 @@ class MinidumpModuleCrashpadInfoWriter final
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetSimpleAnnotations(
|
||||
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations);
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations);
|
||||
|
||||
//! \brief Determines whether the object is useful.
|
||||
//!
|
||||
@ -93,8 +93,8 @@ class MinidumpModuleCrashpadInfoWriter final
|
||||
|
||||
private:
|
||||
MinidumpModuleCrashpadInfo module_;
|
||||
scoped_ptr<MinidumpUTF8StringListWriter> list_annotations_;
|
||||
scoped_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
||||
std::unique_ptr<MinidumpUTF8StringListWriter> list_annotations_;
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryWriter> simple_annotations_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleCrashpadInfoWriter);
|
||||
};
|
||||
@ -134,7 +134,7 @@ class MinidumpModuleCrashpadInfoListWriter final
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddModule(
|
||||
scoped_ptr<MinidumpModuleCrashpadInfoWriter> module_crashpad_info,
|
||||
std::unique_ptr<MinidumpModuleCrashpadInfoWriter> module_crashpad_info,
|
||||
size_t minidump_module_list_index);
|
||||
|
||||
//! \brief Determines whether the object is useful.
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_simple_string_dictionary_writer.h"
|
||||
@ -60,7 +61,7 @@ TEST(MinidumpModuleCrashpadInfoWriter, EmptyList) {
|
||||
StringFile string_file;
|
||||
|
||||
auto module_list_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoListWriter());
|
||||
EXPECT_FALSE(module_list_writer->IsUseful());
|
||||
|
||||
EXPECT_TRUE(module_list_writer->WriteEverything(&string_file));
|
||||
@ -76,8 +77,8 @@ TEST(MinidumpModuleCrashpadInfoWriter, EmptyModule) {
|
||||
StringFile string_file;
|
||||
|
||||
auto module_list_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
|
||||
auto module_writer = make_scoped_ptr(new MinidumpModuleCrashpadInfoWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoListWriter());
|
||||
auto module_writer = base::WrapUnique(new MinidumpModuleCrashpadInfoWriter());
|
||||
EXPECT_FALSE(module_writer->IsUseful());
|
||||
module_list_writer->AddModule(std::move(module_writer), 0);
|
||||
|
||||
@ -116,16 +117,17 @@ TEST(MinidumpModuleCrashpadInfoWriter, FullModule) {
|
||||
StringFile string_file;
|
||||
|
||||
auto module_list_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoListWriter());
|
||||
|
||||
auto module_writer = make_scoped_ptr(new MinidumpModuleCrashpadInfoWriter());
|
||||
auto string_list_writer = make_scoped_ptr(new MinidumpUTF8StringListWriter());
|
||||
auto module_writer = base::WrapUnique(new MinidumpModuleCrashpadInfoWriter());
|
||||
auto string_list_writer =
|
||||
base::WrapUnique(new MinidumpUTF8StringListWriter());
|
||||
string_list_writer->InitializeFromVector(vector);
|
||||
module_writer->SetListAnnotations(std::move(string_list_writer));
|
||||
auto simple_string_dictionary_writer =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryWriter());
|
||||
auto simple_string_dictionary_entry_writer =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
simple_string_dictionary_entry_writer->SetKeyValue(kKey, kValue);
|
||||
simple_string_dictionary_writer->AddEntry(
|
||||
std::move(simple_string_dictionary_entry_writer));
|
||||
@ -205,14 +207,14 @@ TEST(MinidumpModuleCrashpadInfoWriter, ThreeModules) {
|
||||
StringFile string_file;
|
||||
|
||||
auto module_list_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoListWriter());
|
||||
|
||||
auto module_writer_0 =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoWriter());
|
||||
auto simple_string_dictionary_writer_0 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryWriter());
|
||||
auto simple_string_dictionary_entry_writer_0 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
simple_string_dictionary_entry_writer_0->SetKeyValue(kKey0, kValue0);
|
||||
simple_string_dictionary_writer_0->AddEntry(
|
||||
std::move(simple_string_dictionary_entry_writer_0));
|
||||
@ -223,22 +225,22 @@ TEST(MinidumpModuleCrashpadInfoWriter, ThreeModules) {
|
||||
kMinidumpModuleListIndex0);
|
||||
|
||||
auto module_writer_1 =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoWriter());
|
||||
EXPECT_FALSE(module_writer_1->IsUseful());
|
||||
module_list_writer->AddModule(std::move(module_writer_1),
|
||||
kMinidumpModuleListIndex1);
|
||||
|
||||
auto module_writer_2 =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoWriter());
|
||||
auto simple_string_dictionary_writer_2 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryWriter());
|
||||
auto simple_string_dictionary_entry_writer_2a =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
simple_string_dictionary_entry_writer_2a->SetKeyValue(kKey2A, kValue2A);
|
||||
simple_string_dictionary_writer_2->AddEntry(
|
||||
std::move(simple_string_dictionary_entry_writer_2a));
|
||||
auto simple_string_dictionary_entry_writer_2b =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
simple_string_dictionary_entry_writer_2b->SetKeyValue(kKey2B, kValue2B);
|
||||
simple_string_dictionary_writer_2->AddEntry(
|
||||
std::move(simple_string_dictionary_entry_writer_2b));
|
||||
@ -374,7 +376,7 @@ TEST(MinidumpModuleCrashpadInfoWriter, InitializeFromSnapshot) {
|
||||
module_snapshots.push_back(&module_snapshot_3);
|
||||
|
||||
auto module_list_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCrashpadInfoListWriter());
|
||||
base::WrapUnique(new MinidumpModuleCrashpadInfoListWriter());
|
||||
module_list_writer->InitializeFromSnapshot(module_snapshots);
|
||||
EXPECT_TRUE(module_list_writer->IsUseful());
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "minidump/minidump_string_writer.h"
|
||||
#include "minidump/minidump_writer_util.h"
|
||||
@ -241,7 +242,7 @@ void MinidumpModuleWriter::InitializeFromSnapshot(
|
||||
SetFileTypeAndSubtype(file_type, VFT2_UNKNOWN);
|
||||
|
||||
auto codeview_record =
|
||||
make_scoped_ptr(new MinidumpModuleCodeViewRecordPDB70Writer());
|
||||
base::WrapUnique(new MinidumpModuleCodeViewRecordPDB70Writer());
|
||||
codeview_record->InitializeFromSnapshot(module_snapshot);
|
||||
SetCodeViewRecord(std::move(codeview_record));
|
||||
}
|
||||
@ -262,14 +263,14 @@ void MinidumpModuleWriter::SetName(const std::string& name) {
|
||||
}
|
||||
|
||||
void MinidumpModuleWriter::SetCodeViewRecord(
|
||||
scoped_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record) {
|
||||
std::unique_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
codeview_record_ = std::move(codeview_record);
|
||||
}
|
||||
|
||||
void MinidumpModuleWriter::SetMiscDebugRecord(
|
||||
scoped_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record) {
|
||||
std::unique_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
misc_debug_record_ = std::move(misc_debug_record);
|
||||
@ -382,14 +383,14 @@ void MinidumpModuleListWriter::InitializeFromSnapshot(
|
||||
DCHECK(modules_.empty());
|
||||
|
||||
for (const ModuleSnapshot* module_snapshot : module_snapshots) {
|
||||
auto module = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module->InitializeFromSnapshot(module_snapshot);
|
||||
AddModule(std::move(module));
|
||||
}
|
||||
}
|
||||
|
||||
void MinidumpModuleListWriter::AddModule(
|
||||
scoped_ptr<MinidumpModuleWriter> module) {
|
||||
std::unique_ptr<MinidumpModuleWriter> module) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
modules_.push_back(module.release());
|
||||
|
@ -21,11 +21,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
@ -218,7 +218,7 @@ class MinidumpModuleWriter final : public internal::MinidumpWritable {
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetCodeViewRecord(
|
||||
scoped_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record);
|
||||
std::unique_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record);
|
||||
|
||||
//! \brief Arranges for MINIDUMP_MODULE::MiscRecord to point to an
|
||||
//! IMAGE_DEBUG_MISC object to be written by \a misc_debug_record.
|
||||
@ -228,7 +228,7 @@ class MinidumpModuleWriter final : public internal::MinidumpWritable {
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetMiscDebugRecord(
|
||||
scoped_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record);
|
||||
std::unique_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record);
|
||||
|
||||
//! \brief Sets IMAGE_DEBUG_MISC::BaseOfImage.
|
||||
void SetImageBaseAddress(uint64_t image_base_address) {
|
||||
@ -298,9 +298,9 @@ class MinidumpModuleWriter final : public internal::MinidumpWritable {
|
||||
|
||||
private:
|
||||
MINIDUMP_MODULE module_;
|
||||
scoped_ptr<internal::MinidumpUTF16StringWriter> name_;
|
||||
scoped_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record_;
|
||||
scoped_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record_;
|
||||
std::unique_ptr<internal::MinidumpUTF16StringWriter> name_;
|
||||
std::unique_ptr<MinidumpModuleCodeViewRecordWriter> codeview_record_;
|
||||
std::unique_ptr<MinidumpModuleMiscDebugRecordWriter> misc_debug_record_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpModuleWriter);
|
||||
};
|
||||
@ -329,7 +329,7 @@ class MinidumpModuleListWriter final : public internal::MinidumpStreamWriter {
|
||||
//! overall tree of internal::MinidumpWritable objects.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddModule(scoped_ptr<MinidumpModuleWriter> module);
|
||||
void AddModule(std::unique_ptr<MinidumpModuleWriter> module);
|
||||
|
||||
protected:
|
||||
// MinidumpWritable:
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/format_macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "gtest/gtest.h"
|
||||
@ -64,7 +65,7 @@ void GetModuleListStream(const std::string& file_contents,
|
||||
|
||||
TEST(MinidumpModuleWriter, EmptyModuleList) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_list_writer = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
|
||||
minidump_file_writer.AddStream(std::move(module_list_writer));
|
||||
|
||||
@ -267,11 +268,11 @@ void ExpectModule(const MINIDUMP_MODULE* expected,
|
||||
|
||||
TEST(MinidumpModuleWriter, EmptyModule) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_list_writer = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
|
||||
const char kModuleName[] = "test_executable";
|
||||
|
||||
auto module_writer = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module_writer = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module_writer->SetName(kModuleName);
|
||||
|
||||
module_list_writer->AddModule(std::move(module_writer));
|
||||
@ -306,7 +307,7 @@ TEST(MinidumpModuleWriter, EmptyModule) {
|
||||
|
||||
TEST(MinidumpModuleWriter, OneModule) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_list_writer = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
|
||||
const char kModuleName[] = "statically_linked";
|
||||
const uint64_t kModuleBase = 0x10da69000;
|
||||
@ -335,7 +336,7 @@ TEST(MinidumpModuleWriter, OneModule) {
|
||||
const char kDebugName[] = "statical.dbg";
|
||||
const bool kDebugUTF16 = false;
|
||||
|
||||
auto module_writer = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module_writer = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module_writer->SetName(kModuleName);
|
||||
module_writer->SetImageBaseAddress(kModuleBase);
|
||||
module_writer->SetImageSize(kModuleSize);
|
||||
@ -354,13 +355,13 @@ TEST(MinidumpModuleWriter, OneModule) {
|
||||
module_writer->SetFileTypeAndSubtype(kFileType, kFileSubtype);
|
||||
|
||||
auto codeview_pdb70_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCodeViewRecordPDB70Writer());
|
||||
base::WrapUnique(new MinidumpModuleCodeViewRecordPDB70Writer());
|
||||
codeview_pdb70_writer->SetPDBName(kPDBName);
|
||||
codeview_pdb70_writer->SetUUIDAndAge(pdb_uuid, kPDBAge);
|
||||
module_writer->SetCodeViewRecord(std::move(codeview_pdb70_writer));
|
||||
|
||||
auto misc_debug_writer =
|
||||
make_scoped_ptr(new MinidumpModuleMiscDebugRecordWriter());
|
||||
base::WrapUnique(new MinidumpModuleMiscDebugRecordWriter());
|
||||
misc_debug_writer->SetDataType(kDebugType);
|
||||
misc_debug_writer->SetData(kDebugName, kDebugUTF16);
|
||||
module_writer->SetMiscDebugRecord(std::move(misc_debug_writer));
|
||||
@ -415,7 +416,7 @@ TEST(MinidumpModuleWriter, OneModule_CodeViewUsesPDB20_MiscUsesUTF16) {
|
||||
// alternatives, a PDB 2.0 link as the CodeView record and an IMAGE_DEBUG_MISC
|
||||
// record with UTF-16 data.
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_list_writer = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
|
||||
const char kModuleName[] = "dinosaur";
|
||||
const char kPDBName[] = "d1n05.pdb";
|
||||
@ -425,17 +426,17 @@ TEST(MinidumpModuleWriter, OneModule_CodeViewUsesPDB20_MiscUsesUTF16) {
|
||||
const char kDebugName[] = "d1n05.dbg";
|
||||
const bool kDebugUTF16 = true;
|
||||
|
||||
auto module_writer = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module_writer = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module_writer->SetName(kModuleName);
|
||||
|
||||
auto codeview_pdb20_writer =
|
||||
make_scoped_ptr(new MinidumpModuleCodeViewRecordPDB20Writer());
|
||||
base::WrapUnique(new MinidumpModuleCodeViewRecordPDB20Writer());
|
||||
codeview_pdb20_writer->SetPDBName(kPDBName);
|
||||
codeview_pdb20_writer->SetTimestampAndAge(kPDBTimestamp, kPDBAge);
|
||||
module_writer->SetCodeViewRecord(std::move(codeview_pdb20_writer));
|
||||
|
||||
auto misc_debug_writer =
|
||||
make_scoped_ptr(new MinidumpModuleMiscDebugRecordWriter());
|
||||
base::WrapUnique(new MinidumpModuleMiscDebugRecordWriter());
|
||||
misc_debug_writer->SetDataType(kDebugType);
|
||||
misc_debug_writer->SetData(kDebugName, kDebugUTF16);
|
||||
module_writer->SetMiscDebugRecord(std::move(misc_debug_writer));
|
||||
@ -476,7 +477,7 @@ TEST(MinidumpModuleWriter, ThreeModules) {
|
||||
// its CodeView record, one with no CodeView record, and one with a PDB 2.0
|
||||
// link as its CodeView record.
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_list_writer = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
|
||||
const char kModuleName0[] = "main";
|
||||
const uint64_t kModuleBase0 = 0x100101000;
|
||||
@ -500,33 +501,33 @@ TEST(MinidumpModuleWriter, ThreeModules) {
|
||||
const time_t kPDBTimestamp2 = 0x386d4380;
|
||||
const uint32_t kPDBAge2 = 2;
|
||||
|
||||
auto module_writer_0 = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module_writer_0 = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module_writer_0->SetName(kModuleName0);
|
||||
module_writer_0->SetImageBaseAddress(kModuleBase0);
|
||||
module_writer_0->SetImageSize(kModuleSize0);
|
||||
|
||||
auto codeview_pdb70_writer_0 =
|
||||
make_scoped_ptr(new MinidumpModuleCodeViewRecordPDB70Writer());
|
||||
base::WrapUnique(new MinidumpModuleCodeViewRecordPDB70Writer());
|
||||
codeview_pdb70_writer_0->SetPDBName(kPDBName0);
|
||||
codeview_pdb70_writer_0->SetUUIDAndAge(pdb_uuid_0, kPDBAge0);
|
||||
module_writer_0->SetCodeViewRecord(std::move(codeview_pdb70_writer_0));
|
||||
|
||||
module_list_writer->AddModule(std::move(module_writer_0));
|
||||
|
||||
auto module_writer_1 = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module_writer_1 = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module_writer_1->SetName(kModuleName1);
|
||||
module_writer_1->SetImageBaseAddress(kModuleBase1);
|
||||
module_writer_1->SetImageSize(kModuleSize1);
|
||||
|
||||
module_list_writer->AddModule(std::move(module_writer_1));
|
||||
|
||||
auto module_writer_2 = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module_writer_2 = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module_writer_2->SetName(kModuleName2);
|
||||
module_writer_2->SetImageBaseAddress(kModuleBase2);
|
||||
module_writer_2->SetImageSize(kModuleSize2);
|
||||
|
||||
auto codeview_pdb70_writer_2 =
|
||||
make_scoped_ptr(new MinidumpModuleCodeViewRecordPDB20Writer());
|
||||
base::WrapUnique(new MinidumpModuleCodeViewRecordPDB20Writer());
|
||||
codeview_pdb70_writer_2->SetPDBName(kPDBName2);
|
||||
codeview_pdb70_writer_2->SetTimestampAndAge(kPDBTimestamp2, kPDBAge2);
|
||||
module_writer_2->SetCodeViewRecord(std::move(codeview_pdb70_writer_2));
|
||||
@ -722,7 +723,7 @@ TEST(MinidumpModuleWriter, InitializeFromSnapshot) {
|
||||
module_snapshots.push_back(module_snapshot);
|
||||
}
|
||||
|
||||
auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_list_writer = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
module_list_writer->InitializeFromSnapshot(module_snapshots);
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
@ -755,8 +756,8 @@ TEST(MinidumpModuleWriter, InitializeFromSnapshot) {
|
||||
|
||||
TEST(MinidumpModuleWriterDeathTest, NoModuleName) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto module_list_writer = make_scoped_ptr(new MinidumpModuleListWriter());
|
||||
auto module_writer = make_scoped_ptr(new MinidumpModuleWriter());
|
||||
auto module_list_writer = base::WrapUnique(new MinidumpModuleListWriter());
|
||||
auto module_writer = base::WrapUnique(new MinidumpModuleWriter());
|
||||
module_list_writer->AddModule(std::move(module_writer));
|
||||
minidump_file_writer.AddStream(std::move(module_list_writer));
|
||||
|
||||
|
@ -31,7 +31,7 @@ MinidumpRVAListWriter::MinidumpRVAListWriter()
|
||||
MinidumpRVAListWriter::~MinidumpRVAListWriter() {
|
||||
}
|
||||
|
||||
void MinidumpRVAListWriter::AddChild(scoped_ptr<MinidumpWritable> child) {
|
||||
void MinidumpRVAListWriter::AddChild(std::unique_ptr<MinidumpWritable> child) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
children_.push_back(child.release());
|
||||
|
@ -18,10 +18,10 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
#include "util/stdlib/pointer_container.h"
|
||||
@ -47,7 +47,7 @@ class MinidumpRVAListWriter : public MinidumpWritable {
|
||||
//! MinidumpWritable subclass, and call this method with that argument.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddChild(scoped_ptr<MinidumpWritable> child);
|
||||
void AddChild(std::unique_ptr<MinidumpWritable> child);
|
||||
|
||||
//! \brief Returns `true` if no child objects have been added by AddChild(),
|
||||
//! and `false` if child objects are present.
|
||||
@ -66,7 +66,7 @@ class MinidumpRVAListWriter : public MinidumpWritable {
|
||||
bool WriteObject(FileWriterInterface* file_writer) override;
|
||||
|
||||
private:
|
||||
scoped_ptr<MinidumpRVAList> rva_list_base_;
|
||||
std::unique_ptr<MinidumpRVAList> rva_list_base_;
|
||||
PointerVector<MinidumpWritable> children_;
|
||||
std::vector<RVA> child_rvas_;
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/format_macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/test/minidump_rva_list_test_util.h"
|
||||
@ -33,7 +34,7 @@ class TestMinidumpRVAListWriter final : public internal::MinidumpRVAListWriter {
|
||||
~TestMinidumpRVAListWriter() override {}
|
||||
|
||||
void AddChild(uint32_t value) {
|
||||
auto child = make_scoped_ptr(new TestUInt32MinidumpWritable(value));
|
||||
auto child = base::WrapUnique(new TestUInt32MinidumpWritable(value));
|
||||
MinidumpRVAListWriter::AddChild(std::move(child));
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/stl_util.h"
|
||||
#include "util/file/file_writer.h"
|
||||
#include "util/numeric/safe_assignment.h"
|
||||
@ -109,14 +110,14 @@ void MinidumpSimpleStringDictionaryWriter::InitializeFromMap(
|
||||
|
||||
for (const auto& iterator : map) {
|
||||
auto entry =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
entry->SetKeyValue(iterator.first, iterator.second);
|
||||
AddEntry(std::move(entry));
|
||||
}
|
||||
}
|
||||
|
||||
void MinidumpSimpleStringDictionaryWriter::AddEntry(
|
||||
scoped_ptr<MinidumpSimpleStringDictionaryEntryWriter> entry) {
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryEntryWriter> entry) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
const std::string& key = entry->Key();
|
||||
|
@ -18,11 +18,11 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_string_writer.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
@ -112,7 +112,8 @@ class MinidumpSimpleStringDictionaryWriter final
|
||||
//! replace the previous one.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddEntry(scoped_ptr<MinidumpSimpleStringDictionaryEntryWriter> entry);
|
||||
void AddEntry(
|
||||
std::unique_ptr<MinidumpSimpleStringDictionaryEntryWriter> entry);
|
||||
|
||||
//! \brief Determines whether the object is useful.
|
||||
//!
|
||||
@ -135,7 +136,8 @@ class MinidumpSimpleStringDictionaryWriter final
|
||||
// This object owns the MinidumpSimpleStringDictionaryEntryWriter objects.
|
||||
std::map<std::string, MinidumpSimpleStringDictionaryEntryWriter*> entries_;
|
||||
|
||||
scoped_ptr<MinidumpSimpleStringDictionary> simple_string_dictionary_base_;
|
||||
std::unique_ptr<MinidumpSimpleStringDictionary>
|
||||
simple_string_dictionary_base_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpSimpleStringDictionaryWriter);
|
||||
};
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/test/minidump_string_writer_test_util.h"
|
||||
@ -64,7 +65,7 @@ TEST(MinidumpSimpleStringDictionaryWriter, EmptyKeyValue) {
|
||||
|
||||
MinidumpSimpleStringDictionaryWriter dictionary_writer;
|
||||
auto entry_writer =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
dictionary_writer.AddEntry(std::move(entry_writer));
|
||||
|
||||
EXPECT_TRUE(dictionary_writer.IsUseful());
|
||||
@ -97,7 +98,7 @@ TEST(MinidumpSimpleStringDictionaryWriter, OneKeyValue) {
|
||||
|
||||
MinidumpSimpleStringDictionaryWriter dictionary_writer;
|
||||
auto entry_writer =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
entry_writer->SetKeyValue(kKey, kValue);
|
||||
dictionary_writer.AddEntry(std::move(entry_writer));
|
||||
|
||||
@ -135,15 +136,15 @@ TEST(MinidumpSimpleStringDictionaryWriter, ThreeKeysValues) {
|
||||
|
||||
MinidumpSimpleStringDictionaryWriter dictionary_writer;
|
||||
auto entry_writer_0 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
entry_writer_0->SetKeyValue(kKey0, kValue0);
|
||||
dictionary_writer.AddEntry(std::move(entry_writer_0));
|
||||
auto entry_writer_1 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
entry_writer_1->SetKeyValue(kKey1, kValue1);
|
||||
dictionary_writer.AddEntry(std::move(entry_writer_1));
|
||||
auto entry_writer_2 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
entry_writer_2->SetKeyValue(kKey2, kValue2);
|
||||
dictionary_writer.AddEntry(std::move(entry_writer_2));
|
||||
|
||||
@ -203,11 +204,11 @@ TEST(MinidumpSimpleStringDictionaryWriter, DuplicateKeyValue) {
|
||||
|
||||
MinidumpSimpleStringDictionaryWriter dictionary_writer;
|
||||
auto entry_writer_0 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
entry_writer_0->SetKeyValue(kKey, kValue0);
|
||||
dictionary_writer.AddEntry(std::move(entry_writer_0));
|
||||
auto entry_writer_1 =
|
||||
make_scoped_ptr(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
base::WrapUnique(new MinidumpSimpleStringDictionaryEntryWriter());
|
||||
entry_writer_1->SetKeyValue(kKey, kValue1);
|
||||
dictionary_writer.AddEntry(std::move(entry_writer_1));
|
||||
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "minidump/minidump_writer_util.h"
|
||||
#include "util/file/file_writer.h"
|
||||
#include "util/numeric/safe_assignment.h"
|
||||
@ -119,7 +120,7 @@ void MinidumpStringListWriter<MinidumpStringWriterType>::InitializeFromVector(
|
||||
template <typename MinidumpStringWriterType>
|
||||
void MinidumpStringListWriter<MinidumpStringWriterType>::AddStringUTF8(
|
||||
const std::string& string_utf8) {
|
||||
auto string_writer = make_scoped_ptr(new MinidumpStringWriterType());
|
||||
auto string_writer = base::WrapUnique(new MinidumpStringWriterType());
|
||||
string_writer->SetUTF8(string_utf8);
|
||||
AddChild(std::move(string_writer));
|
||||
}
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include <dbghelp.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/strings/string16.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_rva_list_writer.h"
|
||||
@ -77,7 +77,7 @@ class MinidumpStringWriter : public MinidumpWritable {
|
||||
const StringType& string() const { return string_; }
|
||||
|
||||
private:
|
||||
scoped_ptr<MinidumpStringType> string_base_;
|
||||
std::unique_ptr<MinidumpStringType> string_base_;
|
||||
StringType string_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpStringWriter);
|
||||
|
@ -20,11 +20,11 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_extensions.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
@ -187,7 +187,7 @@ class MinidumpSystemInfoWriter final : public internal::MinidumpStreamWriter {
|
||||
|
||||
private:
|
||||
MINIDUMP_SYSTEM_INFO system_info_;
|
||||
scoped_ptr<internal::MinidumpUTF16StringWriter> csd_version_;
|
||||
std::unique_ptr<internal::MinidumpUTF16StringWriter> csd_version_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpSystemInfoWriter);
|
||||
};
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_file_writer.h"
|
||||
#include "minidump/test/minidump_file_writer_test_util.h"
|
||||
@ -77,7 +78,7 @@ void GetSystemInfoStream(const std::string& file_contents,
|
||||
|
||||
TEST(MinidumpSystemInfoWriter, Empty) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info_writer = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
|
||||
system_info_writer->SetCSDVersion(std::string());
|
||||
|
||||
@ -117,7 +118,7 @@ TEST(MinidumpSystemInfoWriter, Empty) {
|
||||
|
||||
TEST(MinidumpSystemInfoWriter, X86_Win) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info_writer = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
|
||||
const MinidumpCPUArchitecture kCPUArchitecture = kMinidumpCPUArchitectureX86;
|
||||
const uint16_t kCPULevel = 0x0010;
|
||||
@ -187,7 +188,7 @@ TEST(MinidumpSystemInfoWriter, X86_Win) {
|
||||
|
||||
TEST(MinidumpSystemInfoWriter, AMD64_Mac) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info_writer = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
|
||||
const MinidumpCPUArchitecture kCPUArchitecture =
|
||||
kMinidumpCPUArchitectureAMD64;
|
||||
@ -244,7 +245,7 @@ TEST(MinidumpSystemInfoWriter, X86_CPUVendorFromRegisters) {
|
||||
// This test exercises SetCPUX86Vendor() to set the vendor from register
|
||||
// values.
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info_writer = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
|
||||
const MinidumpCPUArchitecture kCPUArchitecture = kMinidumpCPUArchitectureX86;
|
||||
const uint32_t kCPUVendor[] = {'uneG', 'Ieni', 'letn'};
|
||||
@ -330,7 +331,7 @@ TEST(MinidumpSystemInfoWriter, InitializeFromSnapshot_X86) {
|
||||
expect_system_info.BuildNumber,
|
||||
kOSVersionBuild);
|
||||
|
||||
auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info_writer = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
system_info_writer->InitializeFromSnapshot(&system_snapshot);
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
@ -425,7 +426,7 @@ TEST(MinidumpSystemInfoWriter, InitializeFromSnapshot_AMD64) {
|
||||
kOSVersionBuild);
|
||||
system_snapshot.SetNXEnabled(true);
|
||||
|
||||
auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info_writer = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
system_info_writer->InitializeFromSnapshot(&system_snapshot);
|
||||
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
@ -466,7 +467,7 @@ TEST(MinidumpSystemInfoWriter, InitializeFromSnapshot_AMD64) {
|
||||
|
||||
TEST(MinidumpSystemInfoWriterDeathTest, NoCSDVersion) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto system_info_writer = make_scoped_ptr(new MinidumpSystemInfoWriter());
|
||||
auto system_info_writer = base::WrapUnique(new MinidumpSystemInfoWriter());
|
||||
minidump_file_writer.AddStream(std::move(system_info_writer));
|
||||
|
||||
StringFile string_file;
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <utility>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "minidump/minidump_context_writer.h"
|
||||
#include "minidump/minidump_memory_writer.h"
|
||||
#include "snapshot/memory_snapshot.h"
|
||||
@ -50,12 +51,12 @@ void MinidumpThreadWriter::InitializeFromSnapshot(
|
||||
|
||||
const MemorySnapshot* stack_snapshot = thread_snapshot->Stack();
|
||||
if (stack_snapshot && stack_snapshot->Size() > 0) {
|
||||
scoped_ptr<MinidumpMemoryWriter> stack =
|
||||
std::unique_ptr<MinidumpMemoryWriter> stack =
|
||||
MinidumpMemoryWriter::CreateFromSnapshot(stack_snapshot);
|
||||
SetStack(std::move(stack));
|
||||
}
|
||||
|
||||
scoped_ptr<MinidumpContextWriter> context =
|
||||
std::unique_ptr<MinidumpContextWriter> context =
|
||||
MinidumpContextWriter::CreateFromSnapshot(thread_snapshot->Context());
|
||||
SetContext(std::move(context));
|
||||
}
|
||||
@ -66,14 +67,15 @@ const MINIDUMP_THREAD* MinidumpThreadWriter::MinidumpThread() const {
|
||||
return &thread_;
|
||||
}
|
||||
|
||||
void MinidumpThreadWriter::SetStack(scoped_ptr<MinidumpMemoryWriter> stack) {
|
||||
void MinidumpThreadWriter::SetStack(
|
||||
std::unique_ptr<MinidumpMemoryWriter> stack) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
stack_ = std::move(stack);
|
||||
}
|
||||
|
||||
void MinidumpThreadWriter::SetContext(
|
||||
scoped_ptr<MinidumpContextWriter> context) {
|
||||
std::unique_ptr<MinidumpContextWriter> context) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
context_ = std::move(context);
|
||||
@ -146,7 +148,7 @@ void MinidumpThreadListWriter::InitializeFromSnapshot(
|
||||
BuildMinidumpThreadIDMap(thread_snapshots, thread_id_map);
|
||||
|
||||
for (const ThreadSnapshot* thread_snapshot : thread_snapshots) {
|
||||
auto thread = make_scoped_ptr(new MinidumpThreadWriter());
|
||||
auto thread = base::WrapUnique(new MinidumpThreadWriter());
|
||||
thread->InitializeFromSnapshot(thread_snapshot, thread_id_map);
|
||||
AddThread(std::move(thread));
|
||||
}
|
||||
@ -166,7 +168,7 @@ void MinidumpThreadListWriter::SetMemoryListWriter(
|
||||
}
|
||||
|
||||
void MinidumpThreadListWriter::AddThread(
|
||||
scoped_ptr<MinidumpThreadWriter> thread) {
|
||||
std::unique_ptr<MinidumpThreadWriter> thread) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
if (memory_list_writer_) {
|
||||
|
@ -20,10 +20,10 @@
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_thread_id_map.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
@ -89,7 +89,7 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable {
|
||||
//! overall tree of internal::MinidumpWritable objects.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetStack(scoped_ptr<MinidumpMemoryWriter> stack);
|
||||
void SetStack(std::unique_ptr<MinidumpMemoryWriter> stack);
|
||||
|
||||
//! \brief Arranges for MINIDUMP_THREAD::ThreadContext to point to the CPU
|
||||
//! context to be written by \a context.
|
||||
@ -100,7 +100,7 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable {
|
||||
//! overall tree of internal::MinidumpWritable objects.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void SetContext(scoped_ptr<MinidumpContextWriter> context);
|
||||
void SetContext(std::unique_ptr<MinidumpContextWriter> context);
|
||||
|
||||
//! \brief Sets MINIDUMP_THREAD::ThreadId.
|
||||
void SetThreadID(uint32_t thread_id) { thread_.ThreadId = thread_id; }
|
||||
@ -130,8 +130,8 @@ class MinidumpThreadWriter final : public internal::MinidumpWritable {
|
||||
|
||||
private:
|
||||
MINIDUMP_THREAD thread_;
|
||||
scoped_ptr<MinidumpMemoryWriter> stack_;
|
||||
scoped_ptr<MinidumpContextWriter> context_;
|
||||
std::unique_ptr<MinidumpMemoryWriter> stack_;
|
||||
std::unique_ptr<MinidumpContextWriter> context_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpThreadWriter);
|
||||
};
|
||||
@ -190,7 +190,7 @@ class MinidumpThreadListWriter final : public internal::MinidumpStreamWriter {
|
||||
//! overall tree of internal::MinidumpWritable objects.
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddThread(scoped_ptr<MinidumpThreadWriter> thread);
|
||||
void AddThread(std::unique_ptr<MinidumpThreadWriter> thread);
|
||||
|
||||
protected:
|
||||
// MinidumpWritable:
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_context_writer.h"
|
||||
@ -78,7 +79,7 @@ void GetThreadListStream(const std::string& file_contents,
|
||||
|
||||
TEST(MinidumpThreadWriter, EmptyThreadList) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
|
||||
auto thread_list_writer = base::WrapUnique(new MinidumpThreadListWriter());
|
||||
|
||||
minidump_file_writer.AddStream(std::move(thread_list_writer));
|
||||
|
||||
@ -139,7 +140,7 @@ void ExpectThread(const MINIDUMP_THREAD* expected,
|
||||
|
||||
TEST(MinidumpThreadWriter, OneThread_x86_NoStack) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
|
||||
auto thread_list_writer = base::WrapUnique(new MinidumpThreadListWriter());
|
||||
|
||||
const uint32_t kThreadID = 0x11111111;
|
||||
const uint32_t kSuspendCount = 1;
|
||||
@ -148,14 +149,14 @@ TEST(MinidumpThreadWriter, OneThread_x86_NoStack) {
|
||||
const uint64_t kTEB = 0x55555555;
|
||||
const uint32_t kSeed = 123;
|
||||
|
||||
auto thread_writer = make_scoped_ptr(new MinidumpThreadWriter());
|
||||
auto thread_writer = base::WrapUnique(new MinidumpThreadWriter());
|
||||
thread_writer->SetThreadID(kThreadID);
|
||||
thread_writer->SetSuspendCount(kSuspendCount);
|
||||
thread_writer->SetPriorityClass(kPriorityClass);
|
||||
thread_writer->SetPriority(kPriority);
|
||||
thread_writer->SetTEB(kTEB);
|
||||
|
||||
auto context_x86_writer = make_scoped_ptr(new MinidumpContextX86Writer());
|
||||
auto context_x86_writer = base::WrapUnique(new MinidumpContextX86Writer());
|
||||
InitializeMinidumpContextX86(context_x86_writer->context(), kSeed);
|
||||
thread_writer->SetContext(std::move(context_x86_writer));
|
||||
|
||||
@ -198,7 +199,7 @@ TEST(MinidumpThreadWriter, OneThread_x86_NoStack) {
|
||||
|
||||
TEST(MinidumpThreadWriter, OneThread_AMD64_Stack) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
|
||||
auto thread_list_writer = base::WrapUnique(new MinidumpThreadListWriter());
|
||||
|
||||
const uint32_t kThreadID = 0x22222222;
|
||||
const uint32_t kSuspendCount = 2;
|
||||
@ -210,19 +211,22 @@ TEST(MinidumpThreadWriter, OneThread_AMD64_Stack) {
|
||||
const uint8_t kMemoryValue = 99;
|
||||
const uint32_t kSeed = 456;
|
||||
|
||||
auto thread_writer = make_scoped_ptr(new MinidumpThreadWriter());
|
||||
auto thread_writer = base::WrapUnique(new MinidumpThreadWriter());
|
||||
thread_writer->SetThreadID(kThreadID);
|
||||
thread_writer->SetSuspendCount(kSuspendCount);
|
||||
thread_writer->SetPriorityClass(kPriorityClass);
|
||||
thread_writer->SetPriority(kPriority);
|
||||
thread_writer->SetTEB(kTEB);
|
||||
|
||||
auto memory_writer = make_scoped_ptr(
|
||||
auto memory_writer = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kMemoryBase, kMemorySize, kMemoryValue));
|
||||
thread_writer->SetStack(std::move(memory_writer));
|
||||
|
||||
MSVC_SUPPRESS_WARNING(4316); // Object allocated on heap may not be aligned.
|
||||
auto context_amd64_writer = make_scoped_ptr(new MinidumpContextAMD64Writer());
|
||||
// Object allocated on heap may not be aligned.
|
||||
MSVC_PUSH_DISABLE_WARNING(4316);
|
||||
auto context_amd64_writer =
|
||||
base::WrapUnique(new MinidumpContextAMD64Writer());
|
||||
MSVC_POP_WARNING(); // C4316.
|
||||
InitializeMinidumpContextAMD64(context_amd64_writer->context(), kSeed);
|
||||
thread_writer->SetContext(std::move(context_amd64_writer));
|
||||
|
||||
@ -274,8 +278,8 @@ TEST(MinidumpThreadWriter, OneThread_AMD64_Stack) {
|
||||
|
||||
TEST(MinidumpThreadWriter, ThreeThreads_x86_MemoryList) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
|
||||
auto memory_list_writer = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto thread_list_writer = base::WrapUnique(new MinidumpThreadListWriter());
|
||||
auto memory_list_writer = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
thread_list_writer->SetMemoryListWriter(memory_list_writer.get());
|
||||
|
||||
const uint32_t kThreadID0 = 1111111;
|
||||
@ -288,18 +292,18 @@ TEST(MinidumpThreadWriter, ThreeThreads_x86_MemoryList) {
|
||||
const uint8_t kMemoryValue0 = 11;
|
||||
const uint32_t kSeed0 = 1;
|
||||
|
||||
auto thread_writer_0 = make_scoped_ptr(new MinidumpThreadWriter());
|
||||
auto thread_writer_0 = base::WrapUnique(new MinidumpThreadWriter());
|
||||
thread_writer_0->SetThreadID(kThreadID0);
|
||||
thread_writer_0->SetSuspendCount(kSuspendCount0);
|
||||
thread_writer_0->SetPriorityClass(kPriorityClass0);
|
||||
thread_writer_0->SetPriority(kPriority0);
|
||||
thread_writer_0->SetTEB(kTEB0);
|
||||
|
||||
auto memory_writer_0 = make_scoped_ptr(
|
||||
auto memory_writer_0 = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kMemoryBase0, kMemorySize0, kMemoryValue0));
|
||||
thread_writer_0->SetStack(std::move(memory_writer_0));
|
||||
|
||||
auto context_x86_writer_0 = make_scoped_ptr(new MinidumpContextX86Writer());
|
||||
auto context_x86_writer_0 = base::WrapUnique(new MinidumpContextX86Writer());
|
||||
InitializeMinidumpContextX86(context_x86_writer_0->context(), kSeed0);
|
||||
thread_writer_0->SetContext(std::move(context_x86_writer_0));
|
||||
|
||||
@ -315,18 +319,18 @@ TEST(MinidumpThreadWriter, ThreeThreads_x86_MemoryList) {
|
||||
const uint8_t kMemoryValue1 = 22;
|
||||
const uint32_t kSeed1 = 2;
|
||||
|
||||
auto thread_writer_1 = make_scoped_ptr(new MinidumpThreadWriter());
|
||||
auto thread_writer_1 = base::WrapUnique(new MinidumpThreadWriter());
|
||||
thread_writer_1->SetThreadID(kThreadID1);
|
||||
thread_writer_1->SetSuspendCount(kSuspendCount1);
|
||||
thread_writer_1->SetPriorityClass(kPriorityClass1);
|
||||
thread_writer_1->SetPriority(kPriority1);
|
||||
thread_writer_1->SetTEB(kTEB1);
|
||||
|
||||
auto memory_writer_1 = make_scoped_ptr(
|
||||
auto memory_writer_1 = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kMemoryBase1, kMemorySize1, kMemoryValue1));
|
||||
thread_writer_1->SetStack(std::move(memory_writer_1));
|
||||
|
||||
auto context_x86_writer_1 = make_scoped_ptr(new MinidumpContextX86Writer());
|
||||
auto context_x86_writer_1 = base::WrapUnique(new MinidumpContextX86Writer());
|
||||
InitializeMinidumpContextX86(context_x86_writer_1->context(), kSeed1);
|
||||
thread_writer_1->SetContext(std::move(context_x86_writer_1));
|
||||
|
||||
@ -342,18 +346,18 @@ TEST(MinidumpThreadWriter, ThreeThreads_x86_MemoryList) {
|
||||
const uint8_t kMemoryValue2 = 33;
|
||||
const uint32_t kSeed2 = 3;
|
||||
|
||||
auto thread_writer_2 = make_scoped_ptr(new MinidumpThreadWriter());
|
||||
auto thread_writer_2 = base::WrapUnique(new MinidumpThreadWriter());
|
||||
thread_writer_2->SetThreadID(kThreadID2);
|
||||
thread_writer_2->SetSuspendCount(kSuspendCount2);
|
||||
thread_writer_2->SetPriorityClass(kPriorityClass2);
|
||||
thread_writer_2->SetPriority(kPriority2);
|
||||
thread_writer_2->SetTEB(kTEB2);
|
||||
|
||||
auto memory_writer_2 = make_scoped_ptr(
|
||||
auto memory_writer_2 = base::WrapUnique(
|
||||
new TestMinidumpMemoryWriter(kMemoryBase2, kMemorySize2, kMemoryValue2));
|
||||
thread_writer_2->SetStack(std::move(memory_writer_2));
|
||||
|
||||
auto context_x86_writer_2 = make_scoped_ptr(new MinidumpContextX86Writer());
|
||||
auto context_x86_writer_2 = base::WrapUnique(new MinidumpContextX86Writer());
|
||||
InitializeMinidumpContextX86(context_x86_writer_2->context(), kSeed2);
|
||||
thread_writer_2->SetContext(std::move(context_x86_writer_2));
|
||||
|
||||
@ -592,7 +596,7 @@ void RunInitializeFromSnapshotTest(bool thread_id_collision) {
|
||||
thread_snapshot->SetThreadSpecificDataAddress(expect_threads[index].Teb);
|
||||
|
||||
if (expect_threads[index].Stack.Memory.DataSize) {
|
||||
auto memory_snapshot = make_scoped_ptr(new TestMemorySnapshot());
|
||||
auto memory_snapshot = base::WrapUnique(new TestMemorySnapshot());
|
||||
memory_snapshot->SetAddress(
|
||||
expect_threads[index].Stack.StartOfMemoryRange);
|
||||
memory_snapshot->SetSize(expect_threads[index].Stack.Memory.DataSize);
|
||||
@ -603,7 +607,7 @@ void RunInitializeFromSnapshotTest(bool thread_id_collision) {
|
||||
Traits::InitializeCPUContext(thread_snapshot->MutableContext(),
|
||||
context_seeds[index]);
|
||||
|
||||
auto teb_snapshot = make_scoped_ptr(new TestMemorySnapshot());
|
||||
auto teb_snapshot = base::WrapUnique(new TestMemorySnapshot());
|
||||
teb_snapshot->SetAddress(expect_threads[index].Teb);
|
||||
teb_snapshot->SetSize(kTebSize);
|
||||
teb_snapshot->SetValue(static_cast<char>('t' + index));
|
||||
@ -612,8 +616,8 @@ void RunInitializeFromSnapshotTest(bool thread_id_collision) {
|
||||
thread_snapshots.push_back(thread_snapshot);
|
||||
}
|
||||
|
||||
auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
|
||||
auto memory_list_writer = make_scoped_ptr(new MinidumpMemoryListWriter());
|
||||
auto thread_list_writer = base::WrapUnique(new MinidumpThreadListWriter());
|
||||
auto memory_list_writer = base::WrapUnique(new MinidumpMemoryListWriter());
|
||||
thread_list_writer->SetMemoryListWriter(memory_list_writer.get());
|
||||
MinidumpThreadIDMap thread_id_map;
|
||||
thread_list_writer->InitializeFromSnapshot(thread_snapshots, &thread_id_map);
|
||||
@ -693,9 +697,9 @@ TEST(MinidumpThreadWriter, InitializeFromSnapshot_ThreadIDCollision) {
|
||||
|
||||
TEST(MinidumpThreadWriterDeathTest, NoContext) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto thread_list_writer = make_scoped_ptr(new MinidumpThreadListWriter());
|
||||
auto thread_list_writer = base::WrapUnique(new MinidumpThreadListWriter());
|
||||
|
||||
auto thread_writer = make_scoped_ptr(new MinidumpThreadWriter());
|
||||
auto thread_writer = base::WrapUnique(new MinidumpThreadWriter());
|
||||
|
||||
thread_list_writer->AddThread(std::move(thread_writer));
|
||||
minidump_file_writer.AddStream(std::move(thread_list_writer));
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
#include <limits>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "minidump/minidump_writer_util.h"
|
||||
#include "util/file/file_writer.h"
|
||||
#include "util/numeric/in_range_cast.h"
|
||||
@ -123,14 +124,14 @@ void MinidumpUnloadedModuleListWriter::InitializeFromSnapshot(
|
||||
DCHECK(unloaded_modules_.empty());
|
||||
|
||||
for (auto unloaded_module_snapshot : unloaded_module_snapshots) {
|
||||
auto unloaded_module = make_scoped_ptr(new MinidumpUnloadedModuleWriter());
|
||||
auto unloaded_module = base::WrapUnique(new MinidumpUnloadedModuleWriter());
|
||||
unloaded_module->InitializeFromSnapshot(unloaded_module_snapshot);
|
||||
AddUnloadedModule(std::move(unloaded_module));
|
||||
}
|
||||
}
|
||||
|
||||
void MinidumpUnloadedModuleListWriter::AddUnloadedModule(
|
||||
scoped_ptr<MinidumpUnloadedModuleWriter> unloaded_module) {
|
||||
std::unique_ptr<MinidumpUnloadedModuleWriter> unloaded_module) {
|
||||
DCHECK_EQ(state(), kStateMutable);
|
||||
|
||||
unloaded_modules_.push_back(unloaded_module.release());
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include <dbghelp.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "minidump/minidump_stream_writer.h"
|
||||
#include "minidump/minidump_string_writer.h"
|
||||
#include "minidump/minidump_writable.h"
|
||||
@ -96,7 +96,7 @@ class MinidumpUnloadedModuleWriter final : public internal::MinidumpWritable {
|
||||
|
||||
private:
|
||||
MINIDUMP_UNLOADED_MODULE unloaded_module_;
|
||||
scoped_ptr<internal::MinidumpUTF16StringWriter> name_;
|
||||
std::unique_ptr<internal::MinidumpUTF16StringWriter> name_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(MinidumpUnloadedModuleWriter);
|
||||
};
|
||||
@ -130,7 +130,7 @@ class MinidumpUnloadedModuleListWriter final
|
||||
//!
|
||||
//! \note Valid in #kStateMutable.
|
||||
void AddUnloadedModule(
|
||||
scoped_ptr<MinidumpUnloadedModuleWriter> unloaded_module);
|
||||
std::unique_ptr<MinidumpUnloadedModuleWriter> unloaded_module);
|
||||
|
||||
protected:
|
||||
// MinidumpWritable:
|
||||
|
@ -14,6 +14,7 @@
|
||||
|
||||
#include "minidump/minidump_unloaded_module_writer.h"
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_file_writer.h"
|
||||
@ -71,12 +72,12 @@ void GetUnloadedModuleListStream(
|
||||
TEST(MinidumpUnloadedModuleWriter, EmptyModule) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto unloaded_module_list_writer =
|
||||
make_scoped_ptr(new MinidumpUnloadedModuleListWriter());
|
||||
base::WrapUnique(new MinidumpUnloadedModuleListWriter());
|
||||
|
||||
const char kModuleName[] = "test_dll";
|
||||
|
||||
auto unloaded_module_writer =
|
||||
make_scoped_ptr(new MinidumpUnloadedModuleWriter());
|
||||
base::WrapUnique(new MinidumpUnloadedModuleWriter());
|
||||
unloaded_module_writer->SetName(kModuleName);
|
||||
|
||||
unloaded_module_list_writer->AddUnloadedModule(
|
||||
@ -109,7 +110,7 @@ TEST(MinidumpUnloadedModuleWriter, EmptyModule) {
|
||||
TEST(MinidumpUnloadedModuleWriter, OneModule) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto unloaded_module_list_writer =
|
||||
make_scoped_ptr(new MinidumpUnloadedModuleListWriter());
|
||||
base::WrapUnique(new MinidumpUnloadedModuleListWriter());
|
||||
|
||||
const char kModuleName[] = "statically_linked";
|
||||
const uint64_t kModuleBase = 0x10da69000;
|
||||
@ -118,7 +119,7 @@ TEST(MinidumpUnloadedModuleWriter, OneModule) {
|
||||
const time_t kTimestamp = 0x386d4380;
|
||||
|
||||
auto unloaded_module_writer =
|
||||
make_scoped_ptr(new MinidumpUnloadedModuleWriter());
|
||||
base::WrapUnique(new MinidumpUnloadedModuleWriter());
|
||||
unloaded_module_writer->SetName(kModuleName);
|
||||
unloaded_module_writer->SetImageBaseAddress(kModuleBase);
|
||||
unloaded_module_writer->SetImageSize(kModuleSize);
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "minidump/minidump_file_writer.h"
|
||||
#include "minidump/test/minidump_file_writer_test_util.h"
|
||||
@ -51,9 +52,10 @@ void GetUserStream(const std::string& file_contents,
|
||||
|
||||
TEST(MinidumpUserStreamWriter, NoData) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto user_stream_writer = make_scoped_ptr(new MinidumpUserStreamWriter());
|
||||
auto user_stream_writer = base::WrapUnique(new MinidumpUserStreamWriter());
|
||||
const uint32_t kTestStreamId = 0x123456;
|
||||
auto stream = make_scoped_ptr(new UserMinidumpStream(kTestStreamId, nullptr));
|
||||
auto stream =
|
||||
base::WrapUnique(new UserMinidumpStream(kTestStreamId, nullptr));
|
||||
user_stream_writer->InitializeFromSnapshot(stream.get());
|
||||
minidump_file_writer.AddStream(std::move(user_stream_writer));
|
||||
|
||||
@ -71,7 +73,7 @@ TEST(MinidumpUserStreamWriter, NoData) {
|
||||
|
||||
TEST(MinidumpUserStreamWriter, OneStream) {
|
||||
MinidumpFileWriter minidump_file_writer;
|
||||
auto user_stream_writer = make_scoped_ptr(new MinidumpUserStreamWriter());
|
||||
auto user_stream_writer = base::WrapUnique(new MinidumpUserStreamWriter());
|
||||
const uint32_t kTestStreamId = 0x123456;
|
||||
|
||||
TestMemorySnapshot* test_data = new TestMemorySnapshot();
|
||||
@ -80,7 +82,7 @@ TEST(MinidumpUserStreamWriter, OneStream) {
|
||||
test_data->SetSize(kStreamSize);
|
||||
test_data->SetValue('c');
|
||||
auto stream =
|
||||
make_scoped_ptr(new UserMinidumpStream(kTestStreamId, test_data));
|
||||
base::WrapUnique(new UserMinidumpStream(kTestStreamId, test_data));
|
||||
user_stream_writer->InitializeFromSnapshot(stream.get());
|
||||
minidump_file_writer.AddStream(std::move(user_stream_writer));
|
||||
|
||||
|
@ -17,8 +17,8 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <limits>
|
||||
#include <memory>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/memory_snapshot.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -112,7 +112,7 @@ void CaptureMemory::PointedToByMemoryRange(const MemorySnapshot& memory,
|
||||
return;
|
||||
}
|
||||
|
||||
scoped_ptr<uint8_t[]> buffer(new uint8_t[memory.Size()]);
|
||||
std::unique_ptr<uint8_t[]> buffer(new uint8_t[memory.Size()]);
|
||||
if (!delegate->ReadMemory(memory.Address(), memory.Size(), buffer.get())) {
|
||||
LOG(ERROR) << "ReadMemory";
|
||||
return;
|
||||
|
@ -20,10 +20,10 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/mac/process_types.h"
|
||||
#include "util/misc/initialization_state_dcheck.h"
|
||||
#include "util/misc/uuid.h"
|
||||
@ -326,16 +326,16 @@ class MachOImageReader {
|
||||
mach_vm_size_t size_;
|
||||
mach_vm_size_t slide_;
|
||||
uint64_t source_version_;
|
||||
scoped_ptr<process_types::symtab_command> symtab_command_;
|
||||
scoped_ptr<process_types::dysymtab_command> dysymtab_command_;
|
||||
std::unique_ptr<process_types::symtab_command> symtab_command_;
|
||||
std::unique_ptr<process_types::dysymtab_command> dysymtab_command_;
|
||||
|
||||
// symbol_table_ (and symbol_table_initialized_) are mutable in order to
|
||||
// maintain LookUpExternalDefinedSymbol() as a const interface while allowing
|
||||
// lazy initialization via InitializeSymbolTable(). This is logical
|
||||
// const-ness, not physical const-ness.
|
||||
mutable scoped_ptr<MachOImageSymbolTableReader> symbol_table_;
|
||||
mutable std::unique_ptr<MachOImageSymbolTableReader> symbol_table_;
|
||||
|
||||
scoped_ptr<process_types::dylib_command> id_dylib_command_;
|
||||
std::unique_ptr<process_types::dylib_command> id_dylib_command_;
|
||||
ProcessReader* process_reader_; // weak
|
||||
uint32_t file_type_;
|
||||
InitializationStateDcheck initialized_;
|
||||
|
@ -18,9 +18,9 @@
|
||||
#include <mach-o/nlist.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "util/mac/checked_mach_address_range.h"
|
||||
#include "util/mach/task_memory.h"
|
||||
@ -100,7 +100,7 @@ class MachOImageSymbolTableReaderInitializer {
|
||||
return false;
|
||||
}
|
||||
|
||||
scoped_ptr<process_types::nlist[]> symbols(
|
||||
std::unique_ptr<process_types::nlist[]> symbols(
|
||||
new process_types::nlist[symtab_command->nsyms]);
|
||||
if (!process_types::nlist::ReadArrayInto(
|
||||
process_reader_, symtab_address, symbol_count, &symbols[0])) {
|
||||
@ -108,7 +108,7 @@ class MachOImageSymbolTableReaderInitializer {
|
||||
return false;
|
||||
}
|
||||
|
||||
scoped_ptr<TaskMemory::MappedMemory> string_table;
|
||||
std::unique_ptr<TaskMemory::MappedMemory> string_table;
|
||||
for (size_t symbol_index = 0; symbol_index < symbol_count; ++symbol_index) {
|
||||
const process_types::nlist& symbol = symbols[symbol_index];
|
||||
std::string symbol_info = base::StringPrintf(", symbol index %zu%s",
|
||||
|
@ -14,7 +14,8 @@
|
||||
|
||||
#include "snapshot/mac/memory_snapshot_mac.h"
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "util/mach/task_memory.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -58,7 +59,7 @@ bool MemorySnapshotMac::Read(Delegate* delegate) const {
|
||||
return delegate->MemorySnapshotDelegateRead(nullptr, size_);
|
||||
}
|
||||
|
||||
scoped_ptr<uint8_t[]> buffer(new uint8_t[size_]);
|
||||
std::unique_ptr<uint8_t[]> buffer(new uint8_t[size_]);
|
||||
if (!process_reader_->Memory()->Read(address_, size_, buffer.get())) {
|
||||
return false;
|
||||
}
|
||||
|
@ -429,7 +429,7 @@ void ProcessReader::InitializeModules() {
|
||||
// Proceed anyway with an empty module name.
|
||||
}
|
||||
|
||||
scoped_ptr<MachOImageReader> reader(new MachOImageReader());
|
||||
std::unique_ptr<MachOImageReader> reader(new MachOImageReader());
|
||||
if (!reader->Initialize(this, image_info.imageLoadAddress, module.name)) {
|
||||
reader.reset();
|
||||
}
|
||||
@ -510,7 +510,7 @@ void ProcessReader::InitializeModules() {
|
||||
}
|
||||
std::string module_name = !module.name.empty() ? module.name : "(dyld)";
|
||||
|
||||
scoped_ptr<MachOImageReader> reader(new MachOImageReader());
|
||||
std::unique_ptr<MachOImageReader> reader(new MachOImageReader());
|
||||
if (!reader->Initialize(
|
||||
this, all_image_infos.dyldImageLoadAddress, module_name)) {
|
||||
reader.reset();
|
||||
|
@ -21,11 +21,11 @@
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "build/build_config.h"
|
||||
#include "util/mach/task_memory.h"
|
||||
#include "util/misc/initialization_state_dcheck.h"
|
||||
@ -220,7 +220,7 @@ class ProcessReader {
|
||||
std::vector<Thread> threads_; // owns send rights
|
||||
std::vector<Module> modules_;
|
||||
PointerVector<MachOImageReader> module_readers_;
|
||||
scoped_ptr<TaskMemory> task_memory_;
|
||||
std::unique_ptr<TaskMemory> task_memory_;
|
||||
task_t task_; // weak
|
||||
InitializationStateDcheck initialized_;
|
||||
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include "snapshot/mac/process_snapshot_mac.h"
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "util/misc/tri_state.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -220,7 +221,7 @@ void ProcessSnapshotMac::InitializeThreads() {
|
||||
process_reader_.Threads();
|
||||
for (const ProcessReader::Thread& process_reader_thread :
|
||||
process_reader_threads) {
|
||||
auto thread = make_scoped_ptr(new internal::ThreadSnapshotMac());
|
||||
auto thread = base::WrapUnique(new internal::ThreadSnapshotMac());
|
||||
if (thread->Initialize(&process_reader_, process_reader_thread)) {
|
||||
threads_.push_back(thread.release());
|
||||
}
|
||||
@ -232,7 +233,7 @@ void ProcessSnapshotMac::InitializeModules() {
|
||||
process_reader_.Modules();
|
||||
for (const ProcessReader::Module& process_reader_module :
|
||||
process_reader_modules) {
|
||||
auto module = make_scoped_ptr(new internal::ModuleSnapshotMac());
|
||||
auto module = base::WrapUnique(new internal::ModuleSnapshotMac());
|
||||
if (module->Initialize(&process_reader_, process_reader_module)) {
|
||||
modules_.push_back(module.release());
|
||||
}
|
||||
|
@ -20,11 +20,11 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "client/crashpad_info.h"
|
||||
#include "snapshot/crashpad_info_client_options.h"
|
||||
#include "snapshot/exception_snapshot.h"
|
||||
@ -143,7 +143,7 @@ class ProcessSnapshotMac final : public ProcessSnapshot {
|
||||
internal::SystemSnapshotMac system_;
|
||||
PointerVector<internal::ThreadSnapshotMac> threads_;
|
||||
PointerVector<internal::ModuleSnapshotMac> modules_;
|
||||
scoped_ptr<internal::ExceptionSnapshotMac> exception_;
|
||||
std::unique_ptr<internal::ExceptionSnapshotMac> exception_;
|
||||
ProcessReader process_reader_;
|
||||
UUID report_id_;
|
||||
UUID client_id_;
|
||||
|
@ -17,8 +17,9 @@
|
||||
#include <string.h>
|
||||
#include <uuid/uuid.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/mac/process_types/internal.h"
|
||||
#include "util/mach/task_memory.h"
|
||||
|
||||
@ -210,7 +211,7 @@ inline void Assign<uuid_t, uuid_t>(uuid_t* destination, const uuid_t& source) {
|
||||
address, sizeof(struct_name<Traits>[count]), specific); \
|
||||
} \
|
||||
\
|
||||
} /* namespace internal */ \
|
||||
} /* namespace internal */ \
|
||||
\
|
||||
/* static */ \
|
||||
bool struct_name::ReadArrayInto(ProcessReader* process_reader, \
|
||||
@ -235,7 +236,7 @@ inline void Assign<uuid_t, uuid_t>(uuid_t* destination, const uuid_t& source) {
|
||||
mach_vm_address_t address, \
|
||||
size_t count, \
|
||||
struct_name* generic) { \
|
||||
scoped_ptr<T[]> specific(new T[count]); \
|
||||
std::unique_ptr<T[]> specific(new T[count]); \
|
||||
if (!T::ReadArrayInto(process_reader, address, count, &specific[0])) { \
|
||||
return false; \
|
||||
} \
|
||||
@ -244,8 +245,8 @@ inline void Assign<uuid_t, uuid_t>(uuid_t* destination, const uuid_t& source) {
|
||||
} \
|
||||
return true; \
|
||||
} \
|
||||
} /* namespace process_types */ \
|
||||
} /* namespace crashpad */
|
||||
} /* namespace process_types */ \
|
||||
} /* namespace crashpad */
|
||||
|
||||
#define PROCESS_TYPE_STRUCT_MEMBER(member_type, member_name, ...)
|
||||
|
||||
|
@ -14,11 +14,12 @@
|
||||
|
||||
#include "snapshot/minidump/process_snapshot_minidump.h"
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "util/file/file_io.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "snapshot/minidump/minidump_simple_string_dictionary_reader.h"
|
||||
#include "util/file/file_io.h"
|
||||
|
||||
namespace crashpad {
|
||||
|
||||
@ -277,7 +278,7 @@ bool ProcessSnapshotMinidump::InitializeModules() {
|
||||
? &module_crashpad_info_it->second
|
||||
: nullptr;
|
||||
|
||||
auto module = make_scoped_ptr(new internal::ModuleSnapshotMinidump());
|
||||
auto module = base::WrapUnique(new internal::ModuleSnapshotMinidump());
|
||||
if (!module->Initialize(
|
||||
file_reader_, module_rva, module_crashpad_info_location)) {
|
||||
return false;
|
||||
@ -325,7 +326,7 @@ bool ProcessSnapshotMinidump::InitializeModulesCrashpadInfo(
|
||||
return false;
|
||||
}
|
||||
|
||||
scoped_ptr<MinidumpModuleCrashpadInfoLink[]> minidump_links(
|
||||
std::unique_ptr<MinidumpModuleCrashpadInfoLink[]> minidump_links(
|
||||
new MinidumpModuleCrashpadInfoLink[crashpad_module_count]);
|
||||
if (!file_reader_->ReadExactly(
|
||||
&minidump_links[0],
|
||||
|
@ -18,7 +18,8 @@
|
||||
#include <dbghelp.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "snapshot/module_snapshot.h"
|
||||
#include "util/file/string_file.h"
|
||||
|
@ -19,14 +19,14 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/memory_snapshot.h"
|
||||
#include "util/misc/uuid.h"
|
||||
#include "util/numeric/checked_range.h"
|
||||
#include "snapshot/memory_snapshot.h"
|
||||
|
||||
namespace crashpad {
|
||||
|
||||
@ -44,7 +44,7 @@ class UserMinidumpStream {
|
||||
|
||||
private:
|
||||
//! \brief The memory representing the custom minidump stream.
|
||||
scoped_ptr<MemorySnapshot> memory_;
|
||||
std::unique_ptr<MemorySnapshot> memory_;
|
||||
|
||||
//! \brief The stream type that the minidump stream will be tagged with.
|
||||
uint32_t stream_type_;
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/cpu_context.h"
|
||||
#include "snapshot/exception_snapshot.h"
|
||||
#include "util/stdlib/pointer_container.h"
|
||||
@ -59,7 +59,7 @@ class TestExceptionSnapshot final : public ExceptionSnapshot {
|
||||
exception_address_ = exception_address;
|
||||
}
|
||||
void SetCodes(const std::vector<uint64_t>& codes) { codes_ = codes; }
|
||||
void AddExtraMemory(scoped_ptr<MemorySnapshot> extra_memory) {
|
||||
void AddExtraMemory(std::unique_ptr<MemorySnapshot> extra_memory) {
|
||||
extra_memory_.push_back(extra_memory.release());
|
||||
}
|
||||
|
||||
|
@ -20,12 +20,12 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/exception_snapshot.h"
|
||||
#include "snapshot/memory_map_region_snapshot.h"
|
||||
#include "snapshot/memory_snapshot.h"
|
||||
@ -73,7 +73,7 @@ class TestProcessSnapshot final : public ProcessSnapshot {
|
||||
//!
|
||||
//! \param[in] system The system snapshot that System() will return. The
|
||||
//! TestProcessSnapshot object takes ownership of \a system.
|
||||
void SetSystem(scoped_ptr<SystemSnapshot> system) {
|
||||
void SetSystem(std::unique_ptr<SystemSnapshot> system) {
|
||||
system_ = std::move(system);
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ class TestProcessSnapshot final : public ProcessSnapshot {
|
||||
//!
|
||||
//! \param[in] thread The thread snapshot that will be included in Threads().
|
||||
//! The TestProcessSnapshot object takes ownership of \a thread.
|
||||
void AddThread(scoped_ptr<ThreadSnapshot> thread) {
|
||||
void AddThread(std::unique_ptr<ThreadSnapshot> thread) {
|
||||
threads_.push_back(thread.release());
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ class TestProcessSnapshot final : public ProcessSnapshot {
|
||||
//!
|
||||
//! \param[in] module The module snapshot that will be included in Modules().
|
||||
//! The TestProcessSnapshot object takes ownership of \a module.
|
||||
void AddModule(scoped_ptr<ModuleSnapshot> module) {
|
||||
void AddModule(std::unique_ptr<ModuleSnapshot> module) {
|
||||
modules_.push_back(module.release());
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ class TestProcessSnapshot final : public ProcessSnapshot {
|
||||
//!
|
||||
//! \param[in] exception The exception snapshot that Exception() will return.
|
||||
//! The TestProcessSnapshot object takes ownership of \a exception.
|
||||
void SetException(scoped_ptr<ExceptionSnapshot> exception) {
|
||||
void SetException(std::unique_ptr<ExceptionSnapshot> exception) {
|
||||
exception_ = std::move(exception);
|
||||
}
|
||||
|
||||
@ -115,7 +115,7 @@ class TestProcessSnapshot final : public ProcessSnapshot {
|
||||
//! \param[in] region The memory map region snapshot that will be included in
|
||||
//! MemoryMap(). The TestProcessSnapshot object takes ownership of \a
|
||||
//! region.
|
||||
void AddMemoryMapRegion(scoped_ptr<MemoryMapRegionSnapshot> region) {
|
||||
void AddMemoryMapRegion(std::unique_ptr<MemoryMapRegionSnapshot> region) {
|
||||
memory_map_.push_back(region.release());
|
||||
}
|
||||
|
||||
@ -131,7 +131,7 @@ class TestProcessSnapshot final : public ProcessSnapshot {
|
||||
//! \param[in] extra_memory The memory snapshot that will be included in
|
||||
//! ExtraMemory(). The TestProcessSnapshot object takes ownership of \a
|
||||
//! extra_memory.
|
||||
void AddExtraMemory(scoped_ptr<MemorySnapshot> extra_memory) {
|
||||
void AddExtraMemory(std::unique_ptr<MemorySnapshot> extra_memory) {
|
||||
extra_memory_.push_back(extra_memory.release());
|
||||
}
|
||||
|
||||
@ -165,11 +165,11 @@ class TestProcessSnapshot final : public ProcessSnapshot {
|
||||
UUID report_id_;
|
||||
UUID client_id_;
|
||||
std::map<std::string, std::string> annotations_simple_map_;
|
||||
scoped_ptr<SystemSnapshot> system_;
|
||||
std::unique_ptr<SystemSnapshot> system_;
|
||||
PointerVector<ThreadSnapshot> threads_;
|
||||
PointerVector<ModuleSnapshot> modules_;
|
||||
std::vector<UnloadedModuleSnapshot> unloaded_modules_;
|
||||
scoped_ptr<ExceptionSnapshot> exception_;
|
||||
std::unique_ptr<ExceptionSnapshot> exception_;
|
||||
PointerVector<MemoryMapRegionSnapshot> memory_map_;
|
||||
std::vector<HandleSnapshot> handles_;
|
||||
PointerVector<MemorySnapshot> extra_memory_;
|
||||
|
@ -17,11 +17,11 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/cpu_context.h"
|
||||
#include "snapshot/memory_snapshot.h"
|
||||
#include "snapshot/thread_snapshot.h"
|
||||
@ -56,7 +56,9 @@ class TestThreadSnapshot final : public ThreadSnapshot {
|
||||
//!
|
||||
//! \param[in] stack The memory region that Stack() will return. The
|
||||
//! TestThreadSnapshot object takes ownership of \a stack.
|
||||
void SetStack(scoped_ptr<MemorySnapshot> stack) { stack_ = std::move(stack); }
|
||||
void SetStack(std::unique_ptr<MemorySnapshot> stack) {
|
||||
stack_ = std::move(stack);
|
||||
}
|
||||
|
||||
void SetThreadID(uint64_t thread_id) { thread_id_ = thread_id; }
|
||||
void SetSuspendCount(int suspend_count) { suspend_count_ = suspend_count; }
|
||||
@ -70,7 +72,7 @@ class TestThreadSnapshot final : public ThreadSnapshot {
|
||||
//! \param[in] extra_memory The memory snapshot that will be included in
|
||||
//! ExtraMemory(). The TestThreadSnapshot object takes ownership of \a
|
||||
//! extra_memory.
|
||||
void AddExtraMemory(scoped_ptr<MemorySnapshot> extra_memory) {
|
||||
void AddExtraMemory(std::unique_ptr<MemorySnapshot> extra_memory) {
|
||||
extra_memory_.push_back(extra_memory.release());
|
||||
}
|
||||
|
||||
@ -90,7 +92,7 @@ class TestThreadSnapshot final : public ThreadSnapshot {
|
||||
CPUContextX86_64 x86_64;
|
||||
} context_union_;
|
||||
CPUContext context_;
|
||||
scoped_ptr<MemorySnapshot> stack_;
|
||||
std::unique_ptr<MemorySnapshot> stack_;
|
||||
uint64_t thread_id_;
|
||||
int suspend_count_;
|
||||
int priority_;
|
||||
|
@ -12,9 +12,10 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "snapshot/win/memory_snapshot_win.h"
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
|
||||
namespace crashpad {
|
||||
namespace internal {
|
||||
@ -59,7 +60,7 @@ bool MemorySnapshotWin::Read(Delegate* delegate) const {
|
||||
return delegate->MemorySnapshotDelegateRead(nullptr, size_);
|
||||
}
|
||||
|
||||
scoped_ptr<uint8_t[]> buffer(new uint8_t[size_]);
|
||||
std::unique_ptr<uint8_t[]> buffer(new uint8_t[size_]);
|
||||
if (!process_reader_->ReadMemory(address_, size_, buffer.get())) {
|
||||
return false;
|
||||
}
|
||||
|
@ -304,7 +304,7 @@ void ModuleSnapshotWin::GetCrashpadUserMinidumpStreams(
|
||||
}
|
||||
|
||||
if (list_entry.size != 0) {
|
||||
scoped_ptr<internal::MemorySnapshotWin> memory(
|
||||
std::unique_ptr<internal::MemorySnapshotWin> memory(
|
||||
new internal::MemorySnapshotWin());
|
||||
memory->Initialize(
|
||||
process_reader_, list_entry.base_address, list_entry.size);
|
||||
|
@ -19,11 +19,11 @@
|
||||
#include <stdint.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "snapshot/crashpad_info_client_options.h"
|
||||
#include "snapshot/module_snapshot.h"
|
||||
#include "snapshot/win/process_reader_win.h"
|
||||
@ -109,7 +109,7 @@ class ModuleSnapshotWin final : public ModuleSnapshot {
|
||||
std::wstring name_;
|
||||
std::string pdb_name_;
|
||||
UUID uuid_;
|
||||
scoped_ptr<PEImageReader> pe_image_reader_;
|
||||
std::unique_ptr<PEImageReader> pe_image_reader_;
|
||||
ProcessReaderWin* process_reader_; // weak
|
||||
time_t timestamp_;
|
||||
uint32_t age_;
|
||||
|
@ -16,8 +16,9 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "client/crashpad_info.h"
|
||||
#include "snapshot/win/pe_image_resource_reader.h"
|
||||
#include "util/misc/pdb_structures.h"
|
||||
@ -146,7 +147,7 @@ bool PEImageReader::DebugDirectoryInformation(UUID* uuid,
|
||||
continue;
|
||||
}
|
||||
|
||||
scoped_ptr<char[]> data(new char[debug_directory.SizeOfData]);
|
||||
std::unique_ptr<char[]> data(new char[debug_directory.SizeOfData]);
|
||||
if (!module_subrange_reader_.ReadMemory(
|
||||
Address() + debug_directory.AddressOfRawData,
|
||||
debug_directory.SizeOfData,
|
||||
|
@ -15,9 +15,9 @@
|
||||
#include "snapshot/win/pe_image_resource_reader.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
|
||||
namespace {
|
||||
|
||||
@ -227,7 +227,7 @@ bool PEImageResourceReader::ReadResourceDirectory(
|
||||
|
||||
// resource_directory is optional, but it’s still needed locally even if the
|
||||
// caller isn’t interested in it.
|
||||
scoped_ptr<IMAGE_RESOURCE_DIRECTORY> local_resource_directory;
|
||||
std::unique_ptr<IMAGE_RESOURCE_DIRECTORY> local_resource_directory;
|
||||
if (!resource_directory) {
|
||||
local_resource_directory.reset(new IMAGE_RESOURCE_DIRECTORY);
|
||||
resource_directory = local_resource_directory.get();
|
||||
|
@ -17,7 +17,8 @@
|
||||
#include <string.h>
|
||||
#include <winternl.h>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "util/win/capture_context.h"
|
||||
@ -54,7 +55,7 @@ process_types::SYSTEM_PROCESS_INFORMATION<Traits>* NextProcess(
|
||||
template <class Traits>
|
||||
process_types::SYSTEM_PROCESS_INFORMATION<Traits>* GetProcessInformation(
|
||||
HANDLE process_handle,
|
||||
scoped_ptr<uint8_t[]>* buffer) {
|
||||
std::unique_ptr<uint8_t[]>* buffer) {
|
||||
ULONG buffer_size = 16384;
|
||||
buffer->reset(new uint8_t[buffer_size]);
|
||||
NTSTATUS status;
|
||||
@ -329,7 +330,7 @@ template <class Traits>
|
||||
void ProcessReaderWin::ReadThreadData(bool is_64_reading_32) {
|
||||
DCHECK(threads_.empty());
|
||||
|
||||
scoped_ptr<uint8_t[]> buffer;
|
||||
std::unique_ptr<uint8_t[]> buffer;
|
||||
process_types::SYSTEM_PROCESS_INFORMATION<Traits>* process_information =
|
||||
GetProcessInformation<Traits>(process_, &buffer);
|
||||
if (!process_information)
|
||||
|
@ -17,6 +17,7 @@
|
||||
#include <algorithm>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "snapshot/win/memory_snapshot_win.h"
|
||||
@ -238,7 +239,7 @@ void ProcessSnapshotWin::InitializeThreads(
|
||||
process_reader_.Threads();
|
||||
for (const ProcessReaderWin::Thread& process_reader_thread :
|
||||
process_reader_threads) {
|
||||
auto thread = make_scoped_ptr(new internal::ThreadSnapshotWin());
|
||||
auto thread = base::WrapUnique(new internal::ThreadSnapshotWin());
|
||||
uint32_t* budget_remaining_pointer = nullptr;
|
||||
uint32_t budget_remaining = indirectly_referenced_memory_cap;
|
||||
if (gather_indirectly_referenced_memory)
|
||||
@ -256,7 +257,7 @@ void ProcessSnapshotWin::InitializeModules() {
|
||||
process_reader_.Modules();
|
||||
for (const ProcessInfo::Module& process_reader_module :
|
||||
process_reader_modules) {
|
||||
auto module = make_scoped_ptr(new internal::ModuleSnapshotWin());
|
||||
auto module = base::WrapUnique(new internal::ModuleSnapshotWin());
|
||||
if (module->Initialize(&process_reader_, process_reader_module)) {
|
||||
modules_.push_back(module.release());
|
||||
}
|
||||
|
@ -21,11 +21,11 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "client/crashpad_info.h"
|
||||
#include "snapshot/crashpad_info_client_options.h"
|
||||
#include "snapshot/exception_snapshot.h"
|
||||
@ -190,7 +190,7 @@ class ProcessSnapshotWin final : public ProcessSnapshot {
|
||||
PointerVector<internal::ThreadSnapshotWin> threads_;
|
||||
PointerVector<internal::ModuleSnapshotWin> modules_;
|
||||
std::vector<UnloadedModuleSnapshot> unloaded_modules_;
|
||||
scoped_ptr<internal::ExceptionSnapshotWin> exception_;
|
||||
std::unique_ptr<internal::ExceptionSnapshotWin> exception_;
|
||||
PointerVector<internal::MemoryMapRegionSnapshotWin> memory_map_;
|
||||
ProcessReaderWin process_reader_;
|
||||
UUID report_id_;
|
||||
|
@ -17,12 +17,12 @@
|
||||
#include <AvailabilityMacros.h>
|
||||
#include <bsm/libbsm.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/auto_reset.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/mac/scoped_mach_port.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "test/errors.h"
|
||||
#include "test/mac/mach_errors.h"
|
||||
@ -75,7 +75,7 @@ MachMultiprocess::MachMultiprocess() : Multiprocess(), info_(nullptr) {
|
||||
|
||||
void MachMultiprocess::Run() {
|
||||
ASSERT_EQ(nullptr, info_);
|
||||
scoped_ptr<internal::MachMultiprocessInfo> info(
|
||||
std::unique_ptr<internal::MachMultiprocessInfo> info(
|
||||
new internal::MachMultiprocessInfo);
|
||||
base::AutoReset<internal::MachMultiprocessInfo*> reset_info(&info_,
|
||||
info.get());
|
||||
|
@ -19,12 +19,12 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/auto_reset.h"
|
||||
#include "base/files/scoped_file.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "gtest/gtest.h"
|
||||
@ -61,7 +61,8 @@ Multiprocess::Multiprocess()
|
||||
|
||||
void Multiprocess::Run() {
|
||||
ASSERT_EQ(nullptr, info_);
|
||||
scoped_ptr<internal::MultiprocessInfo> info(new internal::MultiprocessInfo);
|
||||
std::unique_ptr<internal::MultiprocessInfo> info(
|
||||
new internal::MultiprocessInfo);
|
||||
base::AutoReset<internal::MultiprocessInfo*> reset_info(&info_, info.get());
|
||||
|
||||
ASSERT_NO_FATAL_FAILURE(PreFork());
|
||||
|
@ -165,20 +165,20 @@ bool WinChildProcess::IsChildProcess() {
|
||||
}
|
||||
|
||||
// static
|
||||
scoped_ptr<WinChildProcess::Handles> WinChildProcess::Launch() {
|
||||
std::unique_ptr<WinChildProcess::Handles> WinChildProcess::Launch() {
|
||||
// Make pipes for child-to-parent and parent-to-child communication.
|
||||
scoped_ptr<Handles> handles_for_parent(new Handles);
|
||||
std::unique_ptr<Handles> handles_for_parent(new Handles);
|
||||
ScopedFileHANDLE read_for_child;
|
||||
ScopedFileHANDLE write_for_child;
|
||||
|
||||
if (!CreateInheritablePipe(
|
||||
&handles_for_parent->read, false, &write_for_child, true)) {
|
||||
return scoped_ptr<Handles>();
|
||||
return std::unique_ptr<Handles>();
|
||||
}
|
||||
|
||||
if (!CreateInheritablePipe(
|
||||
&read_for_child, true, &handles_for_parent->write, false)) {
|
||||
return scoped_ptr<Handles>();
|
||||
return std::unique_ptr<Handles>();
|
||||
}
|
||||
|
||||
// Build a command line for the child process that tells it only to run the
|
||||
@ -197,7 +197,7 @@ scoped_ptr<WinChildProcess::Handles> WinChildProcess::Launch() {
|
||||
// Command-line buffer cannot be constant, per CreateProcess signature.
|
||||
handles_for_parent->process = LaunchCommandLine(&command_line[0]);
|
||||
if (!handles_for_parent->process.is_valid())
|
||||
return scoped_ptr<Handles>();
|
||||
return std::unique_ptr<Handles>();
|
||||
|
||||
// Block until the child process has launched. CreateProcess() returns
|
||||
// immediately, and test code expects process initialization to have
|
||||
@ -205,12 +205,12 @@ scoped_ptr<WinChildProcess::Handles> WinChildProcess::Launch() {
|
||||
char c;
|
||||
if (!LoggingReadFile(handles_for_parent->read.get(), &c, sizeof(c))) {
|
||||
ADD_FAILURE() << "LoggedReadFile";
|
||||
return scoped_ptr<Handles>();
|
||||
return std::unique_ptr<Handles>();
|
||||
}
|
||||
|
||||
if (c != ' ') {
|
||||
ADD_FAILURE() << "invalid data read from child";
|
||||
return scoped_ptr<Handles>();
|
||||
return std::unique_ptr<Handles>();
|
||||
}
|
||||
|
||||
return std::move(handles_for_parent);
|
||||
|
@ -15,8 +15,9 @@
|
||||
#ifndef CRASHPAD_TEST_WIN_WIN_CHILD_PROCESS_H_
|
||||
#define CRASHPAD_TEST_WIN_WIN_CHILD_PROCESS_H_
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "util/file/file_io.h"
|
||||
#include "util/win/scoped_handle.h"
|
||||
|
||||
@ -63,7 +64,7 @@ class WinChildProcess {
|
||||
//! \brief Launches a child process and returns the Handles for that process.
|
||||
//! The process is guaranteed to be executing by the time this method
|
||||
//! returns. Returns null and logs a GTest failure in case of failure.
|
||||
static scoped_ptr<Handles> Launch();
|
||||
static std::unique_ptr<Handles> Launch();
|
||||
|
||||
protected:
|
||||
//! \brief Returns a handle to read from an anonymous pipe shared with the
|
||||
|
@ -59,7 +59,7 @@ class TestWinChildProcess final : public WinChildProcess {
|
||||
TEST(WinChildProcessTest, WinChildProcess) {
|
||||
WinChildProcess::EntryPoint<TestWinChildProcess>();
|
||||
|
||||
scoped_ptr<WinChildProcess::Handles> handles = WinChildProcess::Launch();
|
||||
std::unique_ptr<WinChildProcess::Handles> handles = WinChildProcess::Launch();
|
||||
WriteInt(handles->write.get(), 1);
|
||||
ASSERT_EQ(1, ReadInt(handles->read.get()));
|
||||
}
|
||||
@ -67,9 +67,12 @@ TEST(WinChildProcessTest, WinChildProcess) {
|
||||
TEST(WinChildProcessTest, MultipleChildren) {
|
||||
WinChildProcess::EntryPoint<TestWinChildProcess>();
|
||||
|
||||
scoped_ptr<WinChildProcess::Handles> handles_1 = WinChildProcess::Launch();
|
||||
scoped_ptr<WinChildProcess::Handles> handles_2 = WinChildProcess::Launch();
|
||||
scoped_ptr<WinChildProcess::Handles> handles_3 = WinChildProcess::Launch();
|
||||
std::unique_ptr<WinChildProcess::Handles> handles_1 =
|
||||
WinChildProcess::Launch();
|
||||
std::unique_ptr<WinChildProcess::Handles> handles_2 =
|
||||
WinChildProcess::Launch();
|
||||
std::unique_ptr<WinChildProcess::Handles> handles_3 =
|
||||
WinChildProcess::Launch();
|
||||
|
||||
WriteInt(handles_1->write.get(), 1);
|
||||
WriteInt(handles_2->write.get(), 2);
|
||||
|
@ -43,7 +43,7 @@ class WinMultiprocess {
|
||||
ASSERT_NO_FATAL_FAILURE(
|
||||
WinChildProcess::EntryPoint<ChildProcessHelper<T>>());
|
||||
// If WinChildProcess::EntryPoint returns, we are in the parent process.
|
||||
scoped_ptr<WinChildProcess::Handles> child_handles =
|
||||
std::unique_ptr<WinChildProcess::Handles> child_handles =
|
||||
WinChildProcess::Launch();
|
||||
ASSERT_TRUE(child_handles.get());
|
||||
T parent_process;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
@ -28,7 +29,6 @@
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/numerics/safe_conversions.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
@ -424,7 +424,7 @@ int DatabaseUtilMain(int argc, char* argv[]) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
scoped_ptr<CrashReportDatabase> database;
|
||||
std::unique_ptr<CrashReportDatabase> database;
|
||||
base::FilePath database_path = base::FilePath(
|
||||
ToolSupport::CommandLineArgumentToFilePathStringType(options.database));
|
||||
if (options.create) {
|
||||
@ -541,14 +541,14 @@ int DatabaseUtilMain(int argc, char* argv[]) {
|
||||
}
|
||||
|
||||
for (const base::FilePath new_report_path : options.new_report_paths) {
|
||||
scoped_ptr<FileReaderInterface> file_reader;
|
||||
std::unique_ptr<FileReaderInterface> file_reader;
|
||||
|
||||
bool is_stdin = false;
|
||||
if (new_report_path.value() == FILE_PATH_LITERAL("-")) {
|
||||
is_stdin = true;
|
||||
file_reader.reset(new WeakStdioFileReader(stdin));
|
||||
} else {
|
||||
scoped_ptr<FileReader> file_path_reader(new FileReader());
|
||||
std::unique_ptr<FileReader> file_path_reader(new FileReader());
|
||||
if (!file_path_reader->Open(new_report_path)) {
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
@ -18,10 +18,10 @@
|
||||
#include <stdlib.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "build/build_config.h"
|
||||
#include "minidump/minidump_file_writer.h"
|
||||
@ -165,12 +165,12 @@ int GenerateDumpMain(int argc, char* argv[]) {
|
||||
|
||||
{
|
||||
#if defined(OS_MACOSX)
|
||||
scoped_ptr<ScopedTaskSuspend> suspend;
|
||||
std::unique_ptr<ScopedTaskSuspend> suspend;
|
||||
if (options.suspend) {
|
||||
suspend.reset(new ScopedTaskSuspend(task));
|
||||
}
|
||||
#elif defined(OS_WIN)
|
||||
scoped_ptr<ScopedProcessSuspend> suspend;
|
||||
std::unique_ptr<ScopedProcessSuspend> suspend;
|
||||
if (options.suspend) {
|
||||
suspend.reset(new ScopedProcessSuspend(process.get()));
|
||||
}
|
||||
|
@ -16,9 +16,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "package.h"
|
||||
|
||||
@ -75,7 +75,7 @@ void ToolSupport::UsageHint(const std::string& me, const char* hint) {
|
||||
|
||||
// static
|
||||
int ToolSupport::Wmain(int argc, wchar_t* argv[], int (*entry)(int, char* [])) {
|
||||
scoped_ptr<char* []> argv_as_utf8(new char* [argc + 1]);
|
||||
std::unique_ptr<char* []> argv_as_utf8(new char*[argc + 1]);
|
||||
std::vector<std::string> storage;
|
||||
storage.reserve(argc);
|
||||
for (int i = 0; i < argc; ++i) {
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
#include <mach/mach.h>
|
||||
|
||||
#include <memory>
|
||||
#include <set>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "util/mach/mach_extensions.h"
|
||||
#include "util/mach/mach_message_server.h"
|
||||
|
||||
@ -111,7 +111,7 @@ class UniversalMachExcServer final : public MachMessageServer::Interface {
|
||||
mach_msg_size_t MachMessageServerReplySize() override;
|
||||
|
||||
private:
|
||||
scoped_ptr<internal::UniversalMachExcServerImpl> impl_;
|
||||
std::unique_ptr<internal::UniversalMachExcServerImpl> impl_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(UniversalMachExcServer);
|
||||
};
|
||||
|
@ -68,7 +68,7 @@ TaskMemory::TaskMemory(task_t task) : task_(task) {
|
||||
}
|
||||
|
||||
bool TaskMemory::Read(mach_vm_address_t address, size_t size, void* buffer) {
|
||||
scoped_ptr<MappedMemory> memory = ReadMapped(address, size);
|
||||
std::unique_ptr<MappedMemory> memory = ReadMapped(address, size);
|
||||
if (!memory) {
|
||||
return false;
|
||||
}
|
||||
@ -77,10 +77,11 @@ bool TaskMemory::Read(mach_vm_address_t address, size_t size, void* buffer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
scoped_ptr<TaskMemory::MappedMemory> TaskMemory::ReadMapped(
|
||||
mach_vm_address_t address, size_t size) {
|
||||
std::unique_ptr<TaskMemory::MappedMemory> TaskMemory::ReadMapped(
|
||||
mach_vm_address_t address,
|
||||
size_t size) {
|
||||
if (size == 0) {
|
||||
return scoped_ptr<MappedMemory>(new MappedMemory(0, 0, 0, 0));
|
||||
return std::unique_ptr<MappedMemory>(new MappedMemory(0, 0, 0, 0));
|
||||
}
|
||||
|
||||
mach_vm_address_t region_address = mach_vm_trunc_page(address);
|
||||
@ -94,11 +95,11 @@ scoped_ptr<TaskMemory::MappedMemory> TaskMemory::ReadMapped(
|
||||
if (kr != KERN_SUCCESS) {
|
||||
MACH_LOG(WARNING, kr) << base::StringPrintf(
|
||||
"mach_vm_read(0x%llx, 0x%llx)", region_address, region_size);
|
||||
return scoped_ptr<MappedMemory>();
|
||||
return std::unique_ptr<MappedMemory>();
|
||||
}
|
||||
|
||||
DCHECK_EQ(region_count, region_size);
|
||||
return scoped_ptr<MappedMemory>(
|
||||
return std::unique_ptr<MappedMemory>(
|
||||
new MappedMemory(region, region_size, address - region_address, size));
|
||||
}
|
||||
|
||||
@ -130,7 +131,7 @@ bool TaskMemory::ReadCStringInternal(mach_vm_address_t address,
|
||||
do {
|
||||
mach_vm_size_t read_length =
|
||||
std::min(size, PAGE_SIZE - (read_address % PAGE_SIZE));
|
||||
scoped_ptr<MappedMemory> read_region =
|
||||
std::unique_ptr<MappedMemory> read_region =
|
||||
ReadMapped(read_address, read_length);
|
||||
if (!read_region) {
|
||||
return false;
|
||||
|
@ -18,11 +18,11 @@
|
||||
#include <mach/mach.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/mac/scoped_mach_vm.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
|
||||
namespace crashpad {
|
||||
|
||||
@ -123,7 +123,8 @@ class TaskMemory {
|
||||
//! \return On success, a MappedMemory object that provides access to the data
|
||||
//! requested. On faliure, `nullptr`, with a warning logged. Failures can
|
||||
//! occur, for example, when encountering unmapped or unreadable pages.
|
||||
scoped_ptr<MappedMemory> ReadMapped(mach_vm_address_t address, size_t size);
|
||||
std::unique_ptr<MappedMemory> ReadMapped(mach_vm_address_t address,
|
||||
size_t size);
|
||||
|
||||
//! \brief Reads a `NUL`-terminated C string from the target task into a
|
||||
//! string in the current task.
|
||||
|
@ -18,11 +18,11 @@
|
||||
#include <string.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/mac/scoped_mach_port.h"
|
||||
#include "base/mac/scoped_mach_vm.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "gtest/gtest.h"
|
||||
#include "test/mac/mach_errors.h"
|
||||
|
||||
@ -47,7 +47,7 @@ TEST(TaskMemory, ReadSelf) {
|
||||
|
||||
// This tests using both the Read() and ReadMapped() interfaces.
|
||||
std::string result(kSize, '\0');
|
||||
scoped_ptr<TaskMemory::MappedMemory> mapped;
|
||||
std::unique_ptr<TaskMemory::MappedMemory> mapped;
|
||||
|
||||
// Ensure that the entire region can be read.
|
||||
ASSERT_TRUE(memory.Read(address, kSize, &result[0]));
|
||||
@ -129,7 +129,7 @@ TEST(TaskMemory, ReadSelfUnmapped) {
|
||||
EXPECT_TRUE(memory.Read(address + PAGE_SIZE - 1, 1, &result[0]));
|
||||
|
||||
// Do the same thing with the ReadMapped() interface.
|
||||
scoped_ptr<TaskMemory::MappedMemory> mapped;
|
||||
std::unique_ptr<TaskMemory::MappedMemory> mapped;
|
||||
EXPECT_FALSE((mapped = memory.ReadMapped(address, kSize)));
|
||||
EXPECT_FALSE((mapped = memory.ReadMapped(address + 1, kSize - 1)));
|
||||
EXPECT_FALSE((mapped = memory.ReadMapped(address + PAGE_SIZE, 1)));
|
||||
@ -458,7 +458,7 @@ TEST(TaskMemory, MappedMemoryDeallocates) {
|
||||
// nothing else should wind up mapped in the address.
|
||||
|
||||
TaskMemory memory(mach_task_self());
|
||||
scoped_ptr<TaskMemory::MappedMemory> mapped;
|
||||
std::unique_ptr<TaskMemory::MappedMemory> mapped;
|
||||
|
||||
static const char kTestBuffer[] = "hello!";
|
||||
mach_vm_address_t test_address =
|
||||
@ -476,7 +476,7 @@ TEST(TaskMemory, MappedMemoryDeallocates) {
|
||||
// single page. This makes sure that the whole mapped region winds up being
|
||||
// deallocated.
|
||||
const size_t kBigSize = 4 * PAGE_SIZE;
|
||||
scoped_ptr<char[]> big_buffer(new char[kBigSize]);
|
||||
std::unique_ptr<char[]> big_buffer(new char[kBigSize]);
|
||||
test_address = reinterpret_cast<mach_vm_address_t>(&big_buffer[0]);
|
||||
ASSERT_TRUE((mapped = memory.ReadMapped(test_address, kBigSize)));
|
||||
|
||||
@ -495,7 +495,7 @@ TEST(TaskMemory, MappedMemoryDeallocates) {
|
||||
TEST(TaskMemory, MappedMemoryReadCString) {
|
||||
// This tests the behavior of TaskMemory::MappedMemory::ReadCString().
|
||||
TaskMemory memory(mach_task_self());
|
||||
scoped_ptr<TaskMemory::MappedMemory> mapped;
|
||||
std::unique_ptr<TaskMemory::MappedMemory> mapped;
|
||||
|
||||
static const char kTestBuffer[] = "0\0" "2\0" "45\0" "789";
|
||||
const mach_vm_address_t kTestAddress =
|
||||
|
@ -16,7 +16,8 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include <memory>
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "util/file/file_io.h"
|
||||
#include "util/net/http_body.h"
|
||||
@ -29,7 +30,7 @@ std::string ReadStreamToString(HTTPBodyStream* stream) {
|
||||
}
|
||||
|
||||
std::string ReadStreamToString(HTTPBodyStream* stream, size_t buffer_size) {
|
||||
scoped_ptr<uint8_t[]> buf(new uint8_t[buffer_size]);
|
||||
std::unique_ptr<uint8_t[]> buf(new uint8_t[buffer_size]);
|
||||
std::string result;
|
||||
|
||||
FileOperationResult bytes_read;
|
||||
|
@ -149,7 +149,7 @@ void HTTPMultipartBuilder::SetFileAttachment(
|
||||
file_attachments_[key] = attachment;
|
||||
}
|
||||
|
||||
scoped_ptr<HTTPBodyStream> HTTPMultipartBuilder::GetBodyStream() {
|
||||
std::unique_ptr<HTTPBodyStream> HTTPMultipartBuilder::GetBodyStream() {
|
||||
// The objects inserted into this vector will be owned by the returned
|
||||
// CompositeHTTPBodyStream. Take care to not early-return without deleting
|
||||
// this memory.
|
||||
@ -179,7 +179,7 @@ scoped_ptr<HTTPBodyStream> HTTPMultipartBuilder::GetBodyStream() {
|
||||
streams.push_back(
|
||||
new StringHTTPBodyStream("--" + boundary_ + "--" + kCRLF));
|
||||
|
||||
return scoped_ptr<HTTPBodyStream>(new CompositeHTTPBodyStream(streams));
|
||||
return std::unique_ptr<HTTPBodyStream>(new CompositeHTTPBodyStream(streams));
|
||||
}
|
||||
|
||||
HTTPHeaders::value_type HTTPMultipartBuilder::GetContentType() const {
|
||||
|
@ -16,11 +16,11 @@
|
||||
#define CRASHPAD_UTIL_NET_HTTP_MULTIPART_BUILDER_H_
|
||||
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "util/net/http_headers.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -62,7 +62,7 @@ class HTTPMultipartBuilder {
|
||||
//! the builder.
|
||||
//!
|
||||
//! \return A caller-owned HTTPBodyStream object.
|
||||
scoped_ptr<HTTPBodyStream> GetBodyStream();
|
||||
std::unique_ptr<HTTPBodyStream> GetBodyStream();
|
||||
|
||||
//! \brief Gets the header pair for `"Content-Type"`.
|
||||
HTTPHeaders::value_type GetContentType() const;
|
||||
|
@ -67,7 +67,7 @@ TEST(HTTPMultipartBuilder, ThreeStringFields) {
|
||||
const char kValue3[] = "More tests";
|
||||
builder.SetFormData(kKey3, kValue3);
|
||||
|
||||
scoped_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
std::unique_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
ASSERT_TRUE(body.get());
|
||||
std::string contents = ReadStreamToString(body.get());
|
||||
auto lines = SplitCRLF(contents);
|
||||
@ -116,7 +116,7 @@ TEST(HTTPMultipartBuilder, ThreeFileAttachments) {
|
||||
|
||||
const char kFileContents[] = "This is a test.\n";
|
||||
|
||||
scoped_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
std::unique_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
ASSERT_TRUE(body.get());
|
||||
std::string contents = ReadStreamToString(body.get());
|
||||
auto lines = SplitCRLF(contents);
|
||||
@ -160,7 +160,7 @@ TEST(HTTPMultipartBuilder, OverwriteFormDataWithEscapedKey) {
|
||||
const char kKey[] = "a 100% \"silly\"\r\ntest";
|
||||
builder.SetFormData(kKey, "some dummy value");
|
||||
builder.SetFormData(kKey, "overwrite");
|
||||
scoped_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
std::unique_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
ASSERT_TRUE(body.get());
|
||||
std::string contents = ReadStreamToString(body.get());
|
||||
auto lines = SplitCRLF(contents);
|
||||
@ -200,7 +200,7 @@ TEST(HTTPMultipartBuilder, OverwriteFileAttachment) {
|
||||
testdata_path.Append(FILE_PATH_LITERAL(
|
||||
"ascii_http_body.txt")),
|
||||
"text/plain");
|
||||
scoped_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
std::unique_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
ASSERT_TRUE(body.get());
|
||||
std::string contents = ReadStreamToString(body.get());
|
||||
auto lines = SplitCRLF(contents);
|
||||
@ -249,7 +249,7 @@ TEST(HTTPMultipartBuilder, SharedFormDataAndAttachmentKeyNamespace) {
|
||||
const char kValue2[] = "this is not a file";
|
||||
builder.SetFormData("minidump", kValue2);
|
||||
|
||||
scoped_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
std::unique_ptr<HTTPBodyStream> body(builder.GetBodyStream());
|
||||
ASSERT_TRUE(body.get());
|
||||
std::string contents = ReadStreamToString(body.get());
|
||||
auto lines = SplitCRLF(contents);
|
||||
|
@ -44,7 +44,7 @@ void HTTPTransport::SetHeader(const std::string& header,
|
||||
headers_[header] = value;
|
||||
}
|
||||
|
||||
void HTTPTransport::SetBodyStream(scoped_ptr<HTTPBodyStream> stream) {
|
||||
void HTTPTransport::SetBodyStream(std::unique_ptr<HTTPBodyStream> stream) {
|
||||
body_stream_ = std::move(stream);
|
||||
}
|
||||
|
||||
|
@ -15,10 +15,10 @@
|
||||
#ifndef CRASHPAD_UTIL_NET_HTTP_TRANSPORT_H_
|
||||
#define CRASHPAD_UTIL_NET_HTTP_TRANSPORT_H_
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "util/net/http_headers.h"
|
||||
|
||||
namespace crashpad {
|
||||
@ -40,7 +40,7 @@ class HTTPTransport {
|
||||
//! operating system.
|
||||
//!
|
||||
//! \return A new caller-owned HTTPTransport object.
|
||||
static scoped_ptr<HTTPTransport> Create();
|
||||
static std::unique_ptr<HTTPTransport> Create();
|
||||
|
||||
//! \brief Sets URL to which the request will be made.
|
||||
//!
|
||||
@ -64,7 +64,7 @@ class HTTPTransport {
|
||||
//!
|
||||
//! \param[in] stream A HTTPBodyStream, of which this class will take
|
||||
//! ownership.
|
||||
void SetBodyStream(scoped_ptr<HTTPBodyStream> stream);
|
||||
void SetBodyStream(std::unique_ptr<HTTPBodyStream> stream);
|
||||
|
||||
//! \brief Sets the timeout for the HTTP request. The default is 15 seconds.
|
||||
//!
|
||||
@ -95,7 +95,7 @@ class HTTPTransport {
|
||||
std::string url_;
|
||||
std::string method_;
|
||||
HTTPHeaders headers_;
|
||||
scoped_ptr<HTTPBodyStream> body_stream_;
|
||||
std::unique_ptr<HTTPBodyStream> body_stream_;
|
||||
double timeout_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(HTTPTransport);
|
||||
|
@ -227,8 +227,8 @@ bool HTTPTransportMac::ExecuteSynchronously(std::string* response_body) {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
scoped_ptr<HTTPTransport> HTTPTransport::Create() {
|
||||
return scoped_ptr<HTTPTransport>(new HTTPTransportMac());
|
||||
std::unique_ptr<HTTPTransport> HTTPTransport::Create() {
|
||||
return std::unique_ptr<HTTPTransport>(new HTTPTransportMac());
|
||||
}
|
||||
|
||||
} // namespace crashpad
|
||||
|
@ -19,13 +19,13 @@
|
||||
#include <string.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#include "base/files/file_path.h"
|
||||
#include "base/format_macros.h"
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/strings/stringprintf.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "build/build_config.h"
|
||||
@ -48,7 +48,7 @@ class HTTPTransportTestFixture : public MultiprocessExec {
|
||||
void(*)(HTTPTransportTestFixture*, const std::string&);
|
||||
|
||||
HTTPTransportTestFixture(const HTTPHeaders& headers,
|
||||
scoped_ptr<HTTPBodyStream> body_stream,
|
||||
std::unique_ptr<HTTPBodyStream> body_stream,
|
||||
uint16_t http_response_code,
|
||||
RequestValidator request_validator)
|
||||
: MultiprocessExec(),
|
||||
@ -98,7 +98,7 @@ class HTTPTransportTestFixture : public MultiprocessExec {
|
||||
random_string.size()));
|
||||
|
||||
// Now execute the HTTP request.
|
||||
scoped_ptr<HTTPTransport> transport(HTTPTransport::Create());
|
||||
std::unique_ptr<HTTPTransport> transport(HTTPTransport::Create());
|
||||
transport->SetMethod("POST");
|
||||
transport->SetURL(base::StringPrintf("http://127.0.0.1:%d/upload", port));
|
||||
for (const auto& pair : headers_) {
|
||||
@ -131,7 +131,7 @@ class HTTPTransportTestFixture : public MultiprocessExec {
|
||||
}
|
||||
|
||||
HTTPHeaders headers_;
|
||||
scoped_ptr<HTTPBodyStream> body_stream_;
|
||||
std::unique_ptr<HTTPBodyStream> body_stream_;
|
||||
uint16_t response_code_;
|
||||
RequestValidator request_validator_;
|
||||
};
|
||||
@ -266,7 +266,8 @@ void UnchunkedPlainText(HTTPTransportTestFixture* fixture,
|
||||
}
|
||||
|
||||
TEST(HTTPTransport, UnchunkedPlainText) {
|
||||
scoped_ptr<HTTPBodyStream> body_stream(new StringHTTPBodyStream(kTextBody));
|
||||
std::unique_ptr<HTTPBodyStream> body_stream(
|
||||
new StringHTTPBodyStream(kTextBody));
|
||||
|
||||
HTTPHeaders headers;
|
||||
headers[kContentType] = kTextPlain;
|
||||
@ -284,7 +285,7 @@ void RunUpload33k(bool has_content_length) {
|
||||
// Read().
|
||||
|
||||
std::string request_string(33 * 1024, 'a');
|
||||
scoped_ptr<HTTPBodyStream> body_stream(
|
||||
std::unique_ptr<HTTPBodyStream> body_stream(
|
||||
new StringHTTPBodyStream(request_string));
|
||||
|
||||
HTTPHeaders headers;
|
||||
|
@ -245,8 +245,8 @@ bool HTTPTransportWin::ExecuteSynchronously(std::string* response_body) {
|
||||
} // namespace
|
||||
|
||||
// static
|
||||
scoped_ptr<HTTPTransport> HTTPTransport::Create() {
|
||||
return scoped_ptr<HTTPTransportWin>(new HTTPTransportWin);
|
||||
std::unique_ptr<HTTPTransport> HTTPTransport::Create() {
|
||||
return std::unique_ptr<HTTPTransportWin>(new HTTPTransportWin);
|
||||
}
|
||||
|
||||
} // namespace crashpad
|
||||
|
@ -23,9 +23,9 @@
|
||||
#include <unistd.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <memory>
|
||||
|
||||
#include "base/logging.h"
|
||||
#include "base/memory/scoped_ptr.h"
|
||||
#include "base/posix/eintr_wrapper.h"
|
||||
#include "build/build_config.h"
|
||||
#include "util/misc/implicit_cast.h"
|
||||
@ -73,7 +73,7 @@ struct ScopedDIRCloser {
|
||||
}
|
||||
};
|
||||
|
||||
using ScopedDIR = scoped_ptr<DIR, ScopedDIRCloser>;
|
||||
using ScopedDIR = std::unique_ptr<DIR, ScopedDIRCloser>;
|
||||
|
||||
// This function implements CloseMultipleNowOrOnExec() using an operating
|
||||
// system-specific FD directory to determine which file descriptors are open.
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user