Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Unified Diff: third_party/crashpad/crashpad/util/mach/task_memory.cc

Issue 1911823002: Convert //third_party from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update crashpad's README.chromium Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/crashpad/crashpad/util/mach/task_memory.cc
diff --git a/third_party/crashpad/crashpad/util/mach/task_memory.cc b/third_party/crashpad/crashpad/util/mach/task_memory.cc
index b87d02ea8f55f7f110a66eac6e9db7f5cb4f0194..6168434d2d634267552d2b207bd1074f8feb4d5b 100644
--- a/third_party/crashpad/crashpad/util/mach/task_memory.cc
+++ b/third_party/crashpad/crashpad/util/mach/task_memory.cc
@@ -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;
« no previous file with comments | « third_party/crashpad/crashpad/util/mach/task_memory.h ('k') | third_party/crashpad/crashpad/util/mach/task_memory_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698