Index: ipc/ipc_channel.h |
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h |
index 4426e5d5c7b38aa75365b4740694d3ed10f9ce13..b88a43791b58601ec0284a48257ac91a061c9a0a 100644 |
--- a/ipc/ipc_channel.h |
+++ b/ipc/ipc_channel.h |
@@ -106,15 +106,36 @@ class IPC_EXPORT Channel : public Sender { |
// the file descriptor in the channel handle is != -1, the channel takes |
// ownership of the file descriptor and will close it appropriately, otherwise |
// it will create a new descriptor internally. |
- // |mode| specifies whether this Channel is to operate in server mode or |
- // client mode. In server mode, the Channel is responsible for setting up the |
- // IPC object, whereas in client mode, the Channel merely connects to the |
- // already established IPC object. |
// |listener| receives a callback on the current thread for each newly |
// received message. |
// |
- Channel(const IPC::ChannelHandle &channel_handle, Mode mode, |
- Listener* listener); |
+ // There are four type of modes how channels operate: |
+ // |
+ // - Server and named server: In these modes, the Channel is |
+ // responsible for settingb up the IPC object |
+ // - An "open" named server: It accepts connections from ANY client. |
+ // The caller must then implement their own access-control based on the |
+ // client process' user Id. |
+ // - Client and named client: In these mode, the Channel merely |
+ // connects to the already established IPC object. |
+ // |
+ // Each mode has its own Create*() API to create the Channel object. |
+ // |
+ // FIXME(morrita): Replace CreateByModeForProxy() with one of above Create*(). |
darin (slow to review)
2014/05/28 19:47:14
nit: in Chromium unlike Blink, we use TODO(user) i
Hajime Morrita
2014/05/28 22:32:24
Done.
|
+ // |
+ static Channel* CreateByModeForProxy(const IPC::ChannelHandle &channel_handle, |
darin (slow to review)
2014/05/28 19:47:14
nit: these should return scoped_ptr<Channel>.
darin (slow to review)
2014/05/28 19:47:14
Perhaps the documentation that currently exists fo
Hajime Morrita
2014/05/28 22:32:24
Done.
|
+ Mode mode,Listener* listener); |
+ static Channel* CreateClient(const IPC::ChannelHandle &channel_handle, |
+ Listener* listener); |
+ static Channel* CreateNamedServer(const IPC::ChannelHandle &channel_handle, |
+ Listener* listener); |
+ static Channel* CreateNamedClient(const IPC::ChannelHandle &channel_handle, |
+ Listener* listener); |
+ static Channel* CreateOpenNamedServer( |
darin (slow to review)
2014/05/28 19:47:14
It seems like CreateOpenNamedServer should be guar
Hajime Morrita
2014/05/28 22:32:24
Done.
|
+ const IPC::ChannelHandle &channel_handle, Listener* listener); |
+ static Channel* CreateServer(const IPC::ChannelHandle &channel_handle, |
+ Listener* listener); |
+ |
virtual ~Channel(); |
@@ -220,6 +241,9 @@ class IPC_EXPORT Channel : public Sender { |
Channel() : channel_impl_(0) { } |
private: |
+ Channel(const IPC::ChannelHandle &channel_handle, Mode mode, |
+ Listener* listener); |
+ |
// PIMPL to which all channel calls are delegated. |
class ChannelImpl; |
ChannelImpl *channel_impl_; |