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

Side by Side Diff: ipc/ipc_test_base.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_perftest_support.cc ('k') | no next file » | 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_test_base.h" 5 #include "ipc/ipc_test_base.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 20 matching lines...) Expand all
31 IPCTestBase::~IPCTestBase() { 31 IPCTestBase::~IPCTestBase() {
32 } 32 }
33 33
34 void IPCTestBase::TearDown() { 34 void IPCTestBase::TearDown() {
35 message_loop_.reset(); 35 message_loop_.reset();
36 MultiProcessTest::TearDown(); 36 MultiProcessTest::TearDown();
37 } 37 }
38 38
39 void IPCTestBase::Init(const std::string& test_client_name) { 39 void IPCTestBase::Init(const std::string& test_client_name) {
40 InitWithCustomMessageLoop(test_client_name, 40 InitWithCustomMessageLoop(test_client_name,
41 base::WrapUnique(new base::MessageLoopForIO())); 41 base::MakeUnique<base::MessageLoopForIO>());
42 } 42 }
43 43
44 void IPCTestBase::InitWithCustomMessageLoop( 44 void IPCTestBase::InitWithCustomMessageLoop(
45 const std::string& test_client_name, 45 const std::string& test_client_name,
46 std::unique_ptr<base::MessageLoop> message_loop) { 46 std::unique_ptr<base::MessageLoop> message_loop) {
47 DCHECK(!test_client_name.empty()); 47 DCHECK(!test_client_name.empty());
48 DCHECK(test_client_name_.empty()); 48 DCHECK(test_client_name_.empty());
49 DCHECK(!message_loop_); 49 DCHECK(!message_loop_);
50 50
51 test_client_name_ = test_client_name; 51 test_client_name_ = test_client_name;
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 161
162 scoped_refptr<base::SingleThreadTaskRunner> IPCTestBase::task_runner() { 162 scoped_refptr<base::SingleThreadTaskRunner> IPCTestBase::task_runner() {
163 return message_loop_->task_runner(); 163 return message_loop_->task_runner();
164 } 164 }
165 165
166 std::unique_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory( 166 std::unique_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory(
167 const IPC::ChannelHandle& handle, 167 const IPC::ChannelHandle& handle,
168 base::SingleThreadTaskRunner* runner) { 168 base::SingleThreadTaskRunner* runner) {
169 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER, runner); 169 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER, runner);
170 } 170 }
OLDNEW
« no previous file with comments | « ipc/ipc_perftest_support.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698