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

Unified Diff: third_party/crashpad/crashpad/util/mach/task_memory_test.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_test.cc
diff --git a/third_party/crashpad/crashpad/util/mach/task_memory_test.cc b/third_party/crashpad/crashpad/util/mach/task_memory_test.cc
index 963bc4da5a9722f5f9ffbd8666b9824deaf8fefa..005288dda71f3f3f2cfc4ba58efcaf925c167193 100644
--- a/third_party/crashpad/crashpad/util/mach/task_memory_test.cc
+++ b/third_party/crashpad/crashpad/util/mach/task_memory_test.cc
@@ -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 =
« no previous file with comments | « third_party/crashpad/crashpad/util/mach/task_memory.cc ('k') | third_party/crashpad/crashpad/util/net/http_body_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698