| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/stream_sequencer_buffer.h" | 5 #include "net/quic/stream_sequencer_buffer.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/quic/quic_bug_tracker.h" | 8 #include "net/quic/quic_bug_tracker.h" |
| 9 | 9 |
| 10 using std::min; | 10 using std::min; |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 } else if (gap_with_new_data_written->begin_offset < start_offset && | 159 } else if (gap_with_new_data_written->begin_offset < start_offset && |
| 160 gap_with_new_data_written->end_offset == | 160 gap_with_new_data_written->end_offset == |
| 161 start_offset + bytes_written) { | 161 start_offset + bytes_written) { |
| 162 // New data has been written into the right part of the buffer. | 162 // New data has been written into the right part of the buffer. |
| 163 gap_with_new_data_written->end_offset = start_offset; | 163 gap_with_new_data_written->end_offset = start_offset; |
| 164 } else if (gap_with_new_data_written->begin_offset < start_offset && | 164 } else if (gap_with_new_data_written->begin_offset < start_offset && |
| 165 gap_with_new_data_written->end_offset > | 165 gap_with_new_data_written->end_offset > |
| 166 start_offset + bytes_written) { | 166 start_offset + bytes_written) { |
| 167 // New data has been written into the middle of the buffer. | 167 // New data has been written into the middle of the buffer. |
| 168 auto current = gap_with_new_data_written++; | 168 auto current = gap_with_new_data_written++; |
| 169 size_t current_end = current->end_offset; | 169 QuicStreamOffset current_end = current->end_offset; |
| 170 current->end_offset = start_offset; | 170 current->end_offset = start_offset; |
| 171 gaps_.insert(gap_with_new_data_written, | 171 gaps_.insert(gap_with_new_data_written, |
| 172 Gap(start_offset + bytes_written, current_end)); | 172 Gap(start_offset + bytes_written, current_end)); |
| 173 } else if (gap_with_new_data_written->begin_offset == start_offset && | 173 } else if (gap_with_new_data_written->begin_offset == start_offset && |
| 174 gap_with_new_data_written->end_offset == | 174 gap_with_new_data_written->end_offset == |
| 175 start_offset + bytes_written) { | 175 start_offset + bytes_written) { |
| 176 // This gap has been filled with new data. So it's no longer a gap. | 176 // This gap has been filled with new data. So it's no longer a gap. |
| 177 gaps_.erase(gap_with_new_data_written); | 177 gaps_.erase(gap_with_new_data_written); |
| 178 } | 178 } |
| 179 } | 179 } |
| (...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 offset, FrameInfo(erased.first + erased.second.length - offset, | 444 offset, FrameInfo(erased.first + erased.second.length - offset, |
| 445 erased.second.timestamp)); | 445 erased.second.timestamp)); |
| 446 DVLOG(1) << "Inserted FrameInfo with offset: " << updated.first | 446 DVLOG(1) << "Inserted FrameInfo with offset: " << updated.first |
| 447 << " and length: " << updated.second.length; | 447 << " and length: " << updated.second.length; |
| 448 frame_arrival_time_map_.insert(updated); | 448 frame_arrival_time_map_.insert(updated); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 } | 451 } |
| 452 | 452 |
| 453 } // namespace net | 453 } // namespace net |
| OLD | NEW |