| 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 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 119 } |
| 120 if (is_server_) { | 120 if (is_server_) { |
| 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 if (is_server_) { |
| 130 if (config.HasReceivedConnectionOptions() && |
| 131 ContainsQuicTag(config.ReceivedConnectionOptions(), k1CON)) { |
| 132 send_algorithm_->SetNumEmulatedConnections(1); |
| 133 } |
| 134 } else if (config.HasSendConnectionOptions() && |
| 135 ContainsQuicTag(config.SendConnectionOptions(), k1CON)) { |
| 136 send_algorithm_->SetNumEmulatedConnections(1); |
| 137 } |
| 129 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once | 138 // TODO(ianswett): Remove the "HasReceivedLossDetection" branch once |
| 130 // the ConnectionOptions code is live everywhere. | 139 // the ConnectionOptions code is live everywhere. |
| 131 if (config.HasReceivedConnectionOptions() && | 140 if (config.HasReceivedConnectionOptions() && |
| 132 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) { | 141 ContainsQuicTag(config.ReceivedConnectionOptions(), kTIME)) { |
| 133 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); | 142 loss_algorithm_.reset(LossDetectionInterface::Create(kTime)); |
| 134 } | 143 } |
| 135 send_algorithm_->SetFromConfig(config, is_server_); | 144 send_algorithm_->SetFromConfig(config, is_server_); |
| 136 | 145 |
| 137 if (network_change_visitor_ != NULL) { | 146 if (network_change_visitor_ != NULL) { |
| 138 network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow()); | 147 network_change_visitor_->OnCongestionWindowChange(GetCongestionWindow()); |
| (...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 869 | 878 |
| 870 // Set up a pacing sender with a 5 millisecond alarm granularity. | 879 // Set up a pacing sender with a 5 millisecond alarm granularity. |
| 871 using_pacing_ = true; | 880 using_pacing_ = true; |
| 872 send_algorithm_.reset( | 881 send_algorithm_.reset( |
| 873 new PacingSender(send_algorithm_.release(), | 882 new PacingSender(send_algorithm_.release(), |
| 874 QuicTime::Delta::FromMilliseconds(5), | 883 QuicTime::Delta::FromMilliseconds(5), |
| 875 kInitialUnpacedBurst)); | 884 kInitialUnpacedBurst)); |
| 876 } | 885 } |
| 877 | 886 |
| 878 } // namespace net | 887 } // namespace net |
| OLD | NEW |