summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/plugin_thread.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-20 03:10:51 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-20 03:10:51 +0000
commit76724d00d3498f952d945d775a3f33f751624121 (patch)
treeaa28e1bb6656708708780693443a275a2d5d43d8 /chrome/plugin/plugin_thread.cc
parentdd86209f364eb604bb42a47dea7ae177d7166632 (diff)
downloadchromium_src-76724d00d3498f952d945d775a3f33f751624121.zip
chromium_src-76724d00d3498f952d945d775a3f33f751624121.tar.gz
chromium_src-76724d00d3498f952d945d775a3f33f751624121.tar.bz2
posix: two related changes to make plugin IPC work on POSIX.
[retry, fix windows compile failure] * use a new ChannelHandle type when passing IPC channels over IPC The current POSIX code assumes that one end of a channel is always a new child process (a renderer). For plugins we need to be able to construct channels between each of the browser, plugin, and renderer. This change augments the messages related to creating channels to allow passing in a base::FileDescriptor containing the socket. The intent is that the browser process, as the initial interchange between plugin and renderer, creates the socketpair() on their behalf and hands each their respective end of the connection. * register channel endpoint names in the global pipe map The plugin code assumes it can map from a string to a channel endpoint at basically any time. So whenever we get a channel endpoint over IPC, we install it in a global map of channel endpoints. Review URL: http://codereview.chromium.org/113157 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18888 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/plugin/plugin_thread.cc')
-rw-r--r--chrome/plugin/plugin_thread.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/chrome/plugin/plugin_thread.cc b/chrome/plugin/plugin_thread.cc
index cb92de4..2f9c2ec 100644
--- a/chrome/plugin/plugin_thread.cc
+++ b/chrome/plugin/plugin_thread.cc
@@ -102,10 +102,19 @@ void PluginThread::CleanUp() {
lazy_tls.Pointer()->Set(NULL);
}
-void PluginThread::OnCreateChannel(int process_id, bool off_the_record) {
+void PluginThread::OnCreateChannel(
+#if defined(OS_POSIX)
+ base::FileDescriptor socket,
+#endif
+ int process_id,
+ bool off_the_record) {
+ int fd = -1;
+#if defined(OS_POSIX)
+ fd = socket.fd;
+#endif
std::string channel_name;
scoped_refptr<PluginChannel> channel =
- PluginChannel::GetPluginChannel(process_id, owner_loop());
+ PluginChannel::GetPluginChannel(process_id, owner_loop(), fd);
if (channel.get()) {
channel_name = channel->channel_name();
channel->set_off_the_record(off_the_record);