| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_unacked_packet_map.h" | 5 #include "net/quic/quic_unacked_packet_map.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "net/quic/quic_connection_stats.h" | 9 #include "net/quic/quic_connection_stats.h" |
| 10 #include "net/quic/quic_utils_chromium.h" | 10 #include "net/quic/quic_utils_chromium.h" |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 | 313 |
| 314 largest_sent_packet_ = max(sequence_number, largest_sent_packet_); | 314 largest_sent_packet_ = max(sequence_number, largest_sent_packet_); |
| 315 it->second.sent_time = sent_time; | 315 it->second.sent_time = sent_time; |
| 316 if (set_in_flight) { | 316 if (set_in_flight) { |
| 317 bytes_in_flight_ += bytes_sent; | 317 bytes_in_flight_ += bytes_sent; |
| 318 it->second.bytes_sent = bytes_sent; | 318 it->second.bytes_sent = bytes_sent; |
| 319 it->second.in_flight = true; | 319 it->second.in_flight = true; |
| 320 } | 320 } |
| 321 } | 321 } |
| 322 | 322 |
| 323 void QuicUnackedPacketMap::RestoreInFlight( |
| 324 QuicPacketSequenceNumber sequence_number) { |
| 325 DCHECK_LT(0u, sequence_number); |
| 326 UnackedPacketMap::iterator it = unacked_packets_.find(sequence_number); |
| 327 if (it == unacked_packets_.end()) { |
| 328 LOG(DFATAL) << "OnPacketSent called for packet that is not unacked: " |
| 329 << sequence_number; |
| 330 return; |
| 331 } |
| 332 DCHECK(!it->second.in_flight); |
| 333 DCHECK_NE(0u, it->second.bytes_sent); |
| 334 DCHECK(it->second.sent_time.IsInitialized()); |
| 335 |
| 336 bytes_in_flight_ += it->second.bytes_sent; |
| 337 it->second.in_flight = true; |
| 338 } |
| 339 |
| 323 } // namespace net | 340 } // namespace net |
| OLD | NEW |