| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "remoting/protocol/channel_dispatcher_base.h" | 5 #include "remoting/protocol/channel_dispatcher_base.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "remoting/protocol/p2p_stream_socket.h" | 8 #include "remoting/protocol/p2p_stream_socket.h" |
| 9 #include "remoting/protocol/session.h" | 9 #include "remoting/protocol/session.h" |
| 10 #include "remoting/protocol/session_config.h" | 10 #include "remoting/protocol/session_config.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 void ChannelDispatcherBase::Init(Session* session, | 28 void ChannelDispatcherBase::Init(Session* session, |
| 29 const ChannelConfig& config, | 29 const ChannelConfig& config, |
| 30 EventHandler* event_handler) { | 30 EventHandler* event_handler) { |
| 31 DCHECK(session); | 31 DCHECK(session); |
| 32 switch (config.transport) { | 32 switch (config.transport) { |
| 33 case ChannelConfig::TRANSPORT_MUX_STREAM: | 33 case ChannelConfig::TRANSPORT_MUX_STREAM: |
| 34 channel_factory_ = | 34 channel_factory_ = |
| 35 session->GetTransport()->GetMultiplexedChannelFactory(); | 35 session->GetTransport()->GetMultiplexedChannelFactory(); |
| 36 break; | 36 break; |
| 37 | 37 |
| 38 case ChannelConfig::TRANSPORT_QUIC_STREAM: | |
| 39 channel_factory_ = session->GetQuicChannelFactory(); | |
| 40 break; | |
| 41 | |
| 42 case ChannelConfig::TRANSPORT_STREAM: | 38 case ChannelConfig::TRANSPORT_STREAM: |
| 43 channel_factory_ = session->GetTransport()->GetStreamChannelFactory(); | 39 channel_factory_ = session->GetTransport()->GetStreamChannelFactory(); |
| 44 break; | 40 break; |
| 45 | 41 |
| 46 default: | 42 default: |
| 47 LOG(FATAL) << "Unknown transport type: " << config.transport; | 43 LOG(FATAL) << "Unknown transport type: " << config.transport; |
| 48 } | 44 } |
| 49 | 45 |
| 50 event_handler_ = event_handler; | 46 event_handler_ = event_handler; |
| 51 | 47 |
| (...skipping 20 matching lines...) Expand all Loading... |
| 72 | 68 |
| 73 event_handler_->OnChannelInitialized(this); | 69 event_handler_->OnChannelInitialized(this); |
| 74 } | 70 } |
| 75 | 71 |
| 76 void ChannelDispatcherBase::OnReadWriteFailed(int error) { | 72 void ChannelDispatcherBase::OnReadWriteFailed(int error) { |
| 77 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR); | 73 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR); |
| 78 } | 74 } |
| 79 | 75 |
| 80 } // namespace protocol | 76 } // namespace protocol |
| 81 } // namespace remoting | 77 } // namespace remoting |
| OLD | NEW |