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

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: 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 <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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698