| Index: remoting/protocol/channel_dispatcher_base.cc
|
| diff --git a/remoting/protocol/channel_dispatcher_base.cc b/remoting/protocol/channel_dispatcher_base.cc
|
| index ee90ee56dcbc7bc02756ebf80e919e90889d6cbd..e997bebe7cd9286f4d757f25eaf75aa96c9cbd25 100644
|
| --- a/remoting/protocol/channel_dispatcher_base.cc
|
| +++ b/remoting/protocol/channel_dispatcher_base.cc
|
| @@ -29,7 +29,8 @@ void ChannelDispatcherBase::Init(Session* session,
|
| const ChannelConfig& config,
|
| EventHandler* event_handler) {
|
| DCHECK(session);
|
| - switch (config.transport) {
|
| + channel_config_ = config;
|
| + switch (channel_config_.transport) {
|
| case ChannelConfig::TRANSPORT_MUX_STREAM:
|
| channel_factory_ = session->GetMultiplexedChannelFactory();
|
| break;
|
| @@ -39,7 +40,7 @@ void ChannelDispatcherBase::Init(Session* session,
|
| break;
|
|
|
| default:
|
| - LOG(FATAL) << "Unknown transport type: " << config.transport;
|
| + LOG(FATAL) << "Unknown transport type: " << channel_config_.transport;
|
| }
|
|
|
| event_handler_ = event_handler;
|
| @@ -48,10 +49,14 @@ void ChannelDispatcherBase::Init(Session* session,
|
| &ChannelDispatcherBase::OnChannelReady, base::Unretained(this)));
|
| }
|
|
|
| +void ChannelDispatcherBase::NotifyError(ErrorCode error) {
|
| + event_handler_->OnChannelError(this, error);
|
| +}
|
| +
|
| void ChannelDispatcherBase::OnChannelReady(
|
| scoped_ptr<net::StreamSocket> socket) {
|
| if (!socket.get()) {
|
| - event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR);
|
| + NotifyError(CHANNEL_CONNECTION_ERROR);
|
| return;
|
| }
|
|
|
| @@ -65,7 +70,7 @@ void ChannelDispatcherBase::OnChannelReady(
|
| }
|
|
|
| void ChannelDispatcherBase::OnWriteFailed(int error) {
|
| - event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR);
|
| + NotifyError(CHANNEL_CONNECTION_ERROR);
|
| }
|
|
|
| } // namespace protocol
|
|
|