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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 // Public for unit tests. | 186 // Public for unit tests. |
| 187 PortAllocatorSession* allocator_session() { | 187 PortAllocatorSession* allocator_session() { |
| 188 return allocator_sessions_.back(); | 188 return allocator_sessions_.back(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 // Public for unit tests. | 191 // Public for unit tests. |
| 192 const std::vector<RemoteCandidate>& remote_candidates() const { | 192 const std::vector<RemoteCandidate>& remote_candidates() const { |
| 193 return remote_candidates_; | 193 return remote_candidates_; |
| 194 } | 194 } |
| 195 | 195 |
| 196 // For unit tests only. | |
| 197 void set_last_sent_packet_id(int packet_id) { | |
| 198 last_sent_packet_id_ = packet_id; | |
| 199 } | |
|
Taylor Brandstetter
2016/03/30 21:17:14
Why is this necessary? Can't SendPacket be used by
honghaiz3
2016/03/30 21:48:09
Good point. I removed this and revised the tests w
| |
| 200 | |
| 196 private: | 201 private: |
| 197 rtc::Thread* thread() { return worker_thread_; } | 202 rtc::Thread* thread() { return worker_thread_; } |
| 198 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); } | 203 bool IsGettingPorts() { return allocator_session()->IsGettingPorts(); } |
| 199 | 204 |
| 200 // A transport channel is weak if the current best connection is either | 205 // A transport channel is weak if the current best connection is either |
| 201 // not receiving or not writable, or if there is no best connection at all. | 206 // not receiving or not writable, or if there is no best connection at all. |
| 202 bool weak() const; | 207 bool weak() const; |
| 203 void UpdateConnectionStates(); | 208 void UpdateConnectionStates(); |
| 204 void RequestSort(); | 209 void RequestSort(); |
| 205 void SortConnections(); | 210 void SortConnections(); |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 IceMode remote_ice_mode_; | 324 IceMode remote_ice_mode_; |
| 320 IceRole ice_role_; | 325 IceRole ice_role_; |
| 321 uint64_t tiebreaker_; | 326 uint64_t tiebreaker_; |
| 322 IceGatheringState gathering_state_; | 327 IceGatheringState gathering_state_; |
| 323 | 328 |
| 324 int check_receiving_interval_; | 329 int check_receiving_interval_; |
| 325 int64_t last_ping_sent_ms_ = 0; | 330 int64_t last_ping_sent_ms_ = 0; |
| 326 int weak_ping_interval_ = WEAK_PING_INTERVAL; | 331 int weak_ping_interval_ = WEAK_PING_INTERVAL; |
| 327 TransportChannelState state_ = TransportChannelState::STATE_INIT; | 332 TransportChannelState state_ = TransportChannelState::STATE_INIT; |
| 328 IceConfig config_; | 333 IceConfig config_; |
| 334 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. | |
| 329 | 335 |
| 330 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); | 336 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); |
| 331 }; | 337 }; |
| 332 | 338 |
| 333 } // namespace cricket | 339 } // namespace cricket |
| 334 | 340 |
| 335 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ | 341 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ |
| OLD | NEW |