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

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

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (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
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(
99 WrapUnique(new Thread("posting thread"))); 99 WrapUnique(new Thread("posting thread")));
100 scheduling_threads[i]->Start(); 100 scheduling_threads[i]->Start();
101 } 101 }
102 102
103 for (int i = 0; i < num_scheduling_threads; ++i) { 103 for (int i = 0; i < num_scheduling_threads; ++i) {
104 scheduling_threads[i]->message_loop()->task_runner()->PostTask( 104 scheduling_threads[i]->task_runner()->PostTask(
105 FROM_HERE, 105 FROM_HERE,
106 base::Bind(&ScheduleWorkTest::Schedule, base::Unretained(this), i)); 106 base::Bind(&ScheduleWorkTest::Schedule, base::Unretained(this), i));
107 } 107 }
108 108
109 for (int i = 0; i < num_scheduling_threads; ++i) { 109 for (int i = 0; i < num_scheduling_threads; ++i) {
110 scheduling_threads[i]->Stop(); 110 scheduling_threads[i]->Stop();
111 } 111 }
112 #if defined(OS_ANDROID) 112 #if defined(OS_ANDROID)
113 if (target_type == MessageLoop::TYPE_JAVA) { 113 if (target_type == MessageLoop::TYPE_JAVA) {
114 java_thread_->Stop(); 114 java_thread_->Stop();
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
296 296
297 TEST_F(PostTaskTest, TenTasksPerReload) { 297 TEST_F(PostTaskTest, TenTasksPerReload) {
298 Run(10000, 10); 298 Run(10000, 10);
299 } 299 }
300 300
301 TEST_F(PostTaskTest, OneHundredTasksPerReload) { 301 TEST_F(PostTaskTest, OneHundredTasksPerReload) {
302 Run(1000, 100); 302 Run(1000, 100);
303 } 303 }
304 304
305 } // namespace base 305 } // namespace base
OLDNEW
« no previous file with comments | « base/message_loop/message_pump_glib_unittest.cc ('k') | base/task_scheduler/scheduler_worker_unittest.cc~RF3e0a7fad.TMP » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698