Index: content/renderer/npapi/webplugin_delegate_proxy.cc |
diff --git a/content/renderer/npapi/webplugin_delegate_proxy.cc b/content/renderer/npapi/webplugin_delegate_proxy.cc |
index e5566bce6e0495c1f939c5684fbb9c706e522894..800ce123f35d7312f0d4fefb211ef3a85155c0de 100644 |
--- a/content/renderer/npapi/webplugin_delegate_proxy.cc |
+++ b/content/renderer/npapi/webplugin_delegate_proxy.cc |
@@ -498,14 +498,7 @@ static void CopySharedMemoryHandleForMessage( |
base::SharedMemoryHandle* handle_out, |
base::ProcessId peer_pid) { |
#if defined(OS_POSIX) |
- // On POSIX, base::ShardMemoryHandle is typedef'ed to FileDescriptor, and |
- // FileDescriptor message fields needs to remain valid until the message is |
- // sent or else the sendmsg() call will fail. |
- if ((handle_out->fd = HANDLE_EINTR(dup(handle_in.fd))) < 0) { |
- PLOG(ERROR) << "dup()"; |
- return; |
- } |
- handle_out->auto_close = true; |
+ *handle_out = base::SharedMemory::DeepCopyHandle(handle_in, true); |
#elif defined(OS_WIN) |
// On Windows we need to duplicate the handle for the plugin process. |
*handle_out = NULL; |