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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 port_->requests_.SendDelayed( | 99 port_->requests_.SendDelayed( |
100 new StunBindingRequest(port_, true, server_addr_), | 100 new StunBindingRequest(port_, true, server_addr_), |
101 RETRY_DELAY); | 101 RETRY_DELAY); |
102 } | 102 } |
103 } | 103 } |
104 | 104 |
105 private: | 105 private: |
106 UDPPort* port_; | 106 UDPPort* port_; |
107 bool keep_alive_; | 107 bool keep_alive_; |
108 const rtc::SocketAddress server_addr_; | 108 const rtc::SocketAddress server_addr_; |
109 uint32 start_time_; | 109 uint32_t start_time_; |
110 }; | 110 }; |
111 | 111 |
112 UDPPort::AddressResolver::AddressResolver( | 112 UDPPort::AddressResolver::AddressResolver( |
113 rtc::PacketSocketFactory* factory) | 113 rtc::PacketSocketFactory* factory) |
114 : socket_factory_(factory) {} | 114 : socket_factory_(factory) {} |
115 | 115 |
116 UDPPort::AddressResolver::~AddressResolver() { | 116 UDPPort::AddressResolver::~AddressResolver() { |
117 for (ResolverMap::iterator it = resolvers_.begin(); | 117 for (ResolverMap::iterator it = resolvers_.begin(); |
118 it != resolvers_.end(); ++it) { | 118 it != resolvers_.end(); ++it) { |
119 it->second->Destroy(true); | 119 it->second->Destroy(true); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 ready_(false), | 175 ready_(false), |
176 stun_keepalive_delay_(KEEPALIVE_DELAY), | 176 stun_keepalive_delay_(KEEPALIVE_DELAY), |
177 emit_localhost_for_anyaddress_(emit_localhost_for_anyaddress) { | 177 emit_localhost_for_anyaddress_(emit_localhost_for_anyaddress) { |
178 requests_.set_origin(origin); | 178 requests_.set_origin(origin); |
179 } | 179 } |
180 | 180 |
181 UDPPort::UDPPort(rtc::Thread* thread, | 181 UDPPort::UDPPort(rtc::Thread* thread, |
182 rtc::PacketSocketFactory* factory, | 182 rtc::PacketSocketFactory* factory, |
183 rtc::Network* network, | 183 rtc::Network* network, |
184 const rtc::IPAddress& ip, | 184 const rtc::IPAddress& ip, |
185 uint16 min_port, | 185 uint16_t min_port, |
186 uint16 max_port, | 186 uint16_t max_port, |
187 const std::string& username, | 187 const std::string& username, |
188 const std::string& password, | 188 const std::string& password, |
189 const std::string& origin, | 189 const std::string& origin, |
190 bool emit_localhost_for_anyaddress) | 190 bool emit_localhost_for_anyaddress) |
191 : Port(thread, LOCAL_PORT_TYPE, factory, network, ip, min_port, max_port, | 191 : Port(thread, |
192 username, password), | 192 LOCAL_PORT_TYPE, |
| 193 factory, |
| 194 network, |
| 195 ip, |
| 196 min_port, |
| 197 max_port, |
| 198 username, |
| 199 password), |
193 requests_(thread), | 200 requests_(thread), |
194 socket_(NULL), | 201 socket_(NULL), |
195 error_(0), | 202 error_(0), |
196 ready_(false), | 203 ready_(false), |
197 stun_keepalive_delay_(KEEPALIVE_DELAY), | 204 stun_keepalive_delay_(KEEPALIVE_DELAY), |
198 emit_localhost_for_anyaddress_(emit_localhost_for_anyaddress) { | 205 emit_localhost_for_anyaddress_(emit_localhost_for_anyaddress) { |
199 requests_.set_origin(origin); | 206 requests_.set_origin(origin); |
200 } | 207 } |
201 | 208 |
202 bool UDPPort::Init() { | 209 bool UDPPort::Init() { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 const std::vector<Candidate>& existing_candidates = Candidates(); | 470 const std::vector<Candidate>& existing_candidates = Candidates(); |
464 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); | 471 std::vector<Candidate>::const_iterator it = existing_candidates.begin(); |
465 for (; it != existing_candidates.end(); ++it) { | 472 for (; it != existing_candidates.end(); ++it) { |
466 if (it->address() == addr) | 473 if (it->address() == addr) |
467 return true; | 474 return true; |
468 } | 475 } |
469 return false; | 476 return false; |
470 } | 477 } |
471 | 478 |
472 } // namespace cricket | 479 } // namespace cricket |
OLD | NEW |