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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/win/scoped_handle.h" | 9 #include "base/win/scoped_handle.h" |
10 #include "ipc/ipc_channel.h" | 10 #include "ipc/ipc_channel.h" |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 EXPECT_TRUE(result); | 192 EXPECT_TRUE(result); |
193 } | 193 } |
194 | 194 |
195 bool WorkerProcessLauncherTest::LaunchProcess( | 195 bool WorkerProcessLauncherTest::LaunchProcess( |
196 IPC::Listener* delegate, | 196 IPC::Listener* delegate, |
197 ScopedHandle* process_exit_event_out) { | 197 ScopedHandle* process_exit_event_out) { |
198 process_exit_event_.Set(CreateEvent(NULL, TRUE, FALSE, NULL)); | 198 process_exit_event_.Set(CreateEvent(NULL, TRUE, FALSE, NULL)); |
199 if (!process_exit_event_.IsValid()) | 199 if (!process_exit_event_.IsValid()) |
200 return false; | 200 return false; |
201 | 201 |
202 channel_name_ = GenerateIpcChannelName(this); | 202 channel_name_ = IPC::Channel::GenerateUniqueRandomChannelID(); |
203 ScopedHandle pipe; | 203 ScopedHandle pipe; |
204 if (!CreateIpcChannel(channel_name_, kIpcSecurityDescriptor, &pipe)) { | 204 if (!CreateIpcChannel(channel_name_, kIpcSecurityDescriptor, &pipe)) { |
205 return false; | 205 return false; |
206 } | 206 } |
207 | 207 |
208 // Wrap the pipe into an IPC channel. | 208 // Wrap the pipe into an IPC channel. |
209 channel_server_.reset(new IPC::ChannelProxy( | 209 channel_server_.reset(new IPC::ChannelProxy( |
210 IPC::ChannelHandle(pipe), | 210 IPC::ChannelHandle(pipe), |
211 IPC::Channel::MODE_SERVER, | 211 IPC::Channel::MODE_SERVER, |
212 delegate, | 212 delegate, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 .Times(0); | 387 .Times(0); |
388 EXPECT_CALL(ipc_delegate_, OnPermanentError()) | 388 EXPECT_CALL(ipc_delegate_, OnPermanentError()) |
389 .Times(0); | 389 .Times(0); |
390 | 390 |
391 client_pid_ = GetCurrentProcessId() + 4; | 391 client_pid_ = GetCurrentProcessId() + 4; |
392 StartWorker(); | 392 StartWorker(); |
393 message_loop_.Run(); | 393 message_loop_.Run(); |
394 } | 394 } |
395 | 395 |
396 } // namespace remoting | 396 } // namespace remoting |
OLD | NEW |