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 "ppapi/proxy/proxy_channel.h" | 5 #include "ppapi/proxy/proxy_channel.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ipc/ipc_platform_file.h" | 8 #include "ipc/ipc_platform_file.h" |
9 #include "ipc/ipc_test_sink.h" | 9 #include "ipc/ipc_test_sink.h" |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 bool ProxyChannel::InitWithChannel(Delegate* delegate, | 28 bool ProxyChannel::InitWithChannel(Delegate* delegate, |
29 base::ProcessId peer_pid, | 29 base::ProcessId peer_pid, |
30 const IPC::ChannelHandle& channel_handle, | 30 const IPC::ChannelHandle& channel_handle, |
31 bool is_client) { | 31 bool is_client) { |
32 delegate_ = delegate; | 32 delegate_ = delegate; |
33 peer_pid_ = peer_pid; | 33 peer_pid_ = peer_pid; |
34 IPC::Channel::Mode mode = is_client | 34 IPC::Channel::Mode mode = is_client |
35 ? IPC::Channel::MODE_CLIENT | 35 ? IPC::Channel::MODE_CLIENT |
36 : IPC::Channel::MODE_SERVER; | 36 : IPC::Channel::MODE_SERVER; |
37 channel_ = IPC::SyncChannel::Create(channel_handle, mode, this, | 37 channel_ = IPC::SyncChannel::Create(channel_handle, mode, this, |
38 delegate->GetIPCMessageLoop(), true, | 38 delegate->GetIPCTaskRunner(), true, |
39 delegate->GetShutdownEvent()); | 39 delegate->GetShutdownEvent()); |
40 return true; | 40 return true; |
41 } | 41 } |
42 | 42 |
43 void ProxyChannel::InitWithTestSink(IPC::TestSink* test_sink) { | 43 void ProxyChannel::InitWithTestSink(IPC::TestSink* test_sink) { |
44 DCHECK(!test_sink_); | 44 DCHECK(!test_sink_); |
45 test_sink_ = test_sink; | 45 test_sink_ = test_sink; |
46 #if !defined(OS_NACL) | 46 #if !defined(OS_NACL) |
47 peer_pid_ = base::GetCurrentProcId(); | 47 peer_pid_ = base::GetCurrentProcId(); |
48 #endif | 48 #endif |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 if (channel_.get()) | 80 if (channel_.get()) |
81 return channel_->Send(msg); | 81 return channel_->Send(msg); |
82 | 82 |
83 // Remote side crashed, drop this message. | 83 // Remote side crashed, drop this message. |
84 delete msg; | 84 delete msg; |
85 return false; | 85 return false; |
86 } | 86 } |
87 | 87 |
88 } // namespace proxy | 88 } // namespace proxy |
89 } // namespace ppapi | 89 } // namespace ppapi |
OLD | NEW |