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

Unified Diff: base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc

Issue 1717283003: tracing: Make ConvertableToTraceFormat move-only scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase 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: base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
diff --git a/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc b/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
index 82c8fb505e7c8321b98a6341c404be14efde719e..92ffcf83599ca9e579a0a61170ea890fbb069712 100644
--- a/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
+++ b/base/trace_event/heap_profiler_type_name_deduplicator_unittest.cc
@@ -5,7 +5,6 @@
#include <string>
#include "base/json/json_reader.h"
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "base/trace_event/heap_profiler_type_name_deduplicator.h"
#include "base/values.h"
@@ -21,9 +20,9 @@ const char kBool[] = "bool";
const char kString[] = "string";
const char kNeedsEscape[] = "\"quotes\"";
-scoped_ptr<Value> DumpAndReadBack(const ConvertableToTraceFormat& convertable) {
+scoped_ptr<Value> DumpAndReadBack(const TypeNameDeduplicator& deduplicator) {
std::string json;
- convertable.AppendAsTraceFormat(&json);
+ deduplicator.AppendAsTraceFormat(&json);
return JSONReader::Read(json);
}
@@ -34,7 +33,7 @@ TEST(TypeNameDeduplicatorTest, Deduplication) {
// 2: bool
// 3: string
- scoped_refptr<TypeNameDeduplicator> dedup = new TypeNameDeduplicator;
+ scoped_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator);
ASSERT_EQ(1, dedup->Insert(kInt));
ASSERT_EQ(2, dedup->Insert(kBool));
ASSERT_EQ(3, dedup->Insert(kString));
@@ -49,7 +48,7 @@ TEST(TypeNameDeduplicatorTest, Deduplication) {
}
TEST(TypeNameDeduplicatorTest, EscapeTypeName) {
- scoped_refptr<TypeNameDeduplicator> dedup = new TypeNameDeduplicator;
+ scoped_ptr<TypeNameDeduplicator> dedup(new TypeNameDeduplicator);
ASSERT_EQ(1, dedup->Insert(kNeedsEscape));
// Reading json should not fail, because the type name should have been

Powered by Google App Engine
This is Rietveld 408576698