summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-08 22:18:56 +0000
committerpiman@google.com <piman@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-08 22:18:56 +0000
commitb04dbbc69c9594b136a0e69b8a10881ec97dab7e (patch)
treeed17c6d39c503dfc04084a1538818d27ee082cbd /ppapi
parentd9bbe81ef14155cb74652cf2f72f9fbea4c62f40 (diff)
downloadchromium_src-b04dbbc69c9594b136a0e69b8a10881ec97dab7e.zip
chromium_src-b04dbbc69c9594b136a0e69b8a10881ec97dab7e.tar.gz
chromium_src-b04dbbc69c9594b136a0e69b8a10881ec97dab7e.tar.bz2
Don't close the client file descriptor, it's owned by the channel
BUG=chromium-os:13861 TEST=With pepper flash, go to a flash site. close the tab. shouldn't see any "close failed" message. Review URL: http://codereview.chromium.org/6825013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@81001 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/plugin_dispatcher.cc22
-rw-r--r--ppapi/proxy/plugin_dispatcher.h9
2 files changed, 3 insertions, 28 deletions
diff --git a/ppapi/proxy/plugin_dispatcher.cc b/ppapi/proxy/plugin_dispatcher.cc
index efd4f05..f260342 100644
--- a/ppapi/proxy/plugin_dispatcher.cc
+++ b/ppapi/proxy/plugin_dispatcher.cc
@@ -34,11 +34,7 @@ InstanceToDispatcherMap* g_instance_to_dispatcher = NULL;
PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle,
GetInterfaceFunc get_interface)
- : Dispatcher(remote_process_handle, get_interface)
-#if defined(OS_POSIX)
- , renderer_fd_(-1)
-#endif
- {
+ : Dispatcher(remote_process_handle, get_interface) {
SetSerializationRules(new PluginVarSerializationRules);
// As a plugin, we always support the PPP_Class interface. There's no
@@ -47,9 +43,6 @@ PluginDispatcher::PluginDispatcher(base::ProcessHandle remote_process_handle,
}
PluginDispatcher::~PluginDispatcher() {
-#if defined(OS_POSIX)
- CloseRendererFD();
-#endif
}
// static
@@ -197,17 +190,8 @@ InstanceData* PluginDispatcher::GetInstanceData(PP_Instance instance) {
#if defined(OS_POSIX)
int PluginDispatcher::GetRendererFD() {
- if (renderer_fd_ == -1 && channel())
- renderer_fd_ = channel()->GetClientFileDescriptor();
- return renderer_fd_;
-}
-
-void PluginDispatcher::CloseRendererFD() {
- if (renderer_fd_ != -1) {
- if (HANDLE_EINTR(close(renderer_fd_)) < 0)
- PLOG(ERROR) << "close";
- renderer_fd_ = -1;
- }
+ DCHECK(channel());
+ return channel()->GetClientFileDescriptor();
}
#endif
diff --git a/ppapi/proxy/plugin_dispatcher.h b/ppapi/proxy/plugin_dispatcher.h
index 4fb9533..dbc13d2 100644
--- a/ppapi/proxy/plugin_dispatcher.h
+++ b/ppapi/proxy/plugin_dispatcher.h
@@ -69,9 +69,7 @@ class PluginDispatcher : public Dispatcher {
InstanceData* GetInstanceData(PP_Instance instance);
#if defined(OS_POSIX)
- // See renderer_fd_ below.
int GetRendererFD();
- void CloseRendererFD();
#endif
private:
@@ -84,13 +82,6 @@ class PluginDispatcher : public Dispatcher {
// IPC message handlers.
void OnMsgSupportsInterface(const std::string& interface_name, bool* result);
-#if defined(OS_POSIX)
- // FD for the renderer end of the socket. It is closed when the IPC layer
- // indicates that the channel is connected, proving that the renderer has
- // access to its side of the socket.
- int renderer_fd_;
-#endif
-
// All target proxies currently created. These are ones that receive
// messages.
scoped_ptr<InterfaceProxy> target_proxies_[INTERFACE_ID_COUNT];