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

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

Issue 2069493002: Do not switch best connection on the controlled side too frequently (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Using a_is_better and b_is_better to replace 1 and -1 for connection comparision 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 void set_component(int component) { component_ = component; } 171 void set_component(int component) { component_ = component; }
172 172
173 bool send_retransmit_count_attribute() const { 173 bool send_retransmit_count_attribute() const {
174 return send_retransmit_count_attribute_; 174 return send_retransmit_count_attribute_;
175 } 175 }
176 void set_send_retransmit_count_attribute(bool enable) { 176 void set_send_retransmit_count_attribute(bool enable) {
177 send_retransmit_count_attribute_ = enable; 177 send_retransmit_count_attribute_ = enable;
178 } 178 }
179 179
180 // Identifies the generation that this port was created in. 180 // Identifies the generation that this port was created in.
181 uint32_t generation() { return generation_; } 181 uint32_t generation() const { return generation_; }
182 void set_generation(uint32_t generation) { generation_ = generation; } 182 void set_generation(uint32_t generation) { generation_ = generation; }
183 183
184 const std::string username_fragment() const; 184 const std::string username_fragment() const;
185 const std::string& password() const { return password_; } 185 const std::string& password() const { return password_; }
186 186
187 // May be called when this port was initially created by a pooled 187 // May be called when this port was initially created by a pooled
188 // PortAllocatorSession, and is now being assigned to an ICE transport. 188 // PortAllocatorSession, and is now being assigned to an ICE transport.
189 // Updates the information for candidates as well. 189 // Updates the information for candidates as well.
190 void SetIceParameters(int component, 190 void SetIceParameters(int component,
191 const std::string& username_fragment, 191 const std::string& username_fragment,
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return last_ping_response_received_; 535 return last_ping_response_received_;
536 } 536 }
537 537
538 // Called whenever a valid ping is received on this connection. This is 538 // Called whenever a valid ping is received on this connection. This is
539 // public because the connection intercepts the first ping for us. 539 // public because the connection intercepts the first ping for us.
540 int64_t last_ping_received() const { return last_ping_received_; } 540 int64_t last_ping_received() const { return last_ping_received_; }
541 void ReceivedPing(); 541 void ReceivedPing();
542 // Handles the binding request; sends a response if this is a valid request. 542 // Handles the binding request; sends a response if this is a valid request.
543 void HandleBindingRequest(IceMessage* msg); 543 void HandleBindingRequest(IceMessage* msg);
544 544
545 int64_t last_data_received() const { return last_data_received_; }
546
545 // Debugging description of this connection 547 // Debugging description of this connection
546 std::string ToDebugId() const; 548 std::string ToDebugId() const;
547 std::string ToString() const; 549 std::string ToString() const;
548 std::string ToSensitiveString() const; 550 std::string ToSensitiveString() const;
549 // Prints pings_since_last_response_ into a string. 551 // Prints pings_since_last_response_ into a string.
550 void PrintPingsSinceLastResponse(std::string* pings, size_t max); 552 void PrintPingsSinceLastResponse(std::string* pings, size_t max);
551 553
552 bool reported() const { return reported_; } 554 bool reported() const { return reported_; }
553 void set_reported(bool reported) { reported_ = reported;} 555 void set_reported(bool reported) { reported_ = reported;}
554 556
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
674 const rtc::PacketOptions& options) override; 676 const rtc::PacketOptions& options) override;
675 int GetError() override { return error_; } 677 int GetError() override { return error_; }
676 678
677 private: 679 private:
678 int error_ = 0; 680 int error_ = 0;
679 }; 681 };
680 682
681 } // namespace cricket 683 } // namespace cricket
682 684
683 #endif // WEBRTC_P2P_BASE_PORT_H_ 685 #endif // WEBRTC_P2P_BASE_PORT_H_
OLDNEW
« webrtc/p2p/base/p2ptransportchannel.cc ('K') | « webrtc/p2p/base/p2ptransportchannel_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698