Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Side by Side Diff: net/quic/quic_protocol.cc

Issue 1979743002: Rename the QUIC stream frame fields frame_buffer and frame_length to data_buffer and data_length be… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@121700577
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "net/quic/quic_flags.h" 9 #include "net/quic/quic_flags.h"
10 #include "net/quic/quic_utils.h" 10 #include "net/quic/quic_utils.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 : QuicStreamFrame(stream_id, 126 : QuicStreamFrame(stream_id,
127 fin, 127 fin,
128 offset, 128 offset,
129 data.data(), 129 data.data(),
130 data.length(), 130 data.length(),
131 nullptr) {} 131 nullptr) {}
132 132
133 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, 133 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id,
134 bool fin, 134 bool fin,
135 QuicStreamOffset offset, 135 QuicStreamOffset offset,
136 QuicPacketLength frame_length, 136 QuicPacketLength data_length,
137 UniqueStreamBuffer buffer) 137 UniqueStreamBuffer buffer)
138 : QuicStreamFrame(stream_id, 138 : QuicStreamFrame(stream_id,
139 fin, 139 fin,
140 offset, 140 offset,
141 nullptr, 141 nullptr,
142 frame_length, 142 data_length,
143 std::move(buffer)) { 143 std::move(buffer)) {
144 DCHECK(this->buffer != nullptr); 144 DCHECK(this->buffer != nullptr);
145 DCHECK_EQ(frame_buffer, this->buffer.get()); 145 DCHECK_EQ(data_buffer, this->buffer.get());
146 } 146 }
147 147
148 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id, 148 QuicStreamFrame::QuicStreamFrame(QuicStreamId stream_id,
149 bool fin, 149 bool fin,
150 QuicStreamOffset offset, 150 QuicStreamOffset offset,
151 const char* frame_buffer, 151 const char* data_buffer,
152 QuicPacketLength frame_length, 152 QuicPacketLength data_length,
153 UniqueStreamBuffer buffer) 153 UniqueStreamBuffer buffer)
154 : stream_id(stream_id), 154 : stream_id(stream_id),
155 fin(fin), 155 fin(fin),
156 frame_length(frame_length), 156 data_length(data_length),
157 frame_buffer(frame_buffer), 157 data_buffer(data_buffer),
158 offset(offset), 158 offset(offset),
159 buffer(std::move(buffer)) { 159 buffer(std::move(buffer)) {
160 if (this->buffer != nullptr) { 160 if (this->buffer != nullptr) {
161 DCHECK(frame_buffer == nullptr); 161 DCHECK(data_buffer == nullptr);
162 this->frame_buffer = this->buffer.get(); 162 this->data_buffer = this->buffer.get();
163 } 163 }
164 } 164 }
165 165
166 QuicStreamFrame::~QuicStreamFrame() {} 166 QuicStreamFrame::~QuicStreamFrame() {}
167 167
168 uint32_t MakeQuicTag(char a, char b, char c, char d) { 168 uint32_t MakeQuicTag(char a, char b, char c, char d) {
169 return static_cast<uint32_t>(a) | static_cast<uint32_t>(b) << 8 | 169 return static_cast<uint32_t>(a) | static_cast<uint32_t>(b) << 8 |
170 static_cast<uint32_t>(c) << 16 | static_cast<uint32_t>(d) << 24; 170 static_cast<uint32_t>(c) << 16 | static_cast<uint32_t>(d) << 24;
171 } 171 }
172 172
(...skipping 494 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 ostream& operator<<(ostream& os, const QuicPathCloseFrame& path_close_frame) { 668 ostream& operator<<(ostream& os, const QuicPathCloseFrame& path_close_frame) {
669 os << "path_id { " << path_close_frame.path_id << " }\n"; 669 os << "path_id { " << path_close_frame.path_id << " }\n";
670 return os; 670 return os;
671 } 671 }
672 672
673 ostream& operator<<(ostream& os, const QuicStreamFrame& stream_frame) { 673 ostream& operator<<(ostream& os, const QuicStreamFrame& stream_frame) {
674 os << "stream_id { " << stream_frame.stream_id << " } " 674 os << "stream_id { " << stream_frame.stream_id << " } "
675 << "fin { " << stream_frame.fin << " } " 675 << "fin { " << stream_frame.fin << " } "
676 << "offset { " << stream_frame.offset << " } " 676 << "offset { " << stream_frame.offset << " } "
677 << "length { " << stream_frame.frame_length << " }\n"; 677 << "length { " << stream_frame.data_length << " }\n";
678 return os; 678 return os;
679 } 679 }
680 680
681 QuicGoAwayFrame::QuicGoAwayFrame() 681 QuicGoAwayFrame::QuicGoAwayFrame()
682 : error_code(QUIC_NO_ERROR), last_good_stream_id(0) {} 682 : error_code(QUIC_NO_ERROR), last_good_stream_id(0) {}
683 683
684 QuicGoAwayFrame::QuicGoAwayFrame(QuicErrorCode error_code, 684 QuicGoAwayFrame::QuicGoAwayFrame(QuicErrorCode error_code,
685 QuicStreamId last_good_stream_id, 685 QuicStreamId last_good_stream_id,
686 const string& reason) 686 const string& reason)
687 : error_code(error_code), 687 : error_code(error_code),
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 is_unackable(false), 851 is_unackable(false),
852 has_crypto_handshake(has_crypto_handshake), 852 has_crypto_handshake(has_crypto_handshake),
853 num_padding_bytes(num_padding_bytes), 853 num_padding_bytes(num_padding_bytes),
854 retransmission(0) {} 854 retransmission(0) {}
855 855
856 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default; 856 TransmissionInfo::TransmissionInfo(const TransmissionInfo& other) = default;
857 857
858 TransmissionInfo::~TransmissionInfo() {} 858 TransmissionInfo::~TransmissionInfo() {}
859 859
860 } // namespace net 860 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_session.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698