summaryrefslogtreecommitdiffstats
path: root/chrome/common/plugin_messages_internal.h
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 20:50:09 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 20:50:09 +0000
commit255a9f6c6f6db2a95fec78c6c2f2c504c655e733 (patch)
tree471d21ae7e41cc2e33a491a5309b3ea77430ebca /chrome/common/plugin_messages_internal.h
parent04b74d13d927794495a1a3a1b89d67f85a104e12 (diff)
downloadchromium_src-255a9f6c6f6db2a95fec78c6c2f2c504c655e733.zip
chromium_src-255a9f6c6f6db2a95fec78c6c2f2c504c655e733.tar.gz
chromium_src-255a9f6c6f6db2a95fec78c6c2f2c504c655e733.tar.bz2
posix: two related changes to make plugin IPC work on POSIX.
* 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@18850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/plugin_messages_internal.h')
-rw-r--r--chrome/common/plugin_messages_internal.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/common/plugin_messages_internal.h b/chrome/common/plugin_messages_internal.h
index b2805fc..500bd93 100644
--- a/chrome/common/plugin_messages_internal.h
+++ b/chrome/common/plugin_messages_internal.h
@@ -3,9 +3,14 @@
// found in the LICENSE file.
#include "base/shared_memory.h"
+#include "build/build_config.h"
#include "chrome/common/ipc_message_macros.h"
#include "webkit/glue/webcursor.h"
+#if defined(OS_POSIX)
+#include "base/file_descriptor_posix.h"
+#endif
+
//-----------------------------------------------------------------------------
// PluginProcess messages
// These are messages sent from the browser to the plugin process.
@@ -15,9 +20,19 @@ IPC_BEGIN_MESSAGES(PluginProcess)
// PluginProcessHostMsg_ChannelCreated message. The renderer's process_id is
// passed so that the plugin process reuses an existing channel to that
// process if it exists.
+ // It would be nice to use #ifdefs inside the parameter list to not need to
+ // duplicate this across POSIX/Windows but the Visual Studio compiler doesn't
+ // like that.
+#if defined(OS_WIN)
IPC_MESSAGE_CONTROL2(PluginProcessMsg_CreateChannel,
int /* process_id */,
bool /* off_the_record */)
+#elif defined(OS_POSIX)
+ IPC_MESSAGE_CONTROL3(PluginProcessMsg_CreateChannel,
+ base::FileDescriptor /* socket for new channel */,
+ int /* process_id */,
+ bool /* off_the_record */)
+#endif
// Allows a chrome plugin loaded in the browser process to send arbitrary
// data to an instance of the same plugin loaded in a plugin process.