| OLD | NEW |
| 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/congestion_control/quic_congestion_manager.h" | 5 #include "net/quic/congestion_control/quic_congestion_manager.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 new class SendAlgorithmInterface::SentPacket(bytes, sent_time); | 55 new class SendAlgorithmInterface::SentPacket(bytes, sent_time); |
| 56 pending_packets_[sequence_number] = bytes; | 56 pending_packets_[sequence_number] = bytes; |
| 57 CleanupPacketHistory(); | 57 CleanupPacketHistory(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 // Called when a packet is timed out. | 60 // Called when a packet is timed out. |
| 61 void QuicCongestionManager::AbandoningPacket( | 61 void QuicCongestionManager::AbandoningPacket( |
| 62 QuicPacketSequenceNumber sequence_number) { | 62 QuicPacketSequenceNumber sequence_number) { |
| 63 PendingPacketsMap::iterator it = pending_packets_.find(sequence_number); | 63 PendingPacketsMap::iterator it = pending_packets_.find(sequence_number); |
| 64 if (it != pending_packets_.end()) { | 64 if (it != pending_packets_.end()) { |
| 65 // Shouldn't this report loss as well? (decrease cgst window). | |
| 66 send_algorithm_->AbandoningPacket(sequence_number, it->second); | 65 send_algorithm_->AbandoningPacket(sequence_number, it->second); |
| 67 pending_packets_.erase(it); | 66 pending_packets_.erase(it); |
| 68 } | 67 } |
| 69 } | 68 } |
| 70 | 69 |
| 71 void QuicCongestionManager::OnIncomingQuicCongestionFeedbackFrame( | 70 void QuicCongestionManager::OnIncomingQuicCongestionFeedbackFrame( |
| 72 const QuicCongestionFeedbackFrame& frame, QuicTime feedback_receive_time) { | 71 const QuicCongestionFeedbackFrame& frame, QuicTime feedback_receive_time) { |
| 73 send_algorithm_->OnIncomingQuicCongestionFeedbackFrame( | 72 send_algorithm_->OnIncomingQuicCongestionFeedbackFrame( |
| 74 frame, feedback_receive_time, packet_history_map_); | 73 frame, feedback_receive_time, packet_history_map_); |
| 75 } | 74 } |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 if (now.Subtract(history_it->second->SendTimestamp()) <= kHistoryPeriod) { | 184 if (now.Subtract(history_it->second->SendTimestamp()) <= kHistoryPeriod) { |
| 186 return; | 185 return; |
| 187 } | 186 } |
| 188 delete history_it->second; | 187 delete history_it->second; |
| 189 packet_history_map_.erase(history_it); | 188 packet_history_map_.erase(history_it); |
| 190 history_it = packet_history_map_.begin(); | 189 history_it = packet_history_map_.begin(); |
| 191 } | 190 } |
| 192 } | 191 } |
| 193 | 192 |
| 194 } // namespace net | 193 } // namespace net |
| OLD | NEW |