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

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

Issue 1207563002: Add flakiness check if there is no received packets in a certain period. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Address comments except for naming. Created 5 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 522 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 // Prints pings_since_last_response_ into a string. 533 // Prints pings_since_last_response_ into a string.
534 void PrintPingsSinceLastResponse(std::string* pings, size_t max); 534 void PrintPingsSinceLastResponse(std::string* pings, size_t max);
535 535
536 bool reported() const { return reported_; } 536 bool reported() const { return reported_; }
537 void set_reported(bool reported) { reported_ = reported;} 537 void set_reported(bool reported) { reported_ = reported;}
538 538
539 // This flag will be set if this connection is the chosen one for media 539 // This flag will be set if this connection is the chosen one for media
540 // transmission. This connection will send STUN ping with USE-CANDIDATE 540 // transmission. This connection will send STUN ping with USE-CANDIDATE
541 // attribute. 541 // attribute.
542 sigslot::signal1<Connection*> SignalUseCandidate; 542 sigslot::signal1<Connection*> SignalUseCandidate;
543
543 // Invoked when Connection receives STUN error response with 487 code. 544 // Invoked when Connection receives STUN error response with 487 code.
544 void HandleRoleConflictFromPeer(); 545 void HandleRoleConflictFromPeer();
545 546
546 State state() const { return state_; } 547 State state() const { return state_; }
547 548
548 IceMode remote_ice_mode() const { return remote_ice_mode_; } 549 IceMode remote_ice_mode() const { return remote_ice_mode_; }
549 550
550 // Update the ICE password of the remote candidate if |ice_ufrag| matches 551 // Update the ICE password of the remote candidate if |ice_ufrag| matches
551 // the candidate's ufrag, and the candidate's passwrod has not been set. 552 // the candidate's ufrag, and the candidate's passwrod has not been set.
552 void MaybeSetRemoteIceCredentials(const std::string& ice_ufrag, 553 void MaybeSetRemoteIceCredentials(const std::string& ice_ufrag,
553 const std::string& ice_pwd); 554 const std::string& ice_pwd);
554 555
555 // If |remote_candidate_| is peer reflexive and is equivalent to 556 // If |remote_candidate_| is peer reflexive and is equivalent to
556 // |new_candidate| except the type, update |remote_candidate_| to 557 // |new_candidate| except the type, update |remote_candidate_| to
557 // |new_candidate|. 558 // |new_candidate|.
558 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate); 559 void MaybeUpdatePeerReflexiveCandidate(const Candidate& new_candidate);
559 560
561 // Returns true if there is any incoming (data/stun request/stun response)
562 // packet in the last |receiving_timeout| milliseconds.
563 bool CheckReceiving(uint32 receiving_timeout);
pthatcher1 2015/06/26 19:24:02 I think it would be better to just have a last_rec
honghaiz3 2015/08/05 23:56:56 Done.
564
560 protected: 565 protected:
561 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE }; 566 enum { MSG_DELETE = 0, MSG_FIRST_AVAILABLE };
562 567
563 // Constructs a new connection to the given remote port. 568 // Constructs a new connection to the given remote port.
564 Connection(Port* port, size_t index, const Candidate& candidate); 569 Connection(Port* port, size_t index, const Candidate& candidate);
565 570
566 // Called back when StunRequestManager has a stun packet to send 571 // Called back when StunRequestManager has a stun packet to send
567 void OnSendStunPacket(const void* data, size_t size, StunRequest* req); 572 void OnSendStunPacket(const void* data, size_t size, StunRequest* req);
568 573
569 // Callbacks from ConnectionRequest 574 // Callbacks from ConnectionRequest
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 const rtc::PacketOptions& options); 637 const rtc::PacketOptions& options);
633 virtual int GetError() { return error_; } 638 virtual int GetError() { return error_; }
634 639
635 private: 640 private:
636 int error_; 641 int error_;
637 }; 642 };
638 643
639 } // namespace cricket 644 } // namespace cricket
640 645
641 #endif // WEBRTC_P2P_BASE_PORT_H_ 646 #endif // WEBRTC_P2P_BASE_PORT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698