Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Unified Diff: ipc/ipc_channel_posix.h

Issue 310293002: Make IPC::Channel polymorphic (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Another attempt to fix build breakage Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_posix.h
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index 1e587c13eb0d02e8737db4d6c088659356656e3e..ae2de72f7fe3fa582a90ff379efb4b043b68f1ad 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -49,24 +49,29 @@
namespace IPC {
-class Channel::ChannelImpl : public internal::ChannelReader,
- public base::MessageLoopForIO::Watcher {
+class ChannelPosix : public Channel,
+ public internal::ChannelReader,
+ public base::MessageLoopForIO::Watcher {
public:
// Mirror methods of Channel, see ipc_channel.h for description.
- ChannelImpl(const IPC::ChannelHandle& channel_handle, Mode mode,
- Listener* listener);
- virtual ~ChannelImpl();
- bool Connect();
- void Close();
- bool Send(Message* message);
- int GetClientFileDescriptor();
- int TakeClientFileDescriptor();
+ ChannelPosix(const IPC::ChannelHandle& channel_handle, Mode mode,
+ Listener* listener);
+ virtual ~ChannelPosix();
+
+ // Channel implementation
+ virtual bool Connect() OVERRIDE;
+ virtual void Close() OVERRIDE;
+ virtual bool Send(Message* message) OVERRIDE;
+ 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;
+
void CloseClientFileDescriptor();
- bool AcceptsConnections() const;
- bool HasAcceptedConnection() const;
- bool GetPeerEuid(uid_t* peer_euid) const;
- void ResetToAcceptingConnectionState();
- base::ProcessId peer_pid() const { return peer_pid_; }
+
static bool IsNamedServerInitialized(const std::string& channel_id);
#if defined(OS_LINUX)
static void SetGlobalPid(int pid);
@@ -144,7 +149,7 @@ class Channel::ChannelImpl : public internal::ChannelReader,
// For a server, the client end of our socketpair() -- the other end of our
// pipe_ that is passed to the client.
int client_pipe_;
- base::Lock client_pipe_lock_; // Lock that protects |client_pipe_|.
+ mutable base::Lock client_pipe_lock_; // Lock that protects |client_pipe_|.
#if defined(IPC_USES_READWRITE)
// Linux/BSD use a dedicated socketpair() for passing file descriptors.
@@ -202,7 +207,7 @@ class Channel::ChannelImpl : public internal::ChannelReader,
static int global_pid_;
#endif // OS_LINUX
- DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelImpl);
+ DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix);
};
} // namespace IPC
« no previous file with comments | « ipc/ipc_channel_nacl.cc ('k') | ipc/ipc_channel_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698