Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(99)

Side by Side Diff: ipc/attachment_broker_mac_unittest.cc

Issue 1739203004: Add support for Attachment Brokering of IPC::Channels on multiple threads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix windows comiple error. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 LOG(INFO) << "Privileged process start."; 554 LOG(INFO) << "Privileged process start.";
555 scoped_ptr<ChildProcessGlobals> globals(CommonChildProcessSetUp()); 555 scoped_ptr<ChildProcessGlobals> globals(CommonChildProcessSetUp());
556 556
557 mach_msg_type_number_t active_names_at_start = IPC::GetActiveNameCount(); 557 mach_msg_type_number_t active_names_at_start = IPC::GetActiveNameCount();
558 558
559 base::MessageLoopForIO main_message_loop; 559 base::MessageLoopForIO main_message_loop;
560 ProxyListener listener; 560 ProxyListener listener;
561 561
562 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient( 562 scoped_ptr<IPC::Channel> channel(IPC::Channel::CreateClient(
563 IPCTestBase::GetChannelName(channel_name), &listener)); 563 IPCTestBase::GetChannelName(channel_name), &listener));
564 globals->broker->RegisterCommunicationChannel(channel.get()); 564 globals->broker->RegisterCommunicationChannel(channel.get(), nullptr);
565 CHECK(channel->Connect()); 565 CHECK(channel->Connect());
566 566
567 globals->initial_resident_size = GetResidentSize(); 567 globals->initial_resident_size = GetResidentSize();
568 568
569 while (true) { 569 while (true) {
570 if (globals->message_logging) 570 if (globals->message_logging)
571 LOG(INFO) << "Privileged process spinning run loop."; 571 LOG(INFO) << "Privileged process spinning run loop.";
572 base::MessageLoop::current()->Run(); 572 base::MessageLoop::current()->Run();
573 ProxyListener::Reason reason = listener.get_reason(); 573 ProxyListener::Reason reason = listener.get_reason();
574 if (reason == ProxyListener::CHANNEL_ERROR) 574 if (reason == ProxyListener::CHANNEL_ERROR)
(...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 SendControlMessage(sender, success); 1326 SendControlMessage(sender, success);
1327 } 1327 }
1328 } 1328 }
1329 1329
1330 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(MemoryUsageManyMessages) { 1330 MULTIPROCESS_IPC_TEST_CLIENT_MAIN(MemoryUsageManyMessages) {
1331 return CommonPrivilegedProcessMain(&MemoryUsageManyMessagesCallback, 1331 return CommonPrivilegedProcessMain(&MemoryUsageManyMessagesCallback,
1332 "MemoryUsageManyMessages"); 1332 "MemoryUsageManyMessages");
1333 } 1333 }
1334 1334
1335 } // namespace 1335 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698