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