| 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_ack_notifier_manager.h" | 5 #include "net/quic/quic_ack_notifier_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <list> | 8 #include <list> |
| 9 #include <map> | 9 #include <map> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 79 |
| 80 RetransmittableFrames* frames = serialized_packet.retransmittable_frames; | 80 RetransmittableFrames* frames = serialized_packet.retransmittable_frames; |
| 81 | 81 |
| 82 // AckNotifiers can only be attached to retransmittable frames. | 82 // AckNotifiers can only be attached to retransmittable frames. |
| 83 if (!frames) { | 83 if (!frames) { |
| 84 return; | 84 return; |
| 85 } | 85 } |
| 86 | 86 |
| 87 for (QuicFrames::const_iterator it = frames->frames().begin(); | 87 for (QuicFrames::const_iterator it = frames->frames().begin(); |
| 88 it != frames->frames().end(); ++it) { | 88 it != frames->frames().end(); ++it) { |
| 89 if (it->type == STREAM_FRAME && it->stream_frame->notifier != NULL) { | 89 if (it->type == STREAM_FRAME && it->stream_frame->notifier != nullptr) { |
| 90 QuicAckNotifier* notifier = it->stream_frame->notifier; | 90 QuicAckNotifier* notifier = it->stream_frame->notifier; |
| 91 | 91 |
| 92 // The AckNotifier needs to know it is tracking this packet's sequence | 92 // The AckNotifier needs to know it is tracking this packet's sequence |
| 93 // number. | 93 // number. |
| 94 notifier->AddSequenceNumber(serialized_packet.sequence_number, | 94 notifier->AddSequenceNumber(serialized_packet.sequence_number, |
| 95 serialized_packet.packet->length()); | 95 serialized_packet.packet->length()); |
| 96 | 96 |
| 97 // Update the mapping in the other direction, from sequence | 97 // Update the mapping in the other direction, from sequence |
| 98 // number to AckNotifier. | 98 // number to AckNotifier. |
| 99 ack_notifier_map_[serialized_packet.sequence_number].insert(notifier); | 99 ack_notifier_map_[serialized_packet.sequence_number].insert(notifier); |
| 100 | 100 |
| 101 // Take ownership of the AckNotifier. | 101 // Take ownership of the AckNotifier. |
| 102 ack_notifiers_.insert(notifier); | 102 ack_notifiers_.insert(notifier); |
| 103 } | 103 } |
| 104 } | 104 } |
| 105 } | 105 } |
| 106 | 106 |
| 107 } // namespace net | 107 } // namespace net |
| OLD | NEW |