diff options
author | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 21:37:41 +0000 |
---|---|---|
committer | piman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-02-23 21:37:41 +0000 |
commit | be60b9a5c94c8439c236a820505ebad04460efc0 (patch) | |
tree | fcfb2b788bba22e24d050f799e5d6edf8f61f241 /ppapi/proxy | |
parent | 2380f378654e66f58262e3eaa1f9ba0cd1da09e0 (diff) | |
download | chromium_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.cc | 5 |
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." |