IPC::Channel: Reduce POSIX specific API surface
This change is a simple cleanup: It removes some Channel API
that is only used only in POSIX specific tests. These
funtions still live in ChannelPosix. POSIX speicific tests
now touch ChannelPosix instead of its superclass Channel.
TEST=none
R=darin@chromium.org, jam@chromium.org
BUG=377980
Review URL: https://codereview.chromium.org/320433002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@275632 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: 5210d592110f837ea556551f4bf480a1c0ba97ef
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index ae2de72..7f17b2f 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -49,11 +49,10 @@
namespace IPC {
-class ChannelPosix : public Channel,
- public internal::ChannelReader,
- public base::MessageLoopForIO::Watcher {
+class IPC_EXPORT ChannelPosix : public Channel,
+ public internal::ChannelReader,
+ public base::MessageLoopForIO::Watcher {
public:
- // Mirror methods of Channel, see ipc_channel.h for description.
ChannelPosix(const IPC::ChannelHandle& channel_handle, Mode mode,
Listener* listener);
virtual ~ChannelPosix();
@@ -65,10 +64,21 @@
virtual base::ProcessId GetPeerPID() const OVERRIDE;
virtual int GetClientFileDescriptor() const OVERRIDE;
virtual int TakeClientFileDescriptor() OVERRIDE;
- virtual bool AcceptsConnections() const OVERRIDE;
- virtual bool HasAcceptedConnection() const OVERRIDE;
- virtual bool GetPeerEuid(uid_t* peer_euid) const OVERRIDE;
- virtual void ResetToAcceptingConnectionState() OVERRIDE;
+
+ // Returns true if the channel supports listening for connections.
+ bool AcceptsConnections() const;
+
+ // Returns true if the channel supports listening for connections and is
+ // currently connected.
+ bool HasAcceptedConnection() const;
+
+ // Closes any currently connected socket, and returns to a listening state
+ // for more connections.
+ void ResetToAcceptingConnectionState();
+
+ // Returns true if the peer process' effective user id can be determined, in
+ // which case the supplied peer_euid is updated with it.
+ bool GetPeerEuid(uid_t* peer_euid) const;
void CloseClientFileDescriptor();