OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/nacl/loader/nacl_trusted_listener.h" | 5 #include "components/nacl/loader/nacl_trusted_listener.h" |
6 | 6 |
7 NaClTrustedListener::NaClTrustedListener( | 7 NaClTrustedListener::NaClTrustedListener( |
8 const IPC::ChannelHandle& handle, | 8 const IPC::ChannelHandle& handle, |
9 base::MessageLoopProxy* message_loop_proxy, | 9 base::MessageLoopProxy* message_loop_proxy, |
10 base::WaitableEvent* shutdown_event) { | 10 base::WaitableEvent* shutdown_event) { |
11 channel_.reset(new IPC::SyncChannel(handle, IPC::Channel::MODE_SERVER, this, | 11 channel_ = IPC::SyncChannel::CreateServer( |
12 message_loop_proxy, true, | 12 handle, this, message_loop_proxy, true, shutdown_event); |
13 shutdown_event)); | |
14 } | 13 } |
15 | 14 |
16 NaClTrustedListener::~NaClTrustedListener() { | 15 NaClTrustedListener::~NaClTrustedListener() { |
17 } | 16 } |
18 | 17 |
19 #if defined(OS_POSIX) | 18 #if defined(OS_POSIX) |
20 int NaClTrustedListener::TakeClientFileDescriptor() { | 19 int NaClTrustedListener::TakeClientFileDescriptor() { |
21 return channel_->TakeClientFileDescriptor(); | 20 return channel_->TakeClientFileDescriptor(); |
22 } | 21 } |
23 #endif | 22 #endif |
24 | 23 |
25 bool NaClTrustedListener::OnMessageReceived(const IPC::Message& msg) { | 24 bool NaClTrustedListener::OnMessageReceived(const IPC::Message& msg) { |
26 return false; | 25 return false; |
27 } | 26 } |
28 | 27 |
29 void NaClTrustedListener::OnChannelConnected(int32 peer_pid) { | 28 void NaClTrustedListener::OnChannelConnected(int32 peer_pid) { |
30 } | 29 } |
31 | 30 |
32 void NaClTrustedListener::OnChannelError() { | 31 void NaClTrustedListener::OnChannelError() { |
33 channel_->Close(); | 32 channel_->Close(); |
34 } | 33 } |
35 | 34 |
36 bool NaClTrustedListener::Send(IPC::Message* msg) { | 35 bool NaClTrustedListener::Send(IPC::Message* msg) { |
37 return channel_->Send(msg); | 36 return channel_->Send(msg); |
38 } | 37 } |
OLD | NEW |