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

Side by Side Diff: base/message_loop/message_pump_perftest.cc

Issue 2258713003: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/metrics/histogram.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/format_macros.h" 9 #include "base/format_macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 target_->WaitUntilThreadStarted(); 88 target_->WaitUntilThreadStarted();
89 } 89 }
90 90
91 std::vector<std::unique_ptr<Thread>> scheduling_threads; 91 std::vector<std::unique_ptr<Thread>> scheduling_threads;
92 scheduling_times_.reset(new base::TimeDelta[num_scheduling_threads]); 92 scheduling_times_.reset(new base::TimeDelta[num_scheduling_threads]);
93 scheduling_thread_times_.reset(new base::TimeDelta[num_scheduling_threads]); 93 scheduling_thread_times_.reset(new base::TimeDelta[num_scheduling_threads]);
94 min_batch_times_.reset(new base::TimeDelta[num_scheduling_threads]); 94 min_batch_times_.reset(new base::TimeDelta[num_scheduling_threads]);
95 max_batch_times_.reset(new base::TimeDelta[num_scheduling_threads]); 95 max_batch_times_.reset(new base::TimeDelta[num_scheduling_threads]);
96 96
97 for (int i = 0; i < num_scheduling_threads; ++i) { 97 for (int i = 0; i < num_scheduling_threads; ++i) {
98 scheduling_threads.push_back( 98 scheduling_threads.push_back(MakeUnique<Thread>("posting thread"));
99 WrapUnique(new Thread("posting thread")));
100 scheduling_threads[i]->Start(); 99 scheduling_threads[i]->Start();
101 } 100 }
102 101
103 for (int i = 0; i < num_scheduling_threads; ++i) { 102 for (int i = 0; i < num_scheduling_threads; ++i) {
104 scheduling_threads[i]->task_runner()->PostTask( 103 scheduling_threads[i]->task_runner()->PostTask(
105 FROM_HERE, 104 FROM_HERE,
106 base::Bind(&ScheduleWorkTest::Schedule, base::Unretained(this), i)); 105 base::Bind(&ScheduleWorkTest::Schedule, base::Unretained(this), i));
107 } 106 }
108 107
109 for (int i = 0; i < num_scheduling_threads; ++i) { 108 for (int i = 0; i < num_scheduling_threads; ++i) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 295
297 TEST_F(PostTaskTest, TenTasksPerReload) { 296 TEST_F(PostTaskTest, TenTasksPerReload) {
298 Run(10000, 10); 297 Run(10000, 10);
299 } 298 }
300 299
301 TEST_F(PostTaskTest, OneHundredTasksPerReload) { 300 TEST_F(PostTaskTest, OneHundredTasksPerReload) {
302 Run(1000, 100); 301 Run(1000, 100);
303 } 302 }
304 303
305 } // namespace base 304 } // namespace base
OLDNEW
« no previous file with comments | « base/json/json_writer_unittest.cc ('k') | base/metrics/histogram.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698