| 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 <tuple> | 9 #include <tuple> |
| 10 | 10 |
| (...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 int CommonPrivilegedProcessMain(OnMessageReceivedCallback callback, | 499 int CommonPrivilegedProcessMain(OnMessageReceivedCallback callback, |
| 500 const char* channel_name) { | 500 const char* channel_name) { |
| 501 LOG(INFO) << "Privileged process start."; | 501 LOG(INFO) << "Privileged process start."; |
| 502 base::MessageLoopForIO main_message_loop; | 502 base::MessageLoopForIO main_message_loop; |
| 503 ProxyListener listener; | 503 ProxyListener listener; |
| 504 | 504 |
| 505 // Set up IPC channel. | 505 // Set up IPC channel. |
| 506 IPC::AttachmentBrokerPrivilegedWin broker; | 506 IPC::AttachmentBrokerPrivilegedWin broker; |
| 507 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( | 507 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( |
| 508 IPCTestBase::GetChannelName(channel_name), &listener)); | 508 IPCTestBase::GetChannelName(channel_name), &listener)); |
| 509 broker.RegisterCommunicationChannel(channel.get()); | 509 broker.RegisterCommunicationChannel(channel.get(), nullptr); |
| 510 CHECK(channel->Connect()); | 510 CHECK(channel->Connect()); |
| 511 | 511 |
| 512 while (true) { | 512 while (true) { |
| 513 LOG(INFO) << "Privileged process spinning run loop."; | 513 LOG(INFO) << "Privileged process spinning run loop."; |
| 514 base::MessageLoop::current()->Run(); | 514 base::MessageLoop::current()->Run(); |
| 515 ProxyListener::Reason reason = listener.get_reason(); | 515 ProxyListener::Reason reason = listener.get_reason(); |
| 516 if (reason == ProxyListener::CHANNEL_ERROR) | 516 if (reason == ProxyListener::CHANNEL_ERROR) |
| 517 break; | 517 break; |
| 518 | 518 |
| 519 while (listener.has_message()) { | 519 while (listener.has_message()) { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 memcmp(shared_memory->memory(), kDataBuffer, strlen(kDataBuffer)) == 0; | 645 memcmp(shared_memory->memory(), kDataBuffer, strlen(kDataBuffer)) == 0; |
| 646 SendControlMessage(sender, success); | 646 SendControlMessage(sender, success); |
| 647 } | 647 } |
| 648 | 648 |
| 649 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendSharedMemoryHandle) { | 649 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(SendSharedMemoryHandle) { |
| 650 return CommonPrivilegedProcessMain(&SendSharedMemoryHandleCallback, | 650 return CommonPrivilegedProcessMain(&SendSharedMemoryHandleCallback, |
| 651 "SendSharedMemoryHandle"); | 651 "SendSharedMemoryHandle"); |
| 652 } | 652 } |
| 653 | 653 |
| 654 } // namespace | 654 } // namespace |
| OLD | NEW |