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 <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 PingPongTestClient::PingPongTestClient() | 321 PingPongTestClient::PingPongTestClient() |
322 : listener_(new ChannelReflectorListener()) { | 322 : listener_(new ChannelReflectorListener()) { |
323 } | 323 } |
324 | 324 |
325 PingPongTestClient::~PingPongTestClient() { | 325 PingPongTestClient::~PingPongTestClient() { |
326 } | 326 } |
327 | 327 |
328 scoped_ptr<Channel> PingPongTestClient::CreateChannel( | 328 scoped_ptr<Channel> PingPongTestClient::CreateChannel( |
329 Listener* listener) { | 329 Listener* listener) { |
330 return Channel::CreateClient(IPCTestBase::GetChannelName("PerformanceClient"), | 330 return Channel::CreateClient(IPCTestBase::GetChannelName("PerformanceClient"), |
331 listener, nullptr); | 331 listener); |
332 } | 332 } |
333 | 333 |
334 int PingPongTestClient::RunMain() { | 334 int PingPongTestClient::RunMain() { |
335 LockThreadAffinity thread_locker(kSharedCore); | 335 LockThreadAffinity thread_locker(kSharedCore); |
336 scoped_ptr<Channel> channel = CreateChannel(listener_.get()); | 336 scoped_ptr<Channel> channel = CreateChannel(listener_.get()); |
337 listener_->Init(channel.get()); | 337 listener_->Init(channel.get()); |
338 CHECK(channel->Connect()); | 338 CHECK(channel->Connect()); |
339 | 339 |
340 base::MessageLoop::current()->Run(); | 340 base::MessageLoop::current()->Run(); |
341 return 0; | 341 return 0; |
(...skipping 30 matching lines...) Expand all Loading... |
372 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_); | 372 auto set_result = SetThreadAffinityMask(GetCurrentThread(), old_affinity_); |
373 DCHECK_NE(0u, set_result); | 373 DCHECK_NE(0u, set_result); |
374 #elif defined(OS_LINUX) | 374 #elif defined(OS_LINUX) |
375 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_); | 375 auto set_result = sched_setaffinity(0, sizeof(old_cpuset_), &old_cpuset_); |
376 DCHECK_EQ(0, set_result); | 376 DCHECK_EQ(0, set_result); |
377 #endif | 377 #endif |
378 } | 378 } |
379 | 379 |
380 } // namespace test | 380 } // namespace test |
381 } // namespace IPC | 381 } // namespace IPC |
OLD | NEW |