Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10778)

Unified Diff: chrome/ppapi_plugin/ppapi_thread.cc

Issue 5598010: Convert over to channel handles (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Fixed up bad whitespace Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/ppapi_plugin/ppapi_thread.cc
diff --git a/chrome/ppapi_plugin/ppapi_thread.cc b/chrome/ppapi_plugin/ppapi_thread.cc
index 7d8eedab89ce9a1b2f9f20e6773d8f452b32d730..be6075d08804a2d92f38b382d2f5fc7ff73e9bc2 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;

Powered by Google App Engine
This is Rietveld 408576698