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 "build/build_config.h" | 5 #include "build/build_config.h" |
6 | 6 |
7 #include "base/single_thread_task_runner.h" | 7 #include "base/single_thread_task_runner.h" |
8 #include "ipc/ipc_test_base.h" | 8 #include "ipc/ipc_test_base.h" |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 channel_handle, task_runner().get())->BuildChannel(listener); | 83 channel_handle, task_runner().get())->BuildChannel(listener); |
84 } | 84 } |
85 | 85 |
86 void IPCTestBase::CreateChannelProxy( | 86 void IPCTestBase::CreateChannelProxy( |
87 IPC::Listener* listener, | 87 IPC::Listener* listener, |
88 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) { | 88 const scoped_refptr<base::SingleThreadTaskRunner>& ipc_task_runner) { |
89 CHECK(!channel_.get()); | 89 CHECK(!channel_.get()); |
90 CHECK(!channel_proxy_.get()); | 90 CHECK(!channel_proxy_.get()); |
91 channel_proxy_ = IPC::ChannelProxy::Create( | 91 channel_proxy_ = IPC::ChannelProxy::Create( |
92 CreateChannelFactory(GetTestChannelHandle(), ipc_task_runner.get()), | 92 CreateChannelFactory(GetTestChannelHandle(), ipc_task_runner.get()), |
93 listener, | 93 listener, ipc_task_runner); |
94 ipc_task_runner); | |
95 } | 94 } |
96 | 95 |
97 void IPCTestBase::DestroyChannelProxy() { | 96 void IPCTestBase::DestroyChannelProxy() { |
98 CHECK(channel_proxy_.get()); | 97 CHECK(channel_proxy_.get()); |
99 channel_proxy_.reset(); | 98 channel_proxy_.reset(); |
100 } | 99 } |
101 | 100 |
102 std::string IPCTestBase::GetTestMainName() const { | 101 std::string IPCTestBase::GetTestMainName() const { |
103 return test_client_name_ + "TestClientMain"; | 102 return test_client_name_ + "TestClientMain"; |
104 } | 103 } |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 return GetChannelName(test_client_name_); | 153 return GetChannelName(test_client_name_); |
155 } | 154 } |
156 | 155 |
157 scoped_refptr<base::SequencedTaskRunner> IPCTestBase::task_runner() { | 156 scoped_refptr<base::SequencedTaskRunner> IPCTestBase::task_runner() { |
158 return message_loop_->task_runner(); | 157 return message_loop_->task_runner(); |
159 } | 158 } |
160 | 159 |
161 scoped_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory( | 160 scoped_ptr<IPC::ChannelFactory> IPCTestBase::CreateChannelFactory( |
162 const IPC::ChannelHandle& handle, | 161 const IPC::ChannelHandle& handle, |
163 base::SequencedTaskRunner* runner) { | 162 base::SequencedTaskRunner* runner) { |
164 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER); | 163 return IPC::ChannelFactory::Create(handle, IPC::Channel::MODE_SERVER, |
| 164 nullptr); |
165 } | 165 } |
OLD | NEW |