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

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

Issue 424003002: Inline the members of QUIC's ReceivedPacketInfo into QuicAckFrame now (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@remove_FixRate_congestion_type_71746617
Patch Set: Created 6 years, 4 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_protocol_test.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 "net/quic/quic_utils.h" 8 #include "net/quic/quic_utils.h"
9 9
10 using base::StringPiece; 10 using base::StringPiece;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 } 231 }
232 os << ", fec_flag: " << header.fec_flag 232 os << ", fec_flag: " << header.fec_flag
233 << ", entropy_flag: " << header.entropy_flag 233 << ", entropy_flag: " << header.entropy_flag
234 << ", entropy hash: " << static_cast<int>(header.entropy_hash) 234 << ", entropy hash: " << static_cast<int>(header.entropy_hash)
235 << ", sequence_number: " << header.packet_sequence_number 235 << ", sequence_number: " << header.packet_sequence_number
236 << ", is_in_fec_group:" << header.is_in_fec_group 236 << ", is_in_fec_group:" << header.is_in_fec_group
237 << ", fec_group: " << header.fec_group<< "}\n"; 237 << ", fec_group: " << header.fec_group<< "}\n";
238 return os; 238 return os;
239 } 239 }
240 240
241 ReceivedPacketInfo::ReceivedPacketInfo() 241 bool IsAwaitingPacket(const QuicAckFrame& ack_frame,
242 : entropy_hash(0),
243 largest_observed(0),
244 delta_time_largest_observed(QuicTime::Delta::Infinite()),
245 is_truncated(false) {}
246
247 ReceivedPacketInfo::~ReceivedPacketInfo() {}
248
249 bool IsAwaitingPacket(const ReceivedPacketInfo& received_info,
250 QuicPacketSequenceNumber sequence_number) { 242 QuicPacketSequenceNumber sequence_number) {
251 return sequence_number > received_info.largest_observed || 243 return sequence_number > ack_frame.largest_observed ||
252 ContainsKey(received_info.missing_packets, sequence_number); 244 ContainsKey(ack_frame.missing_packets, sequence_number);
253 } 245 }
254 246
255 void InsertMissingPacketsBetween(ReceivedPacketInfo* received_info, 247 void InsertMissingPacketsBetween(QuicAckFrame* ack_frame,
256 QuicPacketSequenceNumber lower, 248 QuicPacketSequenceNumber lower,
257 QuicPacketSequenceNumber higher) { 249 QuicPacketSequenceNumber higher) {
258 for (QuicPacketSequenceNumber i = lower; i < higher; ++i) { 250 for (QuicPacketSequenceNumber i = lower; i < higher; ++i) {
259 received_info->missing_packets.insert(i); 251 ack_frame->missing_packets.insert(i);
260 } 252 }
261 } 253 }
262 254
263 QuicStopWaitingFrame::QuicStopWaitingFrame() 255 QuicStopWaitingFrame::QuicStopWaitingFrame()
264 : entropy_hash(0), 256 : entropy_hash(0),
265 least_unacked(0) { 257 least_unacked(0) {
266 } 258 }
267 259
268 QuicStopWaitingFrame::~QuicStopWaitingFrame() {} 260 QuicStopWaitingFrame::~QuicStopWaitingFrame() {}
269 261
270 QuicAckFrame::QuicAckFrame() {} 262 QuicAckFrame::QuicAckFrame()
263 : entropy_hash(0),
264 largest_observed(0),
265 delta_time_largest_observed(QuicTime::Delta::Infinite()),
266 is_truncated(false) {}
267
268 QuicAckFrame::~QuicAckFrame() {}
271 269
272 CongestionFeedbackMessageTCP::CongestionFeedbackMessageTCP() 270 CongestionFeedbackMessageTCP::CongestionFeedbackMessageTCP()
273 : receive_window(0) { 271 : receive_window(0) {
274 } 272 }
275 273
276 CongestionFeedbackMessageInterArrival::CongestionFeedbackMessageInterArrival() { 274 CongestionFeedbackMessageInterArrival::CongestionFeedbackMessageInterArrival() {
277 } 275 }
278 276
279 CongestionFeedbackMessageInterArrival:: 277 CongestionFeedbackMessageInterArrival::
280 ~CongestionFeedbackMessageInterArrival() {} 278 ~CongestionFeedbackMessageInterArrival() {}
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 } 372 }
375 373
376 QuicFecData::QuicFecData() : fec_group(0) {} 374 QuicFecData::QuicFecData() : fec_group(0) {}
377 375
378 ostream& operator<<(ostream& os, const QuicStopWaitingFrame& sent_info) { 376 ostream& operator<<(ostream& os, const QuicStopWaitingFrame& sent_info) {
379 os << "entropy_hash: " << static_cast<int>(sent_info.entropy_hash) 377 os << "entropy_hash: " << static_cast<int>(sent_info.entropy_hash)
380 << " least_unacked: " << sent_info.least_unacked; 378 << " least_unacked: " << sent_info.least_unacked;
381 return os; 379 return os;
382 } 380 }
383 381
384 ostream& operator<<(ostream& os, const ReceivedPacketInfo& received_info) { 382 ostream& operator<<(ostream& os, const QuicAckFrame& ack_frame) {
385 os << "entropy_hash: " << static_cast<int>(received_info.entropy_hash) 383 os << "entropy_hash: " << static_cast<int>(ack_frame.entropy_hash)
386 << " is_truncated: " << received_info.is_truncated 384 << " is_truncated: " << ack_frame.is_truncated
387 << " largest_observed: " << received_info.largest_observed 385 << " largest_observed: " << ack_frame.largest_observed
388 << " delta_time_largest_observed: " 386 << " delta_time_largest_observed: "
389 << received_info.delta_time_largest_observed.ToMicroseconds() 387 << ack_frame.delta_time_largest_observed.ToMicroseconds()
390 << " missing_packets: [ "; 388 << " missing_packets: [ ";
391 for (SequenceNumberSet::const_iterator it = 389 for (SequenceNumberSet::const_iterator it = ack_frame.missing_packets.begin();
392 received_info.missing_packets.begin(); 390 it != ack_frame.missing_packets.end(); ++it) {
393 it != received_info.missing_packets.end(); ++it) {
394 os << *it << " "; 391 os << *it << " ";
395 } 392 }
396 os << " ] revived_packets: [ "; 393 os << " ] revived_packets: [ ";
397 for (SequenceNumberSet::const_iterator it = 394 for (SequenceNumberSet::const_iterator it = ack_frame.revived_packets.begin();
398 received_info.revived_packets.begin(); 395 it != ack_frame.revived_packets.end(); ++it) {
399 it != received_info.revived_packets.end(); ++it) {
400 os << *it << " "; 396 os << *it << " ";
401 } 397 }
402 os << " ]"; 398 os << " ]";
403 return os; 399 return os;
404 } 400 }
405 401
406 ostream& operator<<(ostream& os, const QuicFrame& frame) { 402 ostream& operator<<(ostream& os, const QuicFrame& frame) {
407 switch (frame.type) { 403 switch (frame.type) {
408 case PADDING_FRAME: { 404 case PADDING_FRAME: {
409 os << "type { PADDING_FRAME } "; 405 os << "type { PADDING_FRAME } ";
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 ostream& operator<<(ostream& os, const QuicStreamFrame& stream_frame) { 487 ostream& operator<<(ostream& os, const QuicStreamFrame& stream_frame) {
492 os << "stream_id { " << stream_frame.stream_id << " } " 488 os << "stream_id { " << stream_frame.stream_id << " } "
493 << "fin { " << stream_frame.fin << " } " 489 << "fin { " << stream_frame.fin << " } "
494 << "offset { " << stream_frame.offset << " } " 490 << "offset { " << stream_frame.offset << " } "
495 << "data { " 491 << "data { "
496 << QuicUtils::StringToHexASCIIDump(*(stream_frame.GetDataAsString())) 492 << QuicUtils::StringToHexASCIIDump(*(stream_frame.GetDataAsString()))
497 << " }\n"; 493 << " }\n";
498 return os; 494 return os;
499 } 495 }
500 496
501 ostream& operator<<(ostream& os, const QuicAckFrame& ack_frame) {
502 os << "received info { " << ack_frame.received_info << " }\n";
503 return os;
504 }
505
506 ostream& operator<<(ostream& os, 497 ostream& operator<<(ostream& os,
507 const QuicCongestionFeedbackFrame& congestion_frame) { 498 const QuicCongestionFeedbackFrame& congestion_frame) {
508 os << "type: " << congestion_frame.type; 499 os << "type: " << congestion_frame.type;
509 switch (congestion_frame.type) { 500 switch (congestion_frame.type) {
510 case kInterArrival: { 501 case kInterArrival: {
511 const CongestionFeedbackMessageInterArrival& inter_arrival = 502 const CongestionFeedbackMessageInterArrival& inter_arrival =
512 congestion_frame.inter_arrival; 503 congestion_frame.inter_arrival;
513 os << " received packets: [ "; 504 os << " received packets: [ ";
514 for (TimeMap::const_iterator it = 505 for (TimeMap::const_iterator it =
515 inter_arrival.received_packet_times.begin(); 506 inter_arrival.received_packet_times.begin();
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 sent_time(QuicTime::Zero()), 758 sent_time(QuicTime::Zero()),
768 bytes_sent(0), 759 bytes_sent(0),
769 nack_count(0), 760 nack_count(0),
770 transmission_type(transmission_type), 761 transmission_type(transmission_type),
771 all_transmissions(all_transmissions), 762 all_transmissions(all_transmissions),
772 in_flight(false) { 763 in_flight(false) {
773 all_transmissions->insert(sequence_number); 764 all_transmissions->insert(sequence_number);
774 } 765 }
775 766
776 } // namespace net 767 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_protocol.h ('k') | net/quic/quic_protocol_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698