Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: webrtc/p2p/base/p2ptransportchannel.h

Issue 2025573002: Use continual gathering to restore backup connections (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: . Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 void RememberRemoteCandidate(const Candidate& remote_candidate, 227 void RememberRemoteCandidate(const Candidate& remote_candidate,
228 PortInterface* origin_port); 228 PortInterface* origin_port);
229 bool IsPingable(Connection* conn, int64_t now); 229 bool IsPingable(Connection* conn, int64_t now);
230 void PingConnection(Connection* conn); 230 void PingConnection(Connection* conn);
231 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session); 231 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session);
232 void AddConnection(Connection* connection); 232 void AddConnection(Connection* connection);
233 233
234 void OnPortReady(PortAllocatorSession *session, PortInterface* port); 234 void OnPortReady(PortAllocatorSession *session, PortInterface* port);
235 void OnCandidatesReady(PortAllocatorSession *session, 235 void OnCandidatesReady(PortAllocatorSession *session,
236 const std::vector<Candidate>& candidates); 236 const std::vector<Candidate>& candidates);
237 void OnCandidatesRemoved(PortAllocatorSession* session,
238 const std::vector<Candidate>& candidates);
237 void OnCandidatesAllocationDone(PortAllocatorSession* session); 239 void OnCandidatesAllocationDone(PortAllocatorSession* session);
238 void OnUnknownAddress(PortInterface* port, 240 void OnUnknownAddress(PortInterface* port,
239 const rtc::SocketAddress& addr, 241 const rtc::SocketAddress& addr,
240 ProtocolType proto, 242 ProtocolType proto,
241 IceMessage* stun_msg, 243 IceMessage* stun_msg,
242 const std::string& remote_username, 244 const std::string& remote_username,
243 bool port_muxed); 245 bool port_muxed);
246
247 // When a port is destroyed or closed, remove it from our list of ports to
248 // use for connection attempts.
244 void OnPortDestroyed(PortInterface* port); 249 void OnPortDestroyed(PortInterface* port);
245 void OnPortNetworkInactive(PortInterface* port); 250 void OnPortClosed(PortInterface* port);
251 bool RemovePort(PortInterface* port);
246 void OnRoleConflict(PortInterface* port); 252 void OnRoleConflict(PortInterface* port);
247 253
248 void OnConnectionStateChange(Connection* connection); 254 void OnConnectionStateChange(Connection* connection);
249 void OnReadPacket(Connection *connection, const char *data, size_t len, 255 void OnReadPacket(Connection *connection, const char *data, size_t len,
250 const rtc::PacketTime& packet_time); 256 const rtc::PacketTime& packet_time);
251 void OnSentPacket(const rtc::SentPacket& sent_packet); 257 void OnSentPacket(const rtc::SentPacket& sent_packet);
252 void OnReadyToSend(Connection* connection); 258 void OnReadyToSend(Connection* connection);
253 void OnConnectionDestroyed(Connection *connection); 259 void OnConnectionDestroyed(Connection *connection);
254 260
255 void OnNominated(Connection* conn); 261 void OnNominated(Connection* conn);
256 262
257 void OnMessage(rtc::Message* pmsg) override; 263 void OnMessage(rtc::Message* pmsg) override;
258 void OnSort(); 264 void OnSort();
259 void OnCheckAndPing(); 265 void OnCheckAndPing();
266 void OnRegatherOnFailedNetworks();
260 267
261 void PruneConnections(); 268 void PruneConnections();
262 Connection* best_nominated_connection() const; 269 Connection* best_nominated_connection() const;
263 bool IsBackupConnection(Connection* conn) const; 270 bool IsBackupConnection(Connection* conn) const;
264 271
265 Connection* FindConnectionToPing(int64_t now); 272 Connection* FindConnectionToPing(int64_t now);
266 Connection* FindOldestConnectionNeedingTriggeredCheck(int64_t now); 273 Connection* FindOldestConnectionNeedingTriggeredCheck(int64_t now);
267 // Between |conn1| and |conn2|, this function returns the one which should 274 // Between |conn1| and |conn2|, this function returns the one which should
268 // be pinged first. 275 // be pinged first.
269 Connection* SelectMostPingableConnection(Connection* conn1, 276 Connection* SelectMostPingableConnection(Connection* conn1,
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 IceRole ice_role_; 332 IceRole ice_role_;
326 uint64_t tiebreaker_; 333 uint64_t tiebreaker_;
327 IceGatheringState gathering_state_; 334 IceGatheringState gathering_state_;
328 335
329 int check_receiving_interval_; 336 int check_receiving_interval_;
330 int64_t last_ping_sent_ms_ = 0; 337 int64_t last_ping_sent_ms_ = 0;
331 int weak_ping_interval_ = WEAK_PING_INTERVAL; 338 int weak_ping_interval_ = WEAK_PING_INTERVAL;
332 TransportChannelState state_ = TransportChannelState::STATE_INIT; 339 TransportChannelState state_ = TransportChannelState::STATE_INIT;
333 IceConfig config_; 340 IceConfig config_;
334 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. 341 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before.
342 std::vector<Candidate> candidates_to_remove_;
335 343
336 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); 344 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
337 }; 345 };
338 346
339 } // namespace cricket 347 } // namespace cricket
340 348
341 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ 349 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698