| 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 #ifndef NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_ | 5 #ifndef NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_ |
| 6 #define NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_ | 6 #define NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 void UpdateBytesForStream(QuicStreamId stream_id, size_t bytes) { | 118 void UpdateBytesForStream(QuicStreamId stream_id, size_t bytes) { |
| 119 if (batch_write_stream_id_[last_priority_popped_] == stream_id) { | 119 if (batch_write_stream_id_[last_priority_popped_] == stream_id) { |
| 120 // If this was the last data stream popped by PopFront, update the | 120 // If this was the last data stream popped by PopFront, update the |
| 121 // bytes remaining in its batch write. | 121 // bytes remaining in its batch write. |
| 122 bytes_left_for_batch_write_[last_priority_popped_] -= | 122 bytes_left_for_batch_write_[last_priority_popped_] -= |
| 123 static_cast<int32>(bytes); | 123 static_cast<int32>(bytes); |
| 124 } else { | 124 } else { |
| 125 // If a batch write stream was set, it should only be preempted by the | 125 // If a batch write stream was set, it should only be preempted by the |
| 126 // crypto or headers streams. Any higher priority data stream would | 126 // crypto or headers streams. Any higher priority data stream would |
| 127 // *become* the new batch write stream. | 127 // *become* the new batch write stream. |
| 128 if (FLAGS_quic_respect_send_alarm && FLAGS_quic_batch_writes) { | 128 if (FLAGS_quic_respect_send_alarm2 && FLAGS_quic_batch_writes) { |
| 129 DCHECK(stream_id == kCryptoStreamId || stream_id == kHeadersStreamId || | 129 DCHECK(stream_id == kCryptoStreamId || stream_id == kHeadersStreamId || |
| 130 batch_write_stream_id_[last_priority_popped_] == 0 || | 130 batch_write_stream_id_[last_priority_popped_] == 0 || |
| 131 bytes == 0); | 131 bytes == 0); |
| 132 } | 132 } |
| 133 } | 133 } |
| 134 } | 134 } |
| 135 | 135 |
| 136 // Pushes a stream to the back of the list for this priority level | 136 // Pushes a stream to the back of the list for this priority level |
| 137 // *unless* it is latched for doing batched writes in which case it goes to | 137 // *unless* it is latched for doing batched writes in which case it goes to |
| 138 // the front of the list for this priority level. | 138 // the front of the list for this priority level. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 bool crypto_stream_blocked_; | 192 bool crypto_stream_blocked_; |
| 193 bool headers_stream_blocked_; | 193 bool headers_stream_blocked_; |
| 194 | 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(QuicWriteBlockedList); | 195 DISALLOW_COPY_AND_ASSIGN(QuicWriteBlockedList); |
| 196 }; | 196 }; |
| 197 | 197 |
| 198 } // namespace net | 198 } // namespace net |
| 199 | 199 |
| 200 | 200 |
| 201 #endif // NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_ | 201 #endif // NET_QUIC_QUIC_WRITE_BLOCKED_LIST_H_ |
| OLD | NEW |