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

Unified Diff: content/ppapi_plugin/ppapi_thread.cc

Issue 2302053004: Use ChannelMojo for plugin-renderer channels. (Closed)
Patch Set: Created 4 years, 2 months 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
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/renderer/pepper/host_dispatcher_wrapper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/ppapi_plugin/ppapi_thread.cc
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc
index ca09ba68f72df49f350f73deb27c43942ac05ab2..a719424c93cbe95e434815247e2d3531d39c8886 100644
--- a/content/ppapi_plugin/ppapi_thread.cc
+++ b/content/ppapi_plugin/ppapi_thread.cc
@@ -488,10 +488,7 @@ bool PpapiThread::SetupChannel(base::ProcessId renderer_pid,
bool incognito,
IPC::ChannelHandle* handle) {
DCHECK(is_broker_ == (connect_instance_func_ != NULL));
- IPC::ChannelHandle plugin_handle;
- plugin_handle.name = IPC::Channel::GenerateVerifiedChannelID(
- base::StringPrintf(
- "%d.r%d", base::GetCurrentProcId(), renderer_child_id));
+ mojo::MessagePipe pipe;
ppapi::proxy::ProxyChannel* dispatcher = NULL;
bool init_result = false;
@@ -500,10 +497,8 @@ bool PpapiThread::SetupChannel(base::ProcessId renderer_pid,
BrokerProcessDispatcher* broker_dispatcher =
new BrokerProcessDispatcher(plugin_entry_points_.get_interface,
connect_instance_func_, peer_is_browser);
- init_result = broker_dispatcher->InitBrokerWithChannel(this,
- renderer_pid,
- plugin_handle,
- false);
+ init_result = broker_dispatcher->InitBrokerWithChannel(
+ this, renderer_pid, pipe.handle0.release(), false);
dispatcher = broker_dispatcher;
} else {
DCHECK_NE(base::kNullProcessId, renderer_pid);
@@ -511,10 +506,8 @@ bool PpapiThread::SetupChannel(base::ProcessId renderer_pid,
new PluginProcessDispatcher(plugin_entry_points_.get_interface,
permissions_,
incognito);
- init_result = plugin_dispatcher->InitPluginWithChannel(this,
- renderer_pid,
- plugin_handle,
- false);
+ init_result = plugin_dispatcher->InitPluginWithChannel(
+ this, renderer_pid, pipe.handle0.release(), false);
dispatcher = plugin_dispatcher;
}
@@ -522,16 +515,7 @@ bool PpapiThread::SetupChannel(base::ProcessId renderer_pid,
delete dispatcher;
return false;
}
-
- handle->name = plugin_handle.name;
-#if defined(OS_POSIX)
- // 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());
- if (handle->socket.fd == -1)
- return false;
-#endif
+ *handle = pipe.handle1.release();
// From here, the dispatcher will manage its own lifetime according to the
// lifetime of the attached channel.
« no previous file with comments | « content/browser/plugin_data_remover_impl.cc ('k') | content/renderer/pepper/host_dispatcher_wrapper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698