summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_posix.h
diff options
context:
space:
mode:
authorerikchen <erikchen@chromium.org>2015-06-16 14:21:04 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-16 21:22:05 +0000
commit27aa7d8b9e17ed5dd8f6b247c87ae7988f61d793 (patch)
tree7a4c8d42e0ff6f11b961130667dd9c1918b89ba9 /ipc/ipc_channel_posix.h
parent7891daf96e1f86c4874107b3e2308216577bea25 (diff)
downloadchromium_src-27aa7d8b9e17ed5dd8f6b247c87ae7988f61d793.zip
chromium_src-27aa7d8b9e17ed5dd8f6b247c87ae7988f61d793.tar.gz
chromium_src-27aa7d8b9e17ed5dd8f6b247c87ae7988f61d793.tar.bz2
IPC: Make ChannelReader inherit from SupportsAttachmentBrokering.
Each IPC::Channel will have a reference to an AttachmentBroker. This is accomplished by requiring each of the Channel::Create methods to have a |broker| parameter. For now, the |broker| parameter has a default value of nullptr. This default parameter only exists so that this CL and subsequent refactors can be decomposed into smaller CLs. The default parameter will be removed once all callers of Channel::Create have been updated to pass in an appropriate broker. BUG=493414 Review URL: https://codereview.chromium.org/1185133006 Cr-Commit-Position: refs/heads/master@{#334699}
Diffstat (limited to 'ipc/ipc_channel_posix.h')
-rw-r--r--ipc/ipc_channel_posix.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/ipc/ipc_channel_posix.h b/ipc/ipc_channel_posix.h
index 986eb8a..879adc3 100644
--- a/ipc/ipc_channel_posix.h
+++ b/ipc/ipc_channel_posix.h
@@ -26,14 +26,18 @@ class IPC_EXPORT ChannelPosix : public Channel,
public internal::ChannelReader,
public base::MessageLoopForIO::Watcher {
public:
- ChannelPosix(const IPC::ChannelHandle& channel_handle, Mode mode,
- Listener* listener);
+ // |broker| must outlive the newly created object.
+ ChannelPosix(const IPC::ChannelHandle& channel_handle,
+ Mode mode,
+ Listener* listener,
+ AttachmentBroker* broker);
~ChannelPosix() override;
// Channel implementation
bool Connect() override;
void Close() override;
bool Send(Message* message) override;
+ AttachmentBroker* GetAttachmentBroker() override;
base::ProcessId GetPeerPID() const override;
base::ProcessId GetSelfPID() const override;
int GetClientFileDescriptor() const override;
@@ -175,6 +179,9 @@ class IPC_EXPORT ChannelPosix : public Channel,
static int global_pid_;
#endif // OS_LINUX
+ // |broker_| must outlive this instance.
+ AttachmentBroker* broker_;
+
DISALLOW_IMPLICIT_CONSTRUCTORS(ChannelPosix);
};