Chromium Code Reviews| Index: remoting/protocol/channel_multiplexer.cc |
| diff --git a/remoting/protocol/channel_multiplexer.cc b/remoting/protocol/channel_multiplexer.cc |
| index 71647bfe890952c34f845a0e6ff4bd6ae1c164b3..92b4f875cc027204083c3f022ed0cc8910a58d76 100644 |
| --- a/remoting/protocol/channel_multiplexer.cc |
| +++ b/remoting/protocol/channel_multiplexer.cc |
| @@ -365,10 +365,6 @@ ChannelMultiplexer::ChannelMultiplexer(ChannelFactory* factory, |
| base_channel_name_(base_channel_name), |
| next_channel_id_(0), |
| destroyed_flag_(NULL) { |
| - factory->CreateStreamChannel( |
| - base_channel_name, |
| - base::Bind(&ChannelMultiplexer::OnBaseChannelReady, |
| - base::Unretained(this))); |
| } |
| ChannelMultiplexer::~ChannelMultiplexer() { |
| @@ -396,6 +392,15 @@ void ChannelMultiplexer::CreateStreamChannel( |
| } else { |
| // Still waiting for the |base_channel_|. |
| pending_channels_.push_back(PendingChannel(name, callback)); |
| + |
| + // If this is the first multiplexed channel then start creation on the base |
|
Wez
2012/08/15 00:52:23
nit: ... then create the base channel ...
Sergey Ulanov
2012/08/15 01:35:42
Done.
|
| + // channel. |
| + if (pending_channels_.size() == 1U) { |
| + base_channel_factory_->CreateStreamChannel( |
| + base_channel_name_, |
| + base::Bind(&ChannelMultiplexer::OnBaseChannelReady, |
| + base::Unretained(this))); |
| + } |
| } |
| } |