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

Unified Diff: base/trace_event/memory_allocator_dump_unittest.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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
« no previous file with comments | « base/trace_event/memory_allocator_dump.h ('k') | base/trace_event/memory_dump_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_allocator_dump_unittest.cc
diff --git a/base/trace_event/memory_allocator_dump_unittest.cc b/base/trace_event/memory_allocator_dump_unittest.cc
index 649991b155201ce7ac6f6cfb42cbda5aff58fe2f..359f081154e5a23a091385fede02df7f511b189e 100644
--- a/base/trace_event/memory_allocator_dump_unittest.cc
+++ b/base/trace_event/memory_allocator_dump_unittest.cc
@@ -52,11 +52,12 @@ class FakeMemoryAllocatorDumpProvider : public MemoryDumpProvider {
}
};
-scoped_ptr<Value> CheckAttribute(const MemoryAllocatorDump* dump,
- const std::string& name,
- const char* expected_type,
- const char* expected_units) {
- scoped_ptr<Value> raw_attrs = dump->attributes_for_testing()->ToBaseValue();
+std::unique_ptr<Value> CheckAttribute(const MemoryAllocatorDump* dump,
+ const std::string& name,
+ const char* expected_type,
+ const char* expected_units) {
+ std::unique_ptr<Value> raw_attrs =
+ dump->attributes_for_testing()->ToBaseValue();
DictionaryValue* args = nullptr;
DictionaryValue* arg = nullptr;
std::string arg_value;
@@ -68,7 +69,7 @@ scoped_ptr<Value> CheckAttribute(const MemoryAllocatorDump* dump,
EXPECT_TRUE(arg->GetString("units", &arg_value));
EXPECT_EQ(expected_units, arg_value);
EXPECT_TRUE(arg->Get("value", &out_value));
- return out_value ? out_value->CreateDeepCopy() : scoped_ptr<Value>();
+ return out_value ? out_value->CreateDeepCopy() : std::unique_ptr<Value>();
}
void CheckString(const MemoryAllocatorDump* dump,
@@ -104,7 +105,7 @@ void CheckScalarF(const MemoryAllocatorDump* dump,
} // namespace
TEST(MemoryAllocatorDumpTest, GuidGeneration) {
- scoped_ptr<MemoryAllocatorDump> mad(
+ std::unique_ptr<MemoryAllocatorDump> mad(
new MemoryAllocatorDump("foo", nullptr, MemoryAllocatorDumpGuid(0x42u)));
ASSERT_EQ("42", mad->guid().ToString());
@@ -167,7 +168,7 @@ TEST(MemoryAllocatorDumpTest, DumpIntoProcessMemoryDump) {
ASSERT_FALSE(attrs->HasKey(MemoryAllocatorDump::kNameObjectCount));
// Check that the AsValueInfo doesn't hit any DCHECK.
- scoped_ptr<TracedValue> traced_value(new TracedValue);
+ std::unique_ptr<TracedValue> traced_value(new TracedValue);
pmd.AsValueInto(traced_value.get());
}
« no previous file with comments | « base/trace_event/memory_allocator_dump.h ('k') | base/trace_event/memory_dump_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698