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

Unified Diff: base/trace_event/heap_profiler_stack_frame_deduplicator_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
Index: base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
diff --git a/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc b/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
index 24640367009ab7f80ec3edefdd58531547557b84..72cb743ad0c22162c1804d864de9aae68ea329eb 100644
--- a/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
+++ b/base/trace_event/heap_profiler_stack_frame_deduplicator_unittest.cc
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/trace_event/heap_profiler_stack_frame_deduplicator.h"
+
#include <iterator>
+#include <memory>
#include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
#include "base/trace_event/heap_profiler_allocation_context.h"
-#include "base/trace_event/heap_profiler_stack_frame_deduplicator.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -30,7 +31,7 @@ TEST(StackFrameDeduplicatorTest, SingleBacktrace) {
// CreateWidget [1]
// malloc [2]
- scoped_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
+ std::unique_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
ASSERT_EQ(2, dedup->Insert(std::begin(bt), std::end(bt)));
auto iter = dedup->begin();
@@ -63,7 +64,7 @@ TEST(StackFrameDeduplicatorTest, MultipleRoots) {
// Note that there will be two instances of CreateWidget,
// with different parents.
- scoped_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
+ std::unique_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
ASSERT_EQ(1, dedup->Insert(std::begin(bt0), std::end(bt0)));
ASSERT_EQ(3, dedup->Insert(std::begin(bt1), std::end(bt1)));
@@ -95,7 +96,7 @@ TEST(StackFrameDeduplicatorTest, Deduplication) {
//
// Note that BrowserMain will be re-used.
- scoped_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
+ std::unique_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
ASSERT_EQ(1, dedup->Insert(std::begin(bt0), std::end(bt0)));
ASSERT_EQ(2, dedup->Insert(std::begin(bt1), std::end(bt1)));
@@ -121,7 +122,7 @@ TEST(StackFrameDeduplicatorTest, Deduplication) {
TEST(StackFrameDeduplicatorTest, NullPaddingIsRemoved) {
StackFrame bt0[] = {kBrowserMain, nullptr, nullptr, nullptr};
- scoped_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
+ std::unique_ptr<StackFrameDeduplicator> dedup(new StackFrameDeduplicator);
// There are four frames in the backtrace, but the null pointers should be
// skipped, so only one frame is inserted, which will have index 0.

Powered by Google App Engine
This is Rietveld 408576698