| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/webrtc_connection_to_host.h" | 5 #include "remoting/protocol/webrtc_connection_to_host.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "jingle/glue/thread_wrapper.h" | 9 #include "jingle/glue/thread_wrapper.h" |
| 10 #include "remoting/protocol/client_control_dispatcher.h" | 10 #include "remoting/protocol/client_control_dispatcher.h" |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 case Session::FAILED: | 98 case Session::FAILED: |
| 99 CloseChannels(); | 99 CloseChannels(); |
| 100 SetState(FAILED, session_->error()); | 100 SetState(FAILED, session_->error()); |
| 101 break; | 101 break; |
| 102 } | 102 } |
| 103 } | 103 } |
| 104 | 104 |
| 105 void WebrtcConnectionToHost::OnWebrtcTransportConnecting() { | 105 void WebrtcConnectionToHost::OnWebrtcTransportConnecting() { |
| 106 event_dispatcher_.reset(new ClientEventDispatcher()); | 106 event_dispatcher_.reset(new ClientEventDispatcher()); |
| 107 event_dispatcher_->Init(transport_->outgoing_channel_factory(), this); | 107 event_dispatcher_->Init( |
| 108 transport_->CreateOutgoingChannel(event_dispatcher_->channel_name()), |
| 109 this); |
| 108 } | 110 } |
| 109 | 111 |
| 110 void WebrtcConnectionToHost::OnWebrtcTransportConnected() {} | 112 void WebrtcConnectionToHost::OnWebrtcTransportConnected() {} |
| 111 | 113 |
| 112 void WebrtcConnectionToHost::OnWebrtcTransportError(ErrorCode error) { | 114 void WebrtcConnectionToHost::OnWebrtcTransportError(ErrorCode error) { |
| 113 CloseChannels(); | 115 CloseChannels(); |
| 114 SetState(FAILED, error); | 116 SetState(FAILED, error); |
| 115 } | 117 } |
| 116 | 118 |
| 117 void WebrtcConnectionToHost::OnWebrtcTransportIncomingDataChannel( | 119 void WebrtcConnectionToHost::OnWebrtcTransportIncomingDataChannel( |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 | 185 |
| 184 if (state != state_) { | 186 if (state != state_) { |
| 185 state_ = state; | 187 state_ = state; |
| 186 error_ = error; | 188 error_ = error; |
| 187 event_callback_->OnConnectionState(state_, error_); | 189 event_callback_->OnConnectionState(state_, error_); |
| 188 } | 190 } |
| 189 } | 191 } |
| 190 | 192 |
| 191 } // namespace protocol | 193 } // namespace protocol |
| 192 } // namespace remoting | 194 } // namespace remoting |
| OLD | NEW |