Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 303 << " has more than 1 connection."; | 303 << " has more than 1 connection."; |
| 304 return TransportChannelState::STATE_CONNECTING; | 304 return TransportChannelState::STATE_CONNECTING; |
| 305 } | 305 } |
| 306 } | 306 } |
| 307 | 307 |
| 308 return TransportChannelState::STATE_COMPLETED; | 308 return TransportChannelState::STATE_COMPLETED; |
| 309 } | 309 } |
| 310 | 310 |
| 311 void P2PTransportChannel::SetIceParameters(const IceParameters& ice_params) { | 311 void P2PTransportChannel::SetIceParameters(const IceParameters& ice_params) { |
| 312 ASSERT(worker_thread_ == rtc::Thread::Current()); | 312 ASSERT(worker_thread_ == rtc::Thread::Current()); |
| 313 LOG(LS_INFO) << "Set ICE ufrag: "<< ice_params.ufrag | |
| 314 << " pwd: " << ice_params.pwd | |
| 315 << " on transport "<< transport_name(); | |
|
Taylor Brandstetter
2016/09/14 20:39:04
nit: Missing whitespace, can probably do git cl fo
honghaiz3
2016/09/15 17:38:29
Done.
| |
| 313 ice_parameters_ = ice_params; | 316 ice_parameters_ = ice_params; |
| 314 // Note: Candidate gathering will restart when MaybeStartGathering is next | 317 // Note: Candidate gathering will restart when MaybeStartGathering is next |
| 315 // called. | 318 // called. |
| 316 } | 319 } |
| 317 | 320 |
| 318 void P2PTransportChannel::SetRemoteIceParameters( | 321 void P2PTransportChannel::SetRemoteIceParameters( |
| 319 const IceParameters& ice_params) { | 322 const IceParameters& ice_params) { |
| 320 ASSERT(worker_thread_ == rtc::Thread::Current()); | 323 ASSERT(worker_thread_ == rtc::Thread::Current()); |
| 321 LOG(LS_INFO) << "Remote supports ICE renomination ? " | 324 LOG(LS_INFO) << "Remote supports ICE renomination ? " |
| 322 << ice_params.renomination; | 325 << ice_params.renomination; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 427 << static_cast<int>(config_.default_nomination_mode); | 430 << static_cast<int>(config_.default_nomination_mode); |
| 428 } | 431 } |
| 429 } | 432 } |
| 430 | 433 |
| 431 const IceConfig& P2PTransportChannel::config() const { | 434 const IceConfig& P2PTransportChannel::config() const { |
| 432 return config_; | 435 return config_; |
| 433 } | 436 } |
| 434 | 437 |
| 435 void P2PTransportChannel::MaybeStartGathering() { | 438 void P2PTransportChannel::MaybeStartGathering() { |
| 436 if (ice_parameters_.ufrag.empty() || ice_parameters_.pwd.empty()) { | 439 if (ice_parameters_.ufrag.empty() || ice_parameters_.pwd.empty()) { |
| 440 LOG(LS_ERROR) << "Cannot gather candidates because ICE parameters are empty" | |
| 441 << " ufrag: " << ice_parameters_.ufrag | |
| 442 << " pwd: " << ice_parameters_.pwd; | |
| 437 return; | 443 return; |
| 438 } | 444 } |
| 439 // Start gathering if we never started before, or if an ICE restart occurred. | 445 // Start gathering if we never started before, or if an ICE restart occurred. |
| 440 if (allocator_sessions_.empty() || | 446 if (allocator_sessions_.empty() || |
| 441 IceCredentialsChanged(allocator_sessions_.back()->ice_ufrag(), | 447 IceCredentialsChanged(allocator_sessions_.back()->ice_ufrag(), |
| 442 allocator_sessions_.back()->ice_pwd(), | 448 allocator_sessions_.back()->ice_pwd(), |
| 443 ice_parameters_.ufrag, ice_parameters_.pwd)) { | 449 ice_parameters_.ufrag, ice_parameters_.pwd)) { |
| 444 if (gathering_state_ != kIceGatheringGathering) { | 450 if (gathering_state_ != kIceGatheringGathering) { |
| 445 gathering_state_ = kIceGatheringGathering; | 451 gathering_state_ = kIceGatheringGathering; |
| 446 SignalGatheringState(this); | 452 SignalGatheringState(this); |
| (...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1960 | 1966 |
| 1961 // During the initial state when nothing has been pinged yet, return the first | 1967 // During the initial state when nothing has been pinged yet, return the first |
| 1962 // one in the ordered |connections_|. | 1968 // one in the ordered |connections_|. |
| 1963 return *(std::find_if(connections_.begin(), connections_.end(), | 1969 return *(std::find_if(connections_.begin(), connections_.end(), |
| 1964 [conn1, conn2](Connection* conn) { | 1970 [conn1, conn2](Connection* conn) { |
| 1965 return conn == conn1 || conn == conn2; | 1971 return conn == conn1 || conn == conn2; |
| 1966 })); | 1972 })); |
| 1967 } | 1973 } |
| 1968 | 1974 |
| 1969 } // namespace cricket | 1975 } // namespace cricket |
| OLD | NEW |