OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
339 | 339 |
340 int CommonPrivilegedProcessMain(OnMessageReceivedCallback callback, | 340 int CommonPrivilegedProcessMain(OnMessageReceivedCallback callback, |
341 const char* channel_name) { | 341 const char* channel_name) { |
342 base::MessageLoopForIO main_message_loop; | 342 base::MessageLoopForIO main_message_loop; |
343 ProxyListener listener; | 343 ProxyListener listener; |
344 | 344 |
345 // Set up IPC channel. | 345 // Set up IPC channel. |
346 IPC::AttachmentBrokerPrivilegedWin broker; | 346 IPC::AttachmentBrokerPrivilegedWin broker; |
347 IPC::AttachmentBroker::SetGlobal(&broker); | 347 IPC::AttachmentBroker::SetGlobal(&broker); |
348 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( | 348 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( |
349 IPCTestBase::GetChannelName(channel_name), &listener, &broker)); | 349 IPCTestBase::GetChannelName(channel_name), &listener)); |
350 broker.RegisterCommunicationChannel(channel.get()); | 350 broker.RegisterCommunicationChannel(channel.get()); |
351 CHECK(channel->Connect()); | 351 CHECK(channel->Connect()); |
352 | 352 |
353 MockObserver observer; | 353 MockObserver observer; |
354 broker.AddObserver(&observer); | 354 broker.AddObserver(&observer); |
355 | 355 |
356 while (true) { | 356 while (true) { |
357 base::MessageLoop::current()->Run(); | 357 base::MessageLoop::current()->Run(); |
358 ProxyListener::Reason reason = listener.get_reason(); | 358 ProxyListener::Reason reason = listener.get_reason(); |
359 if (reason == ProxyListener::CHANNEL_ERROR) | 359 if (reason == ProxyListener::CHANNEL_ERROR) |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
424 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleToSelf) { | 424 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleToSelf) { |
425 return CommonPrivilegedProcessMain(&SendHandleToSelfCallback, | 425 return CommonPrivilegedProcessMain(&SendHandleToSelfCallback, |
426 "SendHandleToSelf"); | 426 "SendHandleToSelf"); |
427 } | 427 } |
428 | 428 |
429 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleWin) { | 429 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendHandleWin) { |
430 return CommonPrivilegedProcessMain(&SendHandleCallback, "SendHandleWin"); | 430 return CommonPrivilegedProcessMain(&SendHandleCallback, "SendHandleWin"); |
431 } | 431 } |
432 | 432 |
433 } // namespace | 433 } // namespace |
OLD | NEW |