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 "components/arc/arc_session.h" | 5 #include "components/arc/arc_session.h" |
6 | 6 |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <grp.h> | 8 #include <grp.h> |
9 #include <poll.h> | 9 #include <poll.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 if (!mojo::edk::ServerAcceptConnection(socket_fd.get(), &scoped_fd, | 435 if (!mojo::edk::ServerAcceptConnection(socket_fd.get(), &scoped_fd, |
436 /* check_peer_user = */ false) || | 436 /* check_peer_user = */ false) || |
437 !scoped_fd.is_valid()) { | 437 !scoped_fd.is_valid()) { |
438 return mojo::ScopedMessagePipeHandle(); | 438 return mojo::ScopedMessagePipeHandle(); |
439 } | 439 } |
440 | 440 |
441 // Hardcode pid 0 since it is unused in mojo. | 441 // Hardcode pid 0 since it is unused in mojo. |
442 const base::ProcessHandle kUnusedChildProcessHandle = 0; | 442 const base::ProcessHandle kUnusedChildProcessHandle = 0; |
443 mojo::edk::PlatformChannelPair channel_pair; | 443 mojo::edk::PlatformChannelPair channel_pair; |
444 mojo::edk::PendingProcessConnection process; | 444 mojo::edk::PendingProcessConnection process; |
445 process.Connect(kUnusedChildProcessHandle, channel_pair.PassServerHandle()); | 445 process.Connect(kUnusedChildProcessHandle, |
| 446 mojo::edk::ConnectionParams(channel_pair.PassServerHandle())); |
446 | 447 |
447 mojo::edk::ScopedPlatformHandleVectorPtr handles( | 448 mojo::edk::ScopedPlatformHandleVectorPtr handles( |
448 new mojo::edk::PlatformHandleVector{ | 449 new mojo::edk::PlatformHandleVector{ |
449 channel_pair.PassClientHandle().release()}); | 450 channel_pair.PassClientHandle().release()}); |
450 | 451 |
451 std::string token; | 452 std::string token; |
452 mojo::ScopedMessagePipeHandle pipe = process.CreateMessagePipe(&token); | 453 mojo::ScopedMessagePipeHandle pipe = process.CreateMessagePipe(&token); |
453 | 454 |
454 // We need to send the length of the message as a single byte, so make sure it | 455 // We need to send the length of the message as a single byte, so make sure it |
455 // fits. | 456 // fits. |
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
643 | 644 |
644 // static | 645 // static |
645 std::unique_ptr<ArcSession> ArcSession::Create( | 646 std::unique_ptr<ArcSession> ArcSession::Create( |
646 ArcBridgeService* arc_bridge_service, | 647 ArcBridgeService* arc_bridge_service, |
647 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { | 648 const scoped_refptr<base::TaskRunner>& blocking_task_runner) { |
648 return base::MakeUnique<ArcSessionImpl>(arc_bridge_service, | 649 return base::MakeUnique<ArcSessionImpl>(arc_bridge_service, |
649 blocking_task_runner); | 650 blocking_task_runner); |
650 } | 651 } |
651 | 652 |
652 } // namespace arc | 653 } // namespace arc |
OLD | NEW |