Chromium Code Reviews| 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 "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" | 5 #include "content/renderer/pepper/pepper_proxy_channel_delegate_impl.h" |
| 6 | 6 |
| 7 #include "content/child/child_process.h" | 7 #include "content/child/child_process.h" |
| 8 #include "content/common/sandbox_util.h" | 8 #include "content/common/sandbox_util.h" |
| 9 | 9 |
| 10 namespace content { | 10 namespace content { |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 24 } | 24 } |
| 25 | 25 |
| 26 IPC::PlatformFileForTransit | 26 IPC::PlatformFileForTransit |
| 27 PepperProxyChannelDelegateImpl::ShareHandleWithRemote( | 27 PepperProxyChannelDelegateImpl::ShareHandleWithRemote( |
| 28 base::PlatformFile handle, | 28 base::PlatformFile handle, |
| 29 base::ProcessId remote_pid, | 29 base::ProcessId remote_pid, |
| 30 bool should_close_source) { | 30 bool should_close_source) { |
| 31 return BrokerGetFileHandleForProcess(handle, remote_pid, should_close_source); | 31 return BrokerGetFileHandleForProcess(handle, remote_pid, should_close_source); |
| 32 } | 32 } |
| 33 | 33 |
| 34 base::SharedMemoryHandle | |
| 35 PepperProxyChannelDelegateImpl::ShareSharedMemoryHandleWithRemote( | |
| 36 const base::SharedMemoryHandle& handle, | |
| 37 base::ProcessId remote_pid) { | |
| 38 base::PlatformFile local_platform_file = | |
| 39 #if defined(OS_POSIX) | |
| 40 handle.fd; | |
| 41 #elif defined(OS_WIN) | |
| 42 reinterpret_cast<HANDLE>(static_cast<intptr_t>(handle)); | |
|
piman
2015/06/01 22:16:08
not sure why we need those 2 casts. handle is alre
erikchen
2015/06/01 23:48:53
You're right. Fixed.
| |
| 43 #else | |
| 44 #error Not implemented. | |
| 45 #endif | |
| 46 return ShareHandleWithRemote(local_platform_file, remote_pid, false); | |
| 47 } | |
| 48 | |
| 34 } // namespace content | 49 } // namespace content |
| OLD | NEW |