| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ipc/ipc_perftest_support.h" | 5 #include "ipc/ipc_perftest_support.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 sender()->Send(message); | 282 sender()->Send(message); |
| 283 | 283 |
| 284 EXPECT_TRUE(WaitForClientShutdown()); | 284 EXPECT_TRUE(WaitForClientShutdown()); |
| 285 DestroyChannel(); | 285 DestroyChannel(); |
| 286 } | 286 } |
| 287 | 287 |
| 288 void IPCChannelPerfTestBase::RunTestChannelProxyPingPong( | 288 void IPCChannelPerfTestBase::RunTestChannelProxyPingPong( |
| 289 const std::vector<PingPongTestParams>& params) { | 289 const std::vector<PingPongTestParams>& params) { |
| 290 io_thread_.reset(new base::TestIOThread(base::TestIOThread::kAutoStart)); | 290 io_thread_.reset(new base::TestIOThread(base::TestIOThread::kAutoStart)); |
| 291 InitWithCustomMessageLoop("PerformanceClient", | 291 InitWithCustomMessageLoop("PerformanceClient", |
| 292 base::WrapUnique(new base::MessageLoop())); | 292 base::MakeUnique<base::MessageLoop>()); |
| 293 | 293 |
| 294 // Set up IPC channel and start client. | 294 // Set up IPC channel and start client. |
| 295 PerformanceChannelListener listener("ChannelProxy"); | 295 PerformanceChannelListener listener("ChannelProxy"); |
| 296 CreateChannelProxy(&listener, io_thread_->task_runner()); | 296 CreateChannelProxy(&listener, io_thread_->task_runner()); |
| 297 listener.Init(channel_proxy()); | 297 listener.Init(channel_proxy()); |
| 298 ASSERT_TRUE(StartClient()); | 298 ASSERT_TRUE(StartClient()); |
| 299 | 299 |
| 300 LockThreadAffinity thread_locker(kSharedCore); | 300 LockThreadAffinity thread_locker(kSharedCore); |
| 301 for (size_t i = 0; i < params.size(); i++) { | 301 for (size_t i = 0; i < params.size(); i++) { |
| 302 listener.SetTestParams(params[i].message_count(), | 302 listener.SetTestParams(params[i].message_count(), |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_); | 382 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_); |
| 383 DCHECK_NE(0u, set_result); | 383 DCHECK_NE(0u, set_result); |
| 384 #elif defined(OS_LINUX) | 384 #elif defined(OS_LINUX) |
| 385 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_); | 385 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_); |
| 386 DCHECK_EQ(0, set_result); | 386 DCHECK_EQ(0, set_result); |
| 387 #endif | 387 #endif |
| 388 } | 388 } |
| 389 | 389 |
| 390 } // namespace test | 390 } // namespace test |
| 391 } // namespace IPC | 391 } // namespace IPC |
| OLD | NEW |