summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel.h
diff options
context:
space:
mode:
authormattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 21:10:32 +0000
committermattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-05-29 21:10:32 +0000
commitcfa4e4bc94157b66e59d02c721387323a06b2af3 (patch)
tree9550cbf374c1e0249dcde903f5009b22a056c7b7 /ipc/ipc_channel.h
parent4db51ec6941bfbad574f812730206b5519bbe7c4 (diff)
downloadchromium_src-cfa4e4bc94157b66e59d02c721387323a06b2af3.zip
chromium_src-cfa4e4bc94157b66e59d02c721387323a06b2af3.tar.gz
chromium_src-cfa4e4bc94157b66e59d02c721387323a06b2af3.tar.bz2
Revert 273575 "Introduce IPC::Channel::Create*() to ensure it be..."
Broke win compile. > Introduce IPC::Channel::Create*() to ensure it being heap-allocated. > > This change introduces IPC::Channel::Create*() API to turn > IPC::Channel into a heap allocated object. This will allow us to > make Channel a polymorphic class. > > This change also tries to hide Channel::Mode from public API > so that we can simplify channel creation code paths cleaner in > following changes. ChannelProxy has to follow same pattern to > finish this cleanup. Such changes will follow. > > TEST=none > BUG=377980 > R=darin@chromium.org,cpu@chromium.org > > Review URL: https://codereview.chromium.org/307653003 TBR=morrita@chromium.org Review URL: https://codereview.chromium.org/304153005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@273596 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_channel.h')
-rw-r--r--ipc/ipc_channel.h57
1 files changed, 14 insertions, 43 deletions
diff --git a/ipc/ipc_channel.h b/ipc/ipc_channel.h
index be8f83c..4426e5d 100644
--- a/ipc/ipc_channel.h
+++ b/ipc/ipc_channel.h
@@ -55,15 +55,21 @@ class IPC_EXPORT Channel : public Sender {
};
// Some Standard Modes
- // TODO(morrita): These are under deprecation work. You should use Create*()
- // functions instead.
enum Mode {
MODE_NONE = MODE_NO_FLAG,
MODE_SERVER = MODE_SERVER_FLAG,
MODE_CLIENT = MODE_CLIENT_FLAG,
+ // Channels on Windows are named by default and accessible from other
+ // processes. On POSIX channels are anonymous by default and not accessible
+ // from other processes. Named channels work via named unix domain sockets.
+ // On Windows MODE_NAMED_SERVER is equivalent to MODE_SERVER and
+ // MODE_NAMED_CLIENT is equivalent to MODE_CLIENT.
MODE_NAMED_SERVER = MODE_SERVER_FLAG | MODE_NAMED_FLAG,
MODE_NAMED_CLIENT = MODE_CLIENT_FLAG | MODE_NAMED_FLAG,
#if defined(OS_POSIX)
+ // An "open" named server accepts connections from ANY client.
+ // The caller must then implement their own access-control based on the
+ // client process' user Id.
MODE_OPEN_NAMED_SERVER = MODE_OPEN_ACCESS_FLAG | MODE_SERVER_FLAG |
MODE_NAMED_FLAG
#endif
@@ -100,47 +106,15 @@ 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.
//
- // 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.
- //
- // TODO(morrita): Replace CreateByModeForProxy() with one of above Create*().
- //
- static scoped_ptr<Channel> CreateByModeForProxy(
- const IPC::ChannelHandle &channel_handle, Mode mode,Listener* listener);
- static scoped_ptr<Channel> CreateClient(
- const IPC::ChannelHandle &channel_handle, Listener* listener);
-
- // Channels on Windows are named by default and accessible from other
- // processes. On POSIX channels are anonymous by default and not accessible
- // from other processes. Named channels work via named unix domain sockets.
- // On Windows MODE_NAMED_SERVER is equivalent to MODE_SERVER and
- // MODE_NAMED_CLIENT is equivalent to MODE_CLIENT.
- static scoped_ptr<Channel> CreateNamedServer(
- const IPC::ChannelHandle &channel_handle, Listener* listener);
- static scoped_ptr<Channel> CreateNamedClient(
- const IPC::ChannelHandle &channel_handle, Listener* listener);
-#if defined(OS_POSIX)
- // An "open" named server accepts connections from ANY client.
- // The caller must then implement their own access-control based on the
- // client process' user Id.
- static scoped_ptr<Channel> CreateOpenNamedServer(
- const IPC::ChannelHandle &channel_handle, Listener* listener);
-#endif
- static scoped_ptr<Channel> CreateServer(
- const IPC::ChannelHandle &channel_handle, Listener* listener);
-
+ Channel(const IPC::ChannelHandle &channel_handle, Mode mode,
+ Listener* listener);
virtual ~Channel();
@@ -246,9 +220,6 @@ 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_;