summaryrefslogtreecommitdiffstats
path: root/chrome/plugin/plugin_thread.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/plugin/plugin_thread.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/plugin/plugin_thread.h')
-rw-r--r--chrome/plugin/plugin_thread.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/plugin/plugin_thread.h b/chrome/plugin/plugin_thread.h
index 052be0a..911940a 100644
--- a/chrome/plugin/plugin_thread.h
+++ b/chrome/plugin/plugin_thread.h
@@ -7,10 +7,15 @@
#include "base/file_path.h"
#include "base/native_library.h"
+#include "build/build_config.h"
#include "chrome/common/child_thread.h"
#include "chrome/plugin/plugin_channel.h"
#include "webkit/glue/plugins/plugin_lib.h"
+#if defined(OS_POSIX)
+#include "base/file_descriptor_posix.h"
+#endif
+
class NotificationService;
// The PluginThread class represents a background thread where plugin instances
@@ -31,7 +36,14 @@ class PluginThread : public ChildThread {
virtual void Init();
virtual void CleanUp();
- void OnCreateChannel(int process_id, bool off_the_record);
+ // Callback for when a channel has been created.
+ // On POSIX, |socket| is the channel endpoint socket.
+ void OnCreateChannel(
+#if defined(OS_POSIX)
+ base::FileDescriptor socket,
+#endif
+ int process_id,
+ bool off_the_record);
void OnPluginMessage(const std::vector<uint8> &data);
scoped_ptr<NotificationService> notification_service_;