diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 19:28:09 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-08 19:28:09 +0000 |
commit | 42ce94ec8e98df0744cc1dea26b49c084fe185f0 (patch) | |
tree | 8b585da323dc3bbabb3c61a8941aed90e1819648 /chrome/ppapi_plugin | |
parent | ade3ef65f389b00a101da5eb18a02b966d354b18 (diff) | |
download | chromium_src-42ce94ec8e98df0744cc1dea26b49c084fe185f0.zip chromium_src-42ce94ec8e98df0744cc1dea26b49c084fe185f0.tar.gz chromium_src-42ce94ec8e98df0744cc1dea26b49c084fe185f0.tar.bz2 |
Convert over to channel handles
This hides some of the internals of the posix channels from users, and gets rid
of several #ifdef POSIX blocks. Generally simplifies usage of channels xplatform.
BUG=none
TEST=build
Review URL: http://codereview.chromium.org/5598010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68621 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/ppapi_plugin')
-rw-r--r-- | chrome/ppapi_plugin/ppapi_thread.cc | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/chrome/ppapi_plugin/ppapi_thread.cc b/chrome/ppapi_plugin/ppapi_thread.cc index 7d8eeda..be6075d 100644 --- a/chrome/ppapi_plugin/ppapi_thread.cc +++ b/chrome/ppapi_plugin/ppapi_thread.cc @@ -99,29 +99,19 @@ bool PpapiThread::LoadPluginLib(base::ProcessHandle host_process_handle, bool PpapiThread::SetupRendererChannel(int renderer_id, IPC::ChannelHandle* handle) { - std::string channel_key = StringPrintf( - "%d.r%d", base::GetCurrentProcId(), renderer_id); - -#if defined(OS_POSIX) - // This gets called when the PluginChannel is initially created. At this - // point, create the socketpair and assign the plugin side FD to the channel - // name. Keep the renderer side FD as a member variable in the PluginChannel - // to be able to transmit it through IPC. - int plugin_fd; - if (!IPC::SocketPair(&plugin_fd, &renderer_fd_)) - return false; - IPC::AddChannelSocket(channel_key, plugin_fd); -#endif - + IPC::ChannelHandle plugin_handle; + plugin_handle.name = StringPrintf("%d.r%d", base::GetCurrentProcId(), + renderer_id); if (!dispatcher_->InitWithChannel( ChildProcess::current()->io_message_loop(), - channel_key, false, + plugin_handle, false, ChildProcess::current()->GetShutDownEvent())) return false; - handle->name = channel_key; + handle->name = plugin_handle.name; #if defined(OS_POSIX) // On POSIX, pass the renderer-side FD. + renderer_fd_ = dispatcher_->channel()->GetClientFileDescriptor(); handle->socket = base::FileDescriptor(renderer_fd_, false); #endif return true; |