summaryrefslogtreecommitdiffstats
path: root/ppapi/proxy
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 21:37:41 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-23 21:37:41 +0000
commitbe60b9a5c94c8439c236a820505ebad04460efc0 (patch)
treefcfb2b788bba22e24d050f799e5d6edf8f61f241 /ppapi/proxy
parent2380f378654e66f58262e3eaa1f9ba0cd1da09e0 (diff)
downloadchromium_src-be60b9a5c94c8439c236a820505ebad04460efc0.zip
chromium_src-be60b9a5c94c8439c236a820505ebad04460efc0.tar.gz
chromium_src-be60b9a5c94c8439c236a820505ebad04460efc0.tar.bz2
Dup command-buffer SHM handle before auto-closing.
This also adds error logging to the various places we close file descriptors, to help diagnosing future similar issues. BUG=none TEST=Pepper Flash + youtube in oop with --enable-accelerated-plugins Review URL: http://codereview.chromium.org/6549037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75792 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy')
-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."