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

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

Issue 2099563004: Start ICE connectivity checks as soon as the first pair is pingable. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Start pinging when we first have a connection AND ICE credentials. 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after
589 589
590 // If |remote_candidate_| is peer reflexive and is equivalent to 590 // If |remote_candidate_| is peer reflexive and is equivalent to
591 // |new_candidate| except the type, update |remote_candidate_| to 591 // |new_candidate| except the type, update |remote_candidate_| to
592 // |new_candidate|. 592 // |new_candidate|.
593 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate); 593 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate);
594 594
595 // Returns the last received time of any data, stun request, or stun 595 // Returns the last received time of any data, stun request, or stun
596 // response in milliseconds 596 // response in milliseconds
597 int64_t last_received() const; 597 int64_t last_received() const;
598 598
599 bool stable(int64_t now); 599 bool stable(int64_t now) const;
600 600
601 protected: 601 protected:
602 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE }; 602 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE };
603 603
604 // Constructs a new connection to the given remote port. 604 // Constructs a new connection to the given remote port.
605 Connection(Port* port, size_t index, const Candidate& candidate); 605 Connection(Port* port, size_t index, const Candidate& candidate);
606 606
607 // Called back when StunRequestManager has a stun packet to send 607 // Called back when StunRequestManager has a stun packet to send
608 void OnSendStunPacket(const void* data, size_t size, StunRequest* req); 608 void OnSendStunPacket(const void* data, size_t size, StunRequest* req);
609 609
610 // Callbacks from ConnectionRequest 610 // Callbacks from ConnectionRequest
611 virtual void OnConnectionRequestResponse(ConnectionRequest* req, 611 virtual void OnConnectionRequestResponse(ConnectionRequest* req,
612 StunMessage* response); 612 StunMessage* response);
613 void OnConnectionRequestErrorResponse(ConnectionRequest* req, 613 void OnConnectionRequestErrorResponse(ConnectionRequest* req,
614 StunMessage* response); 614 StunMessage* response);
615 void OnConnectionRequestTimeout(ConnectionRequest* req); 615 void OnConnectionRequestTimeout(ConnectionRequest* req);
616 void OnConnectionRequestSent(ConnectionRequest* req); 616 void OnConnectionRequestSent(ConnectionRequest* req);
617 617
618 bool rtt_converged(); 618 bool rtt_converged() const;
619 619
620 // If the response is not received within 2 * RTT, the response is assumed to 620 // If the response is not received within 2 * RTT, the response is assumed to
621 // be missing. 621 // be missing.
622 bool missing_responses(int64_t now); 622 bool missing_responses(int64_t now) const;
623 623
624 // Changes the state and signals if necessary. 624 // Changes the state and signals if necessary.
625 void set_write_state(WriteState value); 625 void set_write_state(WriteState value);
626 void set_receiving(bool value); 626 void set_receiving(bool value);
627 void set_state(State state); 627 void set_state(State state);
628 void set_connected(bool value); 628 void set_connected(bool value);
629 629
630 void OnMessage(rtc::Message *pmsg); 630 void OnMessage(rtc::Message *pmsg);
631 631
632 Port* port_; 632 Port* port_;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
685 const rtc::PacketOptions& options) override; 685 const rtc::PacketOptions& options) override;
686 int GetError() override { return error_; } 686 int GetError() override { return error_; }
687 687
688 private: 688 private:
689 int error_ = 0; 689 int error_ = 0;
690 }; 690 };
691 691
692 } // namespace cricket 692 } // namespace cricket
693 693
694 #endif // WEBRTC_P2P_BASE_PORT_H_ 694 #endif // WEBRTC_P2P_BASE_PORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698