| 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/ice_transport.h" | 5 #include "remoting/protocol/ice_transport.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "remoting/protocol/channel_authenticator.h" | 8 #include "remoting/protocol/channel_authenticator.h" |
| 9 #include "remoting/protocol/channel_multiplexer.h" | 9 #include "remoting/protocol/channel_multiplexer.h" |
| 10 #include "remoting/protocol/pseudotcp_channel_factory.h" | 10 #include "remoting/protocol/pseudotcp_channel_factory.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 const int kTransportInfoSendDelayMs = 20; | 22 const int kTransportInfoSendDelayMs = 20; |
| 23 | 23 |
| 24 // Name of the multiplexed channel. | 24 // Name of the multiplexed channel. |
| 25 static const char kMuxChannelName[] = "mux"; | 25 static const char kMuxChannelName[] = "mux"; |
| 26 | 26 |
| 27 IceTransport::IceTransport(scoped_refptr<TransportContext> transport_context, | 27 IceTransport::IceTransport(scoped_refptr<TransportContext> transport_context, |
| 28 EventHandler* event_handler) | 28 EventHandler* event_handler) |
| 29 : transport_context_(transport_context), | 29 : transport_context_(transport_context), |
| 30 event_handler_(event_handler), | 30 event_handler_(event_handler), |
| 31 weak_factory_(this) { | 31 weak_factory_(this) { |
| 32 transport_context_->set_relay_mode(TransportContext::RelayMode::GTURN); |
| 32 transport_context->Prepare(); | 33 transport_context->Prepare(); |
| 33 } | 34 } |
| 34 | 35 |
| 35 IceTransport::~IceTransport() { | 36 IceTransport::~IceTransport() { |
| 36 channel_multiplexer_.reset(); | 37 channel_multiplexer_.reset(); |
| 37 DCHECK(channels_.empty()); | 38 DCHECK(channels_.empty()); |
| 38 } | 39 } |
| 39 | 40 |
| 40 void IceTransport::Start( | 41 void IceTransport::Start( |
| 41 Authenticator* authenticator, | 42 Authenticator* authenticator, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 send_transport_info_callback_.Run(std::move(transport_info_xml)); | 199 send_transport_info_callback_.Run(std::move(transport_info_xml)); |
| 199 } | 200 } |
| 200 | 201 |
| 201 void IceTransport::OnChannelError(int error) { | 202 void IceTransport::OnChannelError(int error) { |
| 202 LOG(ERROR) << "Data channel failed, error=" << error; | 203 LOG(ERROR) << "Data channel failed, error=" << error; |
| 203 event_handler_->OnIceTransportError(CHANNEL_CONNECTION_ERROR); | 204 event_handler_->OnIceTransportError(CHANNEL_CONNECTION_ERROR); |
| 204 } | 205 } |
| 205 | 206 |
| 206 } // namespace protocol | 207 } // namespace protocol |
| 207 } // namespace remoting | 208 } // namespace remoting |
| OLD | NEW |