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

Side by Side Diff: net/quic/quic_connection_test.cc

Issue 461183002: Change QUIC's delayed ack timer from 100ms to 25ms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_changes_0808
Patch Set: Created 6 years, 4 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
« no previous file with comments | « no previous file | net/quic/quic_protocol.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/quic/quic_connection.h" 5 #include "net/quic/quic_connection.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "net/base/net_errors.h" 10 #include "net/base/net_errors.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 50
51 const char data1[] = "foo"; 51 const char data1[] = "foo";
52 const char data2[] = "bar"; 52 const char data2[] = "bar";
53 53
54 const bool kFin = true; 54 const bool kFin = true;
55 const bool kEntropyFlag = true; 55 const bool kEntropyFlag = true;
56 56
57 const QuicPacketEntropyHash kTestEntropyHash = 76; 57 const QuicPacketEntropyHash kTestEntropyHash = 76;
58 58
59 const int kDefaultRetransmissionTimeMs = 500; 59 const int kDefaultRetransmissionTimeMs = 500;
60 const int kMinRetransmissionTimeMs = 200;
61 60
62 class TestReceiveAlgorithm : public ReceiveAlgorithmInterface { 61 class TestReceiveAlgorithm : public ReceiveAlgorithmInterface {
63 public: 62 public:
64 explicit TestReceiveAlgorithm(QuicCongestionFeedbackFrame* feedback) 63 explicit TestReceiveAlgorithm(QuicCongestionFeedbackFrame* feedback)
65 : feedback_(feedback) { 64 : feedback_(feedback) {
66 } 65 }
67 66
68 bool GenerateCongestionFeedback( 67 bool GenerateCongestionFeedback(
69 QuicCongestionFeedbackFrame* congestion_feedback) { 68 QuicCongestionFeedbackFrame* congestion_feedback) {
70 if (feedback_ == NULL) { 69 if (feedback_ == NULL) {
(...skipping 807 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 void SetFeedback(QuicCongestionFeedbackFrame* feedback) { 877 void SetFeedback(QuicCongestionFeedbackFrame* feedback) {
879 receive_algorithm_ = new TestReceiveAlgorithm(feedback); 878 receive_algorithm_ = new TestReceiveAlgorithm(feedback);
880 connection_.SetReceiveAlgorithm(receive_algorithm_); 879 connection_.SetReceiveAlgorithm(receive_algorithm_);
881 } 880 }
882 881
883 QuicTime::Delta DefaultRetransmissionTime() { 882 QuicTime::Delta DefaultRetransmissionTime() {
884 return QuicTime::Delta::FromMilliseconds(kDefaultRetransmissionTimeMs); 883 return QuicTime::Delta::FromMilliseconds(kDefaultRetransmissionTimeMs);
885 } 884 }
886 885
887 QuicTime::Delta DefaultDelayedAckTime() { 886 QuicTime::Delta DefaultDelayedAckTime() {
888 return QuicTime::Delta::FromMilliseconds(kMinRetransmissionTimeMs/2); 887 return QuicTime::Delta::FromMilliseconds(kMaxDelayedAckTime);
ramant (doing other things) 2014/08/12 21:22:15 hi jri, Used kMaxDelayedAckTime instead of hard
Jana 2014/08/13 01:28:38 Sure, that sounds fine.
ramant (doing other things) 2014/08/14 19:59:30 Acknowledged.
889 } 888 }
890 889
891 // Initialize a frame acknowledging all packets up to largest_observed. 890 // Initialize a frame acknowledging all packets up to largest_observed.
892 const QuicAckFrame InitAckFrame(QuicPacketSequenceNumber largest_observed) { 891 const QuicAckFrame InitAckFrame(QuicPacketSequenceNumber largest_observed) {
893 QuicAckFrame frame(MakeAckFrame(largest_observed)); 892 QuicAckFrame frame(MakeAckFrame(largest_observed));
894 if (largest_observed > 0) { 893 if (largest_observed > 0) {
895 frame.entropy_hash = 894 frame.entropy_hash =
896 QuicConnectionPeer::GetSentEntropyHash(&connection_, 895 QuicConnectionPeer::GetSentEntropyHash(&connection_,
897 largest_observed); 896 largest_observed);
898 } 897 }
(...skipping 3086 matching lines...) Expand 10 before | Expand all | Expand 10 after
3985 QuicBlockedFrame blocked; 3984 QuicBlockedFrame blocked;
3986 blocked.stream_id = 3; 3985 blocked.stream_id = 3;
3987 EXPECT_CALL(visitor_, OnBlockedFrames(_)); 3986 EXPECT_CALL(visitor_, OnBlockedFrames(_));
3988 ProcessFramePacket(QuicFrame(&blocked)); 3987 ProcessFramePacket(QuicFrame(&blocked));
3989 EXPECT_TRUE(ack_alarm->IsSet()); 3988 EXPECT_TRUE(ack_alarm->IsSet());
3990 } 3989 }
3991 3990
3992 } // namespace 3991 } // namespace
3993 } // namespace test 3992 } // namespace test
3994 } // namespace net 3993 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/quic/quic_protocol.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698