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

Side by Side Diff: ipc/attachment_broker_privileged_win_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: Rebase. 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 <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
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
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
OLDNEW
« no previous file with comments | « ipc/attachment_broker_privileged_win.cc ('k') | remoting/host/win/unprivileged_process_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698