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/libjingle_transport_factory.h" | 5 #include "remoting/protocol/libjingle_transport_factory.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/callback_helpers.h" | 10 #include "base/callback_helpers.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 } | 185 } |
186 | 186 |
187 void LibjingleTransport::DoStart() { | 187 void LibjingleTransport::DoStart() { |
188 DCHECK(!channel_.get()); | 188 DCHECK(!channel_.get()); |
189 | 189 |
190 // Create P2PTransportChannel, attach signal handlers and connect it. | 190 // Create P2PTransportChannel, attach signal handlers and connect it. |
191 // TODO(sergeyu): Specify correct component ID for the channel. | 191 // TODO(sergeyu): Specify correct component ID for the channel. |
192 channel_.reset(new cricket::P2PTransportChannel( | 192 channel_.reset(new cricket::P2PTransportChannel( |
193 std::string(), 0, nullptr, port_allocator_)); | 193 std::string(), 0, nullptr, port_allocator_)); |
194 std::string ice_password = rtc::CreateRandomString(cricket::ICE_PWD_LENGTH); | 194 std::string ice_password = rtc::CreateRandomString(cricket::ICE_PWD_LENGTH); |
195 channel_->SetIceProtocolType(cricket::ICEPROTO_RFC5245); | |
196 channel_->SetIceRole((role_ == TransportRole::CLIENT) | 195 channel_->SetIceRole((role_ == TransportRole::CLIENT) |
197 ? cricket::ICEROLE_CONTROLLING | 196 ? cricket::ICEROLE_CONTROLLING |
198 : cricket::ICEROLE_CONTROLLED); | 197 : cricket::ICEROLE_CONTROLLED); |
199 event_handler_->OnTransportIceCredentials(this, ice_username_fragment_, | 198 event_handler_->OnTransportIceCredentials(this, ice_username_fragment_, |
200 ice_password); | 199 ice_password); |
201 channel_->SetIceCredentials(ice_username_fragment_, ice_password); | 200 channel_->SetIceCredentials(ice_username_fragment_, ice_password); |
202 channel_->SignalRequestSignaling.connect( | 201 channel_->SignalRequestSignaling.connect( |
203 this, &LibjingleTransport::OnRequestSignaling); | 202 this, &LibjingleTransport::OnRequestSignaling); |
204 channel_->SignalCandidateReady.connect( | 203 channel_->SignalCandidateReady.connect( |
205 this, &LibjingleTransport::OnCandidateReady); | 204 this, &LibjingleTransport::OnCandidateReady); |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 last_jingle_info_update_time_ = base::TimeTicks::Now(); | 445 last_jingle_info_update_time_ = base::TimeTicks::Now(); |
447 | 446 |
448 while (!on_jingle_info_callbacks_.empty()) { | 447 while (!on_jingle_info_callbacks_.empty()) { |
449 on_jingle_info_callbacks_.begin()->Run(); | 448 on_jingle_info_callbacks_.begin()->Run(); |
450 on_jingle_info_callbacks_.pop_front(); | 449 on_jingle_info_callbacks_.pop_front(); |
451 } | 450 } |
452 } | 451 } |
453 | 452 |
454 } // namespace protocol | 453 } // namespace protocol |
455 } // namespace remoting | 454 } // namespace remoting |
OLD | NEW |