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 "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "ipc/ipc_platform_file.h" | 9 #include "ipc/ipc_platform_file.h" |
10 #include "ipc/ipc_test_sink.h" | 10 #include "ipc/ipc_test_sink.h" |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 return IPC::InvalidPlatformFileForTransit(); | 64 return IPC::InvalidPlatformFileForTransit(); |
65 } | 65 } |
66 DCHECK(peer_pid_ != base::kNullProcessId); | 66 DCHECK(peer_pid_ != base::kNullProcessId); |
67 return delegate_->ShareHandleWithRemote(handle, peer_pid_, | 67 return delegate_->ShareHandleWithRemote(handle, peer_pid_, |
68 should_close_source); | 68 should_close_source); |
69 } | 69 } |
70 | 70 |
71 base::SharedMemoryHandle ProxyChannel::ShareSharedMemoryHandleWithRemote( | 71 base::SharedMemoryHandle ProxyChannel::ShareSharedMemoryHandleWithRemote( |
72 const base::SharedMemoryHandle& handle) { | 72 const base::SharedMemoryHandle& handle) { |
73 if (!channel_.get()) | 73 if (!channel_.get()) |
74 return base::SharedMemory::NULLHandle(); | 74 return base::SharedMemoryHandle(); |
75 | 75 |
76 DCHECK(peer_pid_ != base::kNullProcessId); | 76 DCHECK(peer_pid_ != base::kNullProcessId); |
77 return delegate_->ShareSharedMemoryHandleWithRemote(handle, peer_pid_); | 77 return delegate_->ShareSharedMemoryHandleWithRemote(handle, peer_pid_); |
78 } | 78 } |
79 | 79 |
80 bool ProxyChannel::Send(IPC::Message* msg) { | 80 bool ProxyChannel::Send(IPC::Message* msg) { |
81 if (test_sink_) | 81 if (test_sink_) |
82 return test_sink_->Send(msg); | 82 return test_sink_->Send(msg); |
83 if (channel_.get()) | 83 if (channel_.get()) |
84 return channel_->Send(msg); | 84 return channel_->Send(msg); |
85 | 85 |
86 // Remote side crashed, drop this message. | 86 // Remote side crashed, drop this message. |
87 delete msg; | 87 delete msg; |
88 return false; | 88 return false; |
89 } | 89 } |
90 | 90 |
91 } // namespace proxy | 91 } // namespace proxy |
92 } // namespace ppapi | 92 } // namespace ppapi |
OLD | NEW |