Index: ipc/mojo/ipc_channel_mojo.cc |
diff --git a/ipc/mojo/ipc_channel_mojo.cc b/ipc/mojo/ipc_channel_mojo.cc |
index d4e52606776ff043cd5afc81bd52f9df7e9c06a7..8d0847dd7c56f6dcac34af719a20522ee61e4872 100644 |
--- a/ipc/mojo/ipc_channel_mojo.cc |
+++ b/ipc/mojo/ipc_channel_mojo.cc |
@@ -31,11 +31,13 @@ class MojoChannelFactory : public ChannelFactory { |
MojoChannelFactory(ChannelMojo::Delegate* delegate, |
scoped_refptr<base::TaskRunner> io_runner, |
ChannelHandle channel_handle, |
- Channel::Mode mode) |
+ Channel::Mode mode, |
+ AttachmentBroker* broker) |
: delegate_(delegate), |
io_runner_(io_runner), |
channel_handle_(channel_handle), |
- mode_(mode) {} |
+ mode_(mode), |
+ broker_(broker) {} |
std::string GetName() const override { |
return channel_handle_.name; |
@@ -43,7 +45,7 @@ class MojoChannelFactory : public ChannelFactory { |
scoped_ptr<Channel> BuildChannel(Listener* listener) override { |
return ChannelMojo::Create(delegate_, io_runner_, channel_handle_, mode_, |
- listener); |
+ listener, broker_); |
} |
private: |
@@ -51,6 +53,7 @@ class MojoChannelFactory : public ChannelFactory { |
scoped_refptr<base::TaskRunner> io_runner_; |
ChannelHandle channel_handle_; |
Channel::Mode mode_; |
+ AttachmentBroker* broker_; |
}; |
//------------------------------------------------------------------------------ |
@@ -62,12 +65,14 @@ class ClientChannelMojo : public ChannelMojo, |
ClientChannelMojo(ChannelMojo::Delegate* delegate, |
scoped_refptr<base::TaskRunner> io_runner, |
const ChannelHandle& handle, |
- Listener* listener); |
+ Listener* listener, |
+ AttachmentBroker* broker); |
~ClientChannelMojo() override; |
// MojoBootstrap::Delegate implementation |
void OnPipeAvailable(mojo::embedder::ScopedPlatformHandle handle) override; |
// mojo::ErrorHandler implementation |
void OnConnectionError() override; |
+ |
// ClientChannel implementation |
void Init( |
mojo::ScopedMessagePipeHandle pipe, |
@@ -86,7 +91,8 @@ class ClientChannelMojo : public ChannelMojo, |
ClientChannelMojo::ClientChannelMojo(ChannelMojo::Delegate* delegate, |
scoped_refptr<base::TaskRunner> io_runner, |
const ChannelHandle& handle, |
- Listener* listener) |
+ Listener* listener, |
+ AttachmentBroker* broker) |
: ChannelMojo(delegate, io_runner, handle, Channel::MODE_CLIENT, listener), |
binding_(this), |
weak_factory_(this) { |
@@ -124,7 +130,8 @@ class ServerChannelMojo : public ChannelMojo, public mojo::ErrorHandler { |
ServerChannelMojo(ChannelMojo::Delegate* delegate, |
scoped_refptr<base::TaskRunner> io_runner, |
const ChannelHandle& handle, |
- Listener* listener); |
+ Listener* listener, |
+ AttachmentBroker* broker); |
~ServerChannelMojo() override; |
// MojoBootstrap::Delegate implementation |
@@ -151,7 +158,8 @@ class ServerChannelMojo : public ChannelMojo, public mojo::ErrorHandler { |
ServerChannelMojo::ServerChannelMojo(ChannelMojo::Delegate* delegate, |
scoped_refptr<base::TaskRunner> io_runner, |
const ChannelHandle& handle, |
- Listener* listener) |
+ Listener* listener, |
+ AttachmentBroker* broker) |
: ChannelMojo(delegate, io_runner, handle, Channel::MODE_SERVER, listener), |
weak_factory_(this) { |
} |
@@ -248,14 +256,15 @@ scoped_ptr<ChannelMojo> ChannelMojo::Create( |
scoped_refptr<base::TaskRunner> io_runner, |
const ChannelHandle& channel_handle, |
Mode mode, |
- Listener* listener) { |
+ Listener* listener, |
+ AttachmentBroker* broker) { |
switch (mode) { |
case Channel::MODE_CLIENT: |
- return make_scoped_ptr( |
- new ClientChannelMojo(delegate, io_runner, channel_handle, listener)); |
+ return make_scoped_ptr(new ClientChannelMojo( |
+ delegate, io_runner, channel_handle, listener, broker)); |
case Channel::MODE_SERVER: |
- return make_scoped_ptr( |
- new ServerChannelMojo(delegate, io_runner, channel_handle, listener)); |
+ return make_scoped_ptr(new ServerChannelMojo( |
+ delegate, io_runner, channel_handle, listener, broker)); |
default: |
NOTREACHED(); |
return nullptr; |
@@ -266,18 +275,20 @@ scoped_ptr<ChannelMojo> ChannelMojo::Create( |
scoped_ptr<ChannelFactory> ChannelMojo::CreateServerFactory( |
ChannelMojo::Delegate* delegate, |
scoped_refptr<base::TaskRunner> io_runner, |
- const ChannelHandle& channel_handle) { |
+ const ChannelHandle& channel_handle, |
+ AttachmentBroker* broker) { |
return make_scoped_ptr(new MojoChannelFactory( |
- delegate, io_runner, channel_handle, Channel::MODE_SERVER)); |
+ delegate, io_runner, channel_handle, Channel::MODE_SERVER, broker)); |
} |
// static |
scoped_ptr<ChannelFactory> ChannelMojo::CreateClientFactory( |
ChannelMojo::Delegate* delegate, |
scoped_refptr<base::TaskRunner> io_runner, |
- const ChannelHandle& channel_handle) { |
+ const ChannelHandle& channel_handle, |
+ AttachmentBroker* broker) { |
return make_scoped_ptr(new MojoChannelFactory( |
- delegate, io_runner, channel_handle, Channel::MODE_CLIENT)); |
+ delegate, io_runner, channel_handle, Channel::MODE_CLIENT, broker)); |
} |
ChannelMojo::ChannelMojo(ChannelMojo::Delegate* delegate, |