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

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: Merge branch 'master' into enhanced_cg Created 4 years, 5 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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 void RememberRemoteCandidate(const Candidate& remote_candidate, 253 void RememberRemoteCandidate(const Candidate& remote_candidate,
254 PortInterface* origin_port); 254 PortInterface* origin_port);
255 bool IsPingable(Connection* conn, int64_t now); 255 bool IsPingable(Connection* conn, int64_t now);
256 bool IsSelectedConnectionPingable(int64_t now); 256 bool IsSelectedConnectionPingable(int64_t now);
257 int CalculateActiveWritablePingInterval(Connection* conn, int64_t now); 257 int CalculateActiveWritablePingInterval(Connection* conn, int64_t now);
258 void PingConnection(Connection* conn); 258 void PingConnection(Connection* conn);
259 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session); 259 void AddAllocatorSession(std::unique_ptr<PortAllocatorSession> session);
260 void AddConnection(Connection* connection); 260 void AddConnection(Connection* connection);
261 261
262 void OnPortReady(PortAllocatorSession *session, PortInterface* port); 262 void OnPortReady(PortAllocatorSession *session, PortInterface* port);
263 void OnPortsRemoved(PortAllocatorSession* session,
264 const std::vector<PortInterface*>& ports);
263 void OnCandidatesReady(PortAllocatorSession *session, 265 void OnCandidatesReady(PortAllocatorSession *session,
264 const std::vector<Candidate>& candidates); 266 const std::vector<Candidate>& candidates);
267 void OnCandidatesRemoved(PortAllocatorSession* session,
268 const std::vector<Candidate>& candidates);
265 void OnCandidatesAllocationDone(PortAllocatorSession* session); 269 void OnCandidatesAllocationDone(PortAllocatorSession* session);
266 void OnUnknownAddress(PortInterface* port, 270 void OnUnknownAddress(PortInterface* port,
267 const rtc::SocketAddress& addr, 271 const rtc::SocketAddress& addr,
268 ProtocolType proto, 272 ProtocolType proto,
269 IceMessage* stun_msg, 273 IceMessage* stun_msg,
270 const std::string& remote_username, 274 const std::string& remote_username,
271 bool port_muxed); 275 bool port_muxed);
276
277 // When a port is destroyed, remove it from both lists |ports_|
278 // and |removed_ports_|.
272 void OnPortDestroyed(PortInterface* port); 279 void OnPortDestroyed(PortInterface* port);
273 void OnPortNetworkInactive(PortInterface* port); 280 // When removing a port, move it from |ports_| to |removed_ports_|.
281 bool RemovePort(PortInterface* port);
274 void OnRoleConflict(PortInterface* port); 282 void OnRoleConflict(PortInterface* port);
275 283
276 void OnConnectionStateChange(Connection* connection); 284 void OnConnectionStateChange(Connection* connection);
277 void OnReadPacket(Connection *connection, const char *data, size_t len, 285 void OnReadPacket(Connection *connection, const char *data, size_t len,
278 const rtc::PacketTime& packet_time); 286 const rtc::PacketTime& packet_time);
279 void OnSentPacket(const rtc::SentPacket& sent_packet); 287 void OnSentPacket(const rtc::SentPacket& sent_packet);
280 void OnReadyToSend(Connection* connection); 288 void OnReadyToSend(Connection* connection);
281 void OnConnectionDestroyed(Connection *connection); 289 void OnConnectionDestroyed(Connection *connection);
282 290
283 void OnNominated(Connection* conn); 291 void OnNominated(Connection* conn);
284 292
285 void OnMessage(rtc::Message* pmsg) override; 293 void OnMessage(rtc::Message* pmsg) override;
286 void OnSort(); 294 void OnSort();
287 void OnCheckAndPing(); 295 void OnCheckAndPing();
296 void OnRegatherOnFailedNetworks();
288 297
289 // Returns true if the new_connection should be selected for transmission. 298 // Returns true if the new_connection should be selected for transmission.
290 bool ShouldSwitchSelectedConnection(Connection* new_connection) const; 299 bool ShouldSwitchSelectedConnection(Connection* new_connection) const;
291 300
292 void PruneConnections(); 301 void PruneConnections();
293 bool IsBackupConnection(Connection* conn) const; 302 bool IsBackupConnection(Connection* conn) const;
294 303
295 Connection* FindConnectionToPing(int64_t now); 304 Connection* FindConnectionToPing(int64_t now);
296 Connection* FindOldestConnectionNeedingTriggeredCheck(int64_t now); 305 Connection* FindOldestConnectionNeedingTriggeredCheck(int64_t now);
297 // Between |conn1| and |conn2|, this function returns the one which should 306 // Between |conn1| and |conn2|, this function returns the one which should
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 TransportChannelState state_ = TransportChannelState::STATE_INIT; 375 TransportChannelState state_ = TransportChannelState::STATE_INIT;
367 IceConfig config_; 376 IceConfig config_;
368 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before. 377 int last_sent_packet_id_ = -1; // -1 indicates no packet was sent before.
369 378
370 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel); 379 RTC_DISALLOW_COPY_AND_ASSIGN(P2PTransportChannel);
371 }; 380 };
372 381
373 } // namespace cricket 382 } // namespace cricket
374 383
375 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_ 384 #endif // WEBRTC_P2P_BASE_P2PTRANSPORTCHANNEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698