summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_proxy.h
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-08-10 12:22:33 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-10 19:23:43 +0000
commita09b9be79387f1107ba29c5f7b0051168193d958 (patch)
tree2f943b47abb71b4e5345fccc7a74991b4cfdc4f8 /ipc/ipc_channel_proxy.h
parent34393143c4c105c407c8526a0a975ab51fe46316 (diff)
downloadchromium_src-a09b9be79387f1107ba29c5f7b0051168193d958.zip
chromium_src-a09b9be79387f1107ba29c5f7b0051168193d958.tar.gz
chromium_src-a09b9be79387f1107ba29c5f7b0051168193d958.tar.bz2
ipc: Make a common subclass for Channel and ProxyChannel.
Channel and ProxyChannel share some functionality which the attachment broker code uses. I made a new, shared superclass called Endpoint. BUG=493414 Review URL: https://codereview.chromium.org/1270683002 Cr-Commit-Position: refs/heads/master@{#342669}
Diffstat (limited to 'ipc/ipc_channel_proxy.h')
-rw-r--r--ipc/ipc_channel_proxy.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/ipc/ipc_channel_proxy.h b/ipc/ipc_channel_proxy.h
index b01ccbc..714bafd 100644
--- a/ipc/ipc_channel_proxy.h
+++ b/ipc/ipc_channel_proxy.h
@@ -13,6 +13,7 @@
#include "base/threading/non_thread_safe.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_channel_handle.h"
+#include "ipc/ipc_endpoint.h"
#include "ipc/ipc_listener.h"
#include "ipc/ipc_sender.h"
@@ -63,7 +64,7 @@ class SendCallbackHelper;
// |channel_lifetime_lock_| is used to protect it. The locking overhead is only
// paid if the underlying channel supports thread-safe |Send|.
//
-class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
+class IPC_EXPORT ChannelProxy : public Endpoint, public base::NonThreadSafe {
public:
#if defined(ENABLE_IPC_FUZZER)
// Interface for a filter to be imposed on outgoing messages which can
@@ -147,9 +148,9 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
// Called to clear the pointer to the IPC task runner when it's going away.
void ClearIPCTaskRunner();
- // Get the process ID for the connected peer.
- // Returns base::kNullProcessId if the peer is not connected yet.
- base::ProcessId GetPeerPID() const { return context_->peer_pid_; }
+ // Endpoint overrides.
+ base::ProcessId GetPeerPID() const override;
+ void OnSetAttachmentBrokerEndpoint() override;
#if defined(OS_POSIX) && !defined(OS_NACL_SFI)
// Calls through to the underlying channel's methods.
@@ -157,8 +158,6 @@ class IPC_EXPORT ChannelProxy : public Sender, public base::NonThreadSafe {
base::ScopedFD TakeClientFileDescriptor();
#endif
- void SetAttachmentBrokerEndpoint(bool is_endpoint);
-
protected:
class Context;
// A subclass uses this constructor if it needs to add more information