diff options
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.cc | 7 | ||||
-rw-r--r-- | ppapi/proxy/proxy_channel.cc | 4 | ||||
-rw-r--r-- | ppapi/proxy/proxy_channel.h | 2 |
3 files changed, 7 insertions, 6 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index 1bb38b1..c35bbd7 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -297,9 +297,10 @@ bool PpapiThread::SetupRendererChannel(base::ProcessHandle host_process_handle, handle->name = plugin_handle.name; #if defined(OS_POSIX) - // On POSIX, pass the renderer-side FD. - handle->socket = base::FileDescriptor(::dup(dispatcher->GetRendererFD()), - true); + // On POSIX, transfer ownership of the renderer-side (client) FD. + // This ensures this process will be notified when it is closed even if a + // connection is not established. + handle->socket = base::FileDescriptor(dispatcher->TakeRendererFD(), true); #endif // From here, the dispatcher will manage its own lifetime according to the diff --git a/ppapi/proxy/proxy_channel.cc b/ppapi/proxy/proxy_channel.cc index 3bf6c20..fd5937f 100644 --- a/ppapi/proxy/proxy_channel.cc +++ b/ppapi/proxy/proxy_channel.cc @@ -42,9 +42,9 @@ void ProxyChannel::OnChannelError() { } #if defined(OS_POSIX) -int ProxyChannel::GetRendererFD() { +int ProxyChannel::TakeRendererFD() { DCHECK(channel()); - return channel()->GetClientFileDescriptor(); + return channel()->TakeClientFileDescriptor(); } #endif diff --git a/ppapi/proxy/proxy_channel.h b/ppapi/proxy/proxy_channel.h index 89d81ae..75b9ad3 100644 --- a/ppapi/proxy/proxy_channel.h +++ b/ppapi/proxy/proxy_channel.h @@ -73,7 +73,7 @@ class PPAPI_PROXY_EXPORT ProxyChannel } #if defined(OS_POSIX) - int GetRendererFD(); + int TakeRendererFD(); #endif protected: |