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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 void ChannelDispatcherBase::Init(Session* session, | 27 void ChannelDispatcherBase::Init(Session* session, |
28 const ChannelConfig& config, | 28 const ChannelConfig& config, |
29 EventHandler* event_handler) { | 29 EventHandler* event_handler) { |
30 DCHECK(session); | 30 DCHECK(session); |
31 switch (config.transport) { | 31 switch (config.transport) { |
32 case ChannelConfig::TRANSPORT_MUX_STREAM: | 32 case ChannelConfig::TRANSPORT_MUX_STREAM: |
33 channel_factory_ = session->GetMultiplexedChannelFactory(); | 33 channel_factory_ = session->GetMultiplexedChannelFactory(); |
34 break; | 34 break; |
35 | 35 |
| 36 case ChannelConfig::TRANSPORT_QUIC_STREAM: |
| 37 channel_factory_ = session->GetQuicChannelFactory(); |
| 38 break; |
| 39 |
36 case ChannelConfig::TRANSPORT_STREAM: | 40 case ChannelConfig::TRANSPORT_STREAM: |
37 channel_factory_ = session->GetTransportChannelFactory(); | 41 channel_factory_ = session->GetTransportChannelFactory(); |
38 break; | 42 break; |
39 | 43 |
40 default: | 44 default: |
41 LOG(FATAL) << "Unknown transport type: " << config.transport; | 45 LOG(FATAL) << "Unknown transport type: " << config.transport; |
42 } | 46 } |
43 | 47 |
44 event_handler_ = event_handler; | 48 event_handler_ = event_handler; |
45 | 49 |
(...skipping 20 matching lines...) Expand all Loading... |
66 | 70 |
67 event_handler_->OnChannelInitialized(this); | 71 event_handler_->OnChannelInitialized(this); |
68 } | 72 } |
69 | 73 |
70 void ChannelDispatcherBase::OnReadWriteFailed(int error) { | 74 void ChannelDispatcherBase::OnReadWriteFailed(int error) { |
71 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR); | 75 event_handler_->OnChannelError(this, CHANNEL_CONNECTION_ERROR); |
72 } | 76 } |
73 | 77 |
74 } // namespace protocol | 78 } // namespace protocol |
75 } // namespace remoting | 79 } // namespace remoting |
OLD | NEW |