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

Side by Side Diff: ipc/ipc_perftest_support.cc

Issue 2255143002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « ipc/ipc_channel_mojo.cc ('k') | ipc/ipc_test_base.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 (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
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
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
OLDNEW
« no previous file with comments | « ipc/ipc_channel_mojo.cc ('k') | ipc/ipc_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698