summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy/ppb_context_3d_proxy.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi/proxy/ppb_context_3d_proxy.cc')
-rw-r--r--ppapi/proxy/ppb_context_3d_proxy.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/ppapi/proxy/ppb_context_3d_proxy.cc b/ppapi/proxy/ppb_context_3d_proxy.cc
index 9c1e383..076f133 100644
--- a/ppapi/proxy/ppb_context_3d_proxy.cc
+++ b/ppapi/proxy/ppb_context_3d_proxy.cc
@@ -133,8 +133,11 @@ const PPB_Context3D_Dev context_3d_interface = {
base::SharedMemoryHandle SHMHandleFromInt(int shm_handle) {
#if defined(OS_POSIX)
- return base::FileDescriptor(shm_handle, true);
+ // The handle isn't ours to close, but we want to keep a reference to the
+ // handle until it is actually sent, so duplicate it, and mark auto-close.
+ return base::FileDescriptor(dup(shm_handle), true);
#elif defined(OS_WIN)
+ // TODO(piman): DuplicateHandle to the plugin process.
return reinterpret_cast<HANDLE>(shm_handle);
#else
#error "Platform not supported."