| 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_protocol.h" | 5 #include "net/quic/quic_protocol.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "net/quic/quic_utils.h" | 8 #include "net/quic/quic_utils.h" |
| 9 | 9 |
| 10 using base::StringPiece; | 10 using base::StringPiece; |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 QuicPublicResetPacket::QuicPublicResetPacket() | 94 QuicPublicResetPacket::QuicPublicResetPacket() |
| 95 : nonce_proof(0), | 95 : nonce_proof(0), |
| 96 rejected_sequence_number(0) {} | 96 rejected_sequence_number(0) {} |
| 97 | 97 |
| 98 QuicPublicResetPacket::QuicPublicResetPacket( | 98 QuicPublicResetPacket::QuicPublicResetPacket( |
| 99 const QuicPacketPublicHeader& header) | 99 const QuicPacketPublicHeader& header) |
| 100 : public_header(header), | 100 : public_header(header), |
| 101 nonce_proof(0), | 101 nonce_proof(0), |
| 102 rejected_sequence_number(0) {} | 102 rejected_sequence_number(0) {} |
| 103 | 103 |
| 104 QuicStreamFrame::QuicStreamFrame() | 104 QuicStreamFrame::QuicStreamFrame() : stream_id(0), fin(false), offset(0) { |
| 105 : stream_id(0), | 105 } |
| 106 fin(false), | |
| 107 offset(0), | |
| 108 notifier(nullptr) {} | |
| 109 | 106 |
| 110 QuicStreamFrame::QuicStreamFrame(const QuicStreamFrame& frame) | 107 QuicStreamFrame::QuicStreamFrame(const QuicStreamFrame& frame) |
| 111 : stream_id(frame.stream_id), | 108 : stream_id(frame.stream_id), |
| 112 fin(frame.fin), | 109 fin(frame.fin), |
| 113 offset(frame.offset), | 110 offset(frame.offset), |
| 114 data(frame.data), | 111 data(frame.data) { |
| 115 notifier(frame.notifier) { | |
| 116 } | 112 } |
| 117 | 113 |
| 118 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, | 114 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, |
| 119 bool fin, | 115 bool fin, |
| 120 QuicStreamOffset offset, | 116 QuicStreamOffset offset, |
| 121 IOVector data) | 117 IOVector data) |
| 122 : stream_id(stream_id), | 118 : stream_id(stream_id), fin(fin), offset(offset), data(data) { |
| 123 fin(fin), | 119 } |
| 124 offset(offset), | |
| 125 data(data), | |
| 126 notifier(nullptr) {} | |
| 127 | 120 |
| 128 string* QuicStreamFrame::GetDataAsString() const { | 121 string* QuicStreamFrame::GetDataAsString() const { |
| 129 string* data_string = new string(); | 122 string* data_string = new string(); |
| 130 data_string->reserve(data.TotalBufferSize()); | 123 data_string->reserve(data.TotalBufferSize()); |
| 131 for (size_t i = 0; i < data.Size(); ++i) { | 124 for (size_t i = 0; i < data.Size(); ++i) { |
| 132 data_string->append(static_cast<char*>(data.iovec()[i].iov_base), | 125 data_string->append(static_cast<char*>(data.iovec()[i].iov_base), |
| 133 data.iovec()[i].iov_len); | 126 data.iovec()[i].iov_len); |
| 134 } | 127 } |
| 135 DCHECK_EQ(data_string->size(), data.TotalBufferSize()); | 128 DCHECK_EQ(data_string->size(), data.TotalBufferSize()); |
| 136 return data_string; | 129 return data_string; |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 sent_time(sent_time), | 664 sent_time(sent_time), |
| 672 bytes_sent(0), | 665 bytes_sent(0), |
| 673 nack_count(0), | 666 nack_count(0), |
| 674 transmission_type(transmission_type), | 667 transmission_type(transmission_type), |
| 675 all_transmissions(nullptr), | 668 all_transmissions(nullptr), |
| 676 in_flight(false), | 669 in_flight(false), |
| 677 is_unackable(false), | 670 is_unackable(false), |
| 678 is_fec_packet(false) {} | 671 is_fec_packet(false) {} |
| 679 | 672 |
| 680 } // namespace net | 673 } // namespace net |
| OLD | NEW |