| 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/quic_packet_generator.h" | 5 #include "net/quic/quic_packet_generator.h" |
| 6 | 6 |
| 7 #include "base/basictypes.h" | 7 #include "base/basictypes.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "net/quic/quic_ack_notifier.h" | 9 #include "net/quic/quic_ack_notifier.h" |
| 10 #include "net/quic/quic_fec_group.h" | 10 #include "net/quic/quic_fec_group.h" |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA, | 170 NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA, |
| 171 has_handshake ? IS_HANDSHAKE : NOT_HANDSHAKE)) { | 171 has_handshake ? IS_HANDSHAKE : NOT_HANDSHAKE)) { |
| 172 QuicFrame frame; | 172 QuicFrame frame; |
| 173 size_t bytes_consumed = packet_creator_.CreateStreamFrame( | 173 size_t bytes_consumed = packet_creator_.CreateStreamFrame( |
| 174 id, data, offset + total_bytes_consumed, fin, &frame); | 174 id, data, offset + total_bytes_consumed, fin, &frame); |
| 175 ++frames_created; | 175 ++frames_created; |
| 176 | 176 |
| 177 // We want to track which packet this stream frame ends up in. | 177 // We want to track which packet this stream frame ends up in. |
| 178 if (FLAGS_quic_attach_ack_notifiers_to_packets) { | 178 if (FLAGS_quic_attach_ack_notifiers_to_packets) { |
| 179 if (notifier != nullptr) { | 179 if (notifier != nullptr) { |
| 180 ack_notifiers_.insert(notifier); | 180 ack_notifiers_.push_back(notifier); |
| 181 } | 181 } |
| 182 } else { | 182 } else { |
| 183 frame.stream_frame->notifier = notifier; | 183 frame.stream_frame->notifier = notifier; |
| 184 } | 184 } |
| 185 | 185 |
| 186 if (!AddFrame(frame)) { | 186 if (!AddFrame(frame)) { |
| 187 LOG(DFATAL) << "Failed to add stream frame."; | 187 LOG(DFATAL) << "Failed to add stream frame."; |
| 188 // Inability to add a STREAM frame creates an unrecoverable hole in a | 188 // Inability to add a STREAM frame creates an unrecoverable hole in a |
| 189 // the stream, so it's best to close the connection. | 189 // the stream, so it's best to close the connection. |
| 190 delegate_->CloseConnection(QUIC_INTERNAL_ERROR, false); | 190 delegate_->CloseConnection(QUIC_INTERNAL_ERROR, false); |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 packet_creator_.set_connection_id_length(PACKET_8BYTE_CONNECTION_ID); | 459 packet_creator_.set_connection_id_length(PACKET_8BYTE_CONNECTION_ID); |
| 460 } | 460 } |
| 461 } | 461 } |
| 462 | 462 |
| 463 | 463 |
| 464 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) { | 464 void QuicPacketGenerator::set_encryption_level(EncryptionLevel level) { |
| 465 packet_creator_.set_encryption_level(level); | 465 packet_creator_.set_encryption_level(level); |
| 466 } | 466 } |
| 467 | 467 |
| 468 } // namespace net | 468 } // namespace net |
| OLD | NEW |