| 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 <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <mach/mach_vm.h> | 8 #include <mach/mach_vm.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 #include <sys/mman.h> | 10 #include <sys/mman.h> |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 LOG(INFO) << "Privileged process start."; | 556 LOG(INFO) << "Privileged process start."; |
| 557 scoped_ptr<ChildProcessGlobals> globals(CommonChildProcessSetUp()); | 557 scoped_ptr<ChildProcessGlobals> globals(CommonChildProcessSetUp()); |
| 558 | 558 |
| 559 mach_msg_type_number_t active_names_at_start = IPC::GetActiveNameCount(); | 559 mach_msg_type_number_t active_names_at_start = IPC::GetActiveNameCount(); |
| 560 | 560 |
| 561 base::MessageLoopForIO main_message_loop; | 561 base::MessageLoopForIO main_message_loop; |
| 562 ProxyListener listener; | 562 ProxyListener listener; |
| 563 | 563 |
| 564 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( | 564 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( |
| 565 IPCTestBase::GetChannelName(channel_name), &listener)); | 565 IPCTestBase::GetChannelName(channel_name), &listener)); |
| 566 globals->broker->RegisterCommunicationChannel(channel.get()); | 566 globals->broker->RegisterCommunicationChannel(channel.get(), nullptr); |
| 567 CHECK(channel->Connect()); | 567 CHECK(channel->Connect()); |
| 568 | 568 |
| 569 globals->initial_resident_size = GetResidentSize(); | 569 globals->initial_resident_size = GetResidentSize(); |
| 570 | 570 |
| 571 while (true) { | 571 while (true) { |
| 572 if (globals->message_logging) | 572 if (globals->message_logging) |
| 573 LOG(INFO) << "Privileged process spinning run loop."; | 573 LOG(INFO) << "Privileged process spinning run loop."; |
| 574 base::MessageLoop::current()->Run(); | 574 base::MessageLoop::current()->Run(); |
| 575 ProxyListener::Reason reason = listener.get_reason(); | 575 ProxyListener::Reason reason = listener.get_reason(); |
| 576 if (reason == ProxyListener::CHANNEL_ERROR) | 576 if (reason == ProxyListener::CHANNEL_ERROR) |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1328 SendControlMessage(sender, success); | 1328 SendControlMessage(sender, success); |
| 1329 } | 1329 } |
| 1330 } | 1330 } |
| 1331 | 1331 |
| 1332 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(MemoryUsageManyMessages) { | 1332 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(MemoryUsageManyMessages) { |
| 1333 return CommonPrivilegedProcessMain(&MemoryUsageManyMessagesCallback, | 1333 return CommonPrivilegedProcessMain(&MemoryUsageManyMessagesCallback, |
| 1334 "MemoryUsageManyMessages"); | 1334 "MemoryUsageManyMessages"); |
| 1335 } | 1335 } |
| 1336 | 1336 |
| 1337 } // namespace | 1337 } // namespace |
| OLD | NEW |