OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ipc/ipc_channel_proxy.h" | 5 #include "ipc/ipc_channel_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
618 base::ProcessId ChannelProxy::GetPeerPID() const { | 618 base::ProcessId ChannelProxy::GetPeerPID() const { |
619 base::AutoLock l(context_->peer_pid_lock_); | 619 base::AutoLock l(context_->peer_pid_lock_); |
620 return context_->peer_pid_; | 620 return context_->peer_pid_; |
621 } | 621 } |
622 | 622 |
623 void ChannelProxy::OnSetAttachmentBrokerEndpoint() { | 623 void ChannelProxy::OnSetAttachmentBrokerEndpoint() { |
624 CHECK(!did_init_); | 624 CHECK(!did_init_); |
625 context()->set_attachment_broker_endpoint(is_attachment_broker_endpoint()); | 625 context()->set_attachment_broker_endpoint(is_attachment_broker_endpoint()); |
626 } | 626 } |
627 | 627 |
628 #if defined(OS_POSIX) && !defined(OS_NACL_SFI) | |
629 // See the TODO regarding lazy initialization of the channel in | |
630 // ChannelProxy::Init(). | |
631 int ChannelProxy::GetClientFileDescriptor() { | |
632 DCHECK(CalledOnValidThread()); | |
633 | |
634 Channel* channel = context_.get()->channel_.get(); | |
635 // Channel must have been created first. | |
636 DCHECK(channel) << context_.get()->channel_id_; | |
637 return channel->GetClientFileDescriptor(); | |
638 } | |
639 | |
640 base::ScopedFD ChannelProxy::TakeClientFileDescriptor() { | |
641 DCHECK(CalledOnValidThread()); | |
642 | |
643 Channel* channel = context_.get()->channel_.get(); | |
644 // Channel must have been created first. | |
645 DCHECK(channel) << context_.get()->channel_id_; | |
646 return channel->TakeClientFileDescriptor(); | |
647 } | |
648 #endif | |
649 | |
650 void ChannelProxy::OnChannelInit() { | 628 void ChannelProxy::OnChannelInit() { |
651 } | 629 } |
652 | 630 |
653 //----------------------------------------------------------------------------- | 631 //----------------------------------------------------------------------------- |
654 | 632 |
655 } // namespace IPC | 633 } // namespace IPC |
OLD | NEW |