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

Unified Diff: base/message_loop/message_pump_perftest.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/message_loop/message_pump_libevent_unittest.cc ('k') | base/metrics/field_trial.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_loop/message_pump_perftest.cc
diff --git a/base/message_loop/message_pump_perftest.cc b/base/message_loop/message_pump_perftest.cc
index 789fc1f391bb640beafde1053b70cfafa73da091..edaf2068ff6ec1cdfe0df140f35f4a88f898954e 100644
--- a/base/message_loop/message_pump_perftest.cc
+++ b/base/message_loop/message_pump_perftest.cc
@@ -7,6 +7,7 @@
#include "base/bind.h"
#include "base/format_macros.h"
+#include "base/memory/ptr_util.h"
#include "base/memory/scoped_vector.h"
#include "base/strings/stringprintf.h"
#include "base/synchronization/condition_variable.h"
@@ -87,7 +88,7 @@ class ScheduleWorkTest : public testing::Test {
target_->WaitUntilThreadStarted();
}
- std::vector<scoped_ptr<Thread>> scheduling_threads;
+ std::vector<std::unique_ptr<Thread>> scheduling_threads;
scheduling_times_.reset(new base::TimeDelta[num_scheduling_threads]);
scheduling_thread_times_.reset(new base::TimeDelta[num_scheduling_threads]);
min_batch_times_.reset(new base::TimeDelta[num_scheduling_threads]);
@@ -95,7 +96,7 @@ class ScheduleWorkTest : public testing::Test {
for (int i = 0; i < num_scheduling_threads; ++i) {
scheduling_threads.push_back(
- make_scoped_ptr(new Thread("posting thread")));
+ WrapUnique(new Thread("posting thread")));
scheduling_threads[i]->Start();
}
@@ -175,14 +176,14 @@ class ScheduleWorkTest : public testing::Test {
}
private:
- scoped_ptr<Thread> target_;
+ std::unique_ptr<Thread> target_;
#if defined(OS_ANDROID)
- scoped_ptr<android::JavaHandlerThread> java_thread_;
+ std::unique_ptr<android::JavaHandlerThread> java_thread_;
#endif
- scoped_ptr<base::TimeDelta[]> scheduling_times_;
- scoped_ptr<base::TimeDelta[]> scheduling_thread_times_;
- scoped_ptr<base::TimeDelta[]> min_batch_times_;
- scoped_ptr<base::TimeDelta[]> max_batch_times_;
+ std::unique_ptr<base::TimeDelta[]> scheduling_times_;
+ std::unique_ptr<base::TimeDelta[]> scheduling_thread_times_;
+ std::unique_ptr<base::TimeDelta[]> min_batch_times_;
+ std::unique_ptr<base::TimeDelta[]> max_batch_times_;
uint64_t counter_;
static const size_t kTargetTimeSec = 5;
@@ -256,7 +257,7 @@ class PostTaskTest : public testing::Test {
void Run(int batch_size, int tasks_per_reload) {
base::TimeTicks start = base::TimeTicks::Now();
base::TimeTicks now;
- MessageLoop loop(scoped_ptr<MessagePump>(new FakeMessagePump));
+ MessageLoop loop(std::unique_ptr<MessagePump>(new FakeMessagePump));
scoped_refptr<internal::IncomingTaskQueue> queue(
new internal::IncomingTaskQueue(&loop));
uint32_t num_posted = 0;
« no previous file with comments | « base/message_loop/message_pump_libevent_unittest.cc ('k') | base/metrics/field_trial.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698