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

Unified Diff: third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 10 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/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
diff --git a/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc b/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
index fafb25bbeb298123fe7d849c1e12cfa5bf7c1afa..d2454d35aac7d2512d89b5a7ca744d1d6dee58f6 100644
--- a/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
+++ b/third_party/WebKit/Source/platform/web_process_memory_dump_impl_test.cc
@@ -18,8 +18,7 @@ namespace blink {
// behaves correctly, performs the right transfers of memory ownerships and
// doesn't leak objects.
TEST(WebProcessMemoryDumpImplTest, IntegrationTest) {
- scoped_refptr<base::trace_event::TracedValue> traced_value(
- new base::trace_event::TracedValue());
+ auto traced_value = make_scoped_ptr(new base::trace_event::TracedValue);
scoped_ptr<WebProcessMemoryDumpImpl> wpmd1(new WebProcessMemoryDumpImpl());
auto wmad1 = wpmd1->createMemoryAllocatorDump("1/1");
@@ -90,7 +89,7 @@ TEST(WebProcessMemoryDumpImplTest, IntegrationTest) {
ASSERT_NE(null_wmad, wpmd1->getMemoryAllocatorDump("2/2"));
// Check that AsValueInto() doesn't cause a crash.
- traced_value = new base::trace_event::TracedValue();
+ traced_value.reset(new base::trace_event::TracedValue);
wpmd1->process_memory_dump()->AsValueInto(traced_value.get());
// Check that clear() actually works.
@@ -100,7 +99,7 @@ TEST(WebProcessMemoryDumpImplTest, IntegrationTest) {
ASSERT_EQ(nullptr, wpmd1->process_memory_dump()->GetAllocatorDump("2/1"));
// Check that AsValueInto() doesn't cause a crash.
- traced_value = new base::trace_event::TracedValue();
+ traced_value.reset(new base::trace_event::TracedValue);
wpmd1->process_memory_dump()->AsValueInto(traced_value.get());
// Check if a WebMemoryAllocatorDump created with guid, has correct guid.

Powered by Google App Engine
This is Rietveld 408576698