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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 } | 118 } |
119 | 119 |
120 bool Transport::GetRemoteSSLCertificate(rtc::SSLCertificate** cert) { | 120 bool Transport::GetRemoteSSLCertificate(rtc::SSLCertificate** cert) { |
121 if (channels_.empty()) | 121 if (channels_.empty()) |
122 return false; | 122 return false; |
123 | 123 |
124 ChannelMap::iterator iter = channels_.begin(); | 124 ChannelMap::iterator iter = channels_.begin(); |
125 return iter->second->GetRemoteSSLCertificate(cert); | 125 return iter->second->GetRemoteSSLCertificate(cert); |
126 } | 126 } |
127 | 127 |
128 void Transport::SetChannelReceivingTimeout(int timeout_ms) { | 128 void Transport::SetIceConfig(const IceConfig& config) { |
129 channel_receiving_timeout_ = timeout_ms; | 129 ice_config_ = config; |
130 for (const auto& kv : channels_) { | 130 for (const auto& kv : channels_) { |
131 kv.second->SetReceivingTimeout(timeout_ms); | 131 kv.second->SetIceConfig(ice_config_); |
132 } | 132 } |
133 } | 133 } |
134 | 134 |
135 bool Transport::SetLocalTransportDescription( | 135 bool Transport::SetLocalTransportDescription( |
136 const TransportDescription& description, | 136 const TransportDescription& description, |
137 ContentAction action, | 137 ContentAction action, |
138 std::string* error_desc) { | 138 std::string* error_desc) { |
139 bool ret = true; | 139 bool ret = true; |
140 | 140 |
141 if (!VerifyIceParams(description)) { | 141 if (!VerifyIceParams(description)) { |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 | 222 |
223 if (impl_exists) { | 223 if (impl_exists) { |
224 // If this is an existing channel, we should just return it without | 224 // If this is an existing channel, we should just return it without |
225 // connecting to all the signal again. | 225 // connecting to all the signal again. |
226 return impl; | 226 return impl; |
227 } | 227 } |
228 | 228 |
229 // Push down our transport state to the new channel. | 229 // Push down our transport state to the new channel. |
230 impl->SetIceRole(ice_role_); | 230 impl->SetIceRole(ice_role_); |
231 impl->SetIceTiebreaker(tiebreaker_); | 231 impl->SetIceTiebreaker(tiebreaker_); |
232 impl->SetReceivingTimeout(channel_receiving_timeout_); | 232 impl->SetIceConfig(ice_config_); |
233 // TODO(ronghuawu): Change CreateChannel to be able to return error since | 233 // TODO(ronghuawu): Change CreateChannel to be able to return error since |
234 // below Apply**Description calls can fail. | 234 // below Apply**Description calls can fail. |
235 if (local_description_) | 235 if (local_description_) |
236 ApplyLocalTransportDescription(impl, NULL); | 236 ApplyLocalTransportDescription(impl, NULL); |
237 if (remote_description_) | 237 if (remote_description_) |
238 ApplyRemoteTransportDescription(impl, NULL); | 238 ApplyRemoteTransportDescription(impl, NULL); |
239 if (local_description_ && remote_description_) | 239 if (local_description_ && remote_description_) |
240 ApplyNegotiatedTransportDescription(impl, NULL); | 240 ApplyNegotiatedTransportDescription(impl, NULL); |
241 | 241 |
242 impl->SignalWritableState.connect(this, &Transport::OnChannelWritableState); | 242 impl->SignalWritableState.connect(this, &Transport::OnChannelWritableState); |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
624 // creation, we have the negotiation state saved until a new | 624 // creation, we have the negotiation state saved until a new |
625 // negotiation happens. | 625 // negotiation happens. |
626 for (auto& iter : channels_) { | 626 for (auto& iter : channels_) { |
627 if (!ApplyNegotiatedTransportDescription(iter.second.get(), error_desc)) | 627 if (!ApplyNegotiatedTransportDescription(iter.second.get(), error_desc)) |
628 return false; | 628 return false; |
629 } | 629 } |
630 return true; | 630 return true; |
631 } | 631 } |
632 | 632 |
633 } // namespace cricket | 633 } // namespace cricket |
OLD | NEW |