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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
245 | 245 |
246 void Port::AddAddress(const rtc::SocketAddress& address, | 246 void Port::AddAddress(const rtc::SocketAddress& address, |
247 const rtc::SocketAddress& base_address, | 247 const rtc::SocketAddress& base_address, |
248 const rtc::SocketAddress& related_address, | 248 const rtc::SocketAddress& related_address, |
249 const std::string& protocol, | 249 const std::string& protocol, |
250 const std::string& relay_protocol, | 250 const std::string& relay_protocol, |
251 const std::string& tcptype, | 251 const std::string& tcptype, |
252 const std::string& type, | 252 const std::string& type, |
253 uint32_t type_preference, | 253 uint32_t type_preference, |
254 uint32_t relay_preference, | 254 uint32_t relay_preference, |
255 std::string url, | |
Taylor Brandstetter
2017/02/10 01:58:46
nit: const ref parameter
Zhi Huang
2017/02/10 06:45:50
Done.
| |
255 bool final) { | 256 bool final) { |
256 if (protocol == TCP_PROTOCOL_NAME && type == LOCAL_PORT_TYPE) { | 257 if (protocol == TCP_PROTOCOL_NAME && type == LOCAL_PORT_TYPE) { |
257 RTC_DCHECK(!tcptype.empty()); | 258 RTC_DCHECK(!tcptype.empty()); |
258 } | 259 } |
259 | 260 |
260 std::string foundation = | 261 std::string foundation = |
261 ComputeFoundation(type, protocol, relay_protocol, base_address); | 262 ComputeFoundation(type, protocol, relay_protocol, base_address); |
262 Candidate c(component_, protocol, address, 0U, username_fragment(), password_, | 263 Candidate c(component_, protocol, address, 0U, username_fragment(), password_, |
263 type, generation_, foundation, network_->id(), network_cost_); | 264 type, generation_, foundation, network_->id(), network_cost_); |
264 c.set_priority( | 265 c.set_priority( |
265 c.GetPriority(type_preference, network_->preference(), relay_preference)); | 266 c.GetPriority(type_preference, network_->preference(), relay_preference)); |
266 c.set_relay_protocol(relay_protocol); | 267 c.set_relay_protocol(relay_protocol); |
267 c.set_tcptype(tcptype); | 268 c.set_tcptype(tcptype); |
268 c.set_network_name(network_->name()); | 269 c.set_network_name(network_->name()); |
269 c.set_network_type(network_->type()); | 270 c.set_network_type(network_->type()); |
270 c.set_related_address(related_address); | 271 c.set_related_address(related_address); |
272 c.set_url(url); | |
271 candidates_.push_back(c); | 273 candidates_.push_back(c); |
272 SignalCandidateReady(this, c); | 274 SignalCandidateReady(this, c); |
273 | 275 |
274 if (final) { | 276 if (final) { |
275 SignalPortComplete(this); | 277 SignalPortComplete(this); |
276 } | 278 } |
277 } | 279 } |
278 | 280 |
279 void Port::AddOrReplaceConnection(Connection* conn) { | 281 void Port::AddOrReplaceConnection(Connection* conn) { |
280 auto ret = connections_.insert( | 282 auto ret = connections_.insert( |
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1588 RTC_DCHECK(sent < 0); | 1590 RTC_DCHECK(sent < 0); |
1589 error_ = port_->GetError(); | 1591 error_ = port_->GetError(); |
1590 stats_.sent_discarded_packets++; | 1592 stats_.sent_discarded_packets++; |
1591 } else { | 1593 } else { |
1592 send_rate_tracker_.AddSamples(sent); | 1594 send_rate_tracker_.AddSamples(sent); |
1593 } | 1595 } |
1594 return sent; | 1596 return sent; |
1595 } | 1597 } |
1596 | 1598 |
1597 } // namespace cricket | 1599 } // namespace cricket |
OLD | NEW |