OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_sent_packet_manager.h" | 5 #include "net/quic/quic_sent_packet_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 if (config.HasReceivedConnectionOptions() && | 121 if (config.HasReceivedConnectionOptions() && |
122 ContainsQuicTag(config.ReceivedConnectionOptions(), kPACE)) { | 122 ContainsQuicTag(config.ReceivedConnectionOptions(), kPACE)) { |
123 EnablePacing(); | 123 EnablePacing(); |
124 } | 124 } |
125 } else if (config.HasSendConnectionOptions() && | 125 } else if (config.HasSendConnectionOptions() && |
126 ContainsQuicTag(config.SendConnectionOptions(), kPACE)) { | 126 ContainsQuicTag(config.SendConnectionOptions(), kPACE)) { |
127 EnablePacing(); | 127 EnablePacing(); |
128 } | 128 } |
129 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once | 129 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once |
130 // the ConnectionOptions code is live everywhere. | 130 // the ConnectionOptions code is live everywhere. |
131 if ((config.HasReceivedLossDetection() && | 131 if (config.HasReceivedConnectionOptions() && |
132 config.ReceivedLossDetection() == kTIME) || | 132 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) { |
133 (config.HasReceivedConnectionOptions() && | |
134 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME))) { | |
135 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); | 133 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); |
136 } | 134 } |
137 send_algorithm_->SetFromConfig(config, is_server_); | 135 send_algorithm_->SetFromConfig(config, is_server_); |
138 | 136 |
139 if (network_change_visitor_ != NULL) { | 137 if (network_change_visitor_ != NULL) { |
140 network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow()); | 138 network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow()); |
141 } | 139 } |
142 } | 140 } |
143 | 141 |
144 // TODO(ianswett): Combine this method with OnPacketSent once packets are always | 142 // TODO(ianswett): Combine this method with OnPacketSent once packets are always |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
887 | 885 |
888 // Set up a pacing sender with a 5 millisecond alarm granularity. | 886 // Set up a pacing sender with a 5 millisecond alarm granularity. |
889 using_pacing_ = true; | 887 using_pacing_ = true; |
890 send_algorithm_.reset( | 888 send_algorithm_.reset( |
891 new PacingSender(send_algorithm_.release(), | 889 new PacingSender(send_algorithm_.release(), |
892 QuicTime::Delta::FromMilliseconds(5), | 890 QuicTime::Delta::FromMilliseconds(5), |
893 kInitialUnpacedBurst)); | 891 kInitialUnpacedBurst)); |
894 } | 892 } |
895 | 893 |
896 } // namespace net | 894 } // namespace net |
OLD | NEW |