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

Side by Side Diff: net/quic/quic_connection_logger.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_connection.cc ('k') | net/quic/quic_connection_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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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_connection_logger.h" 5 #include "net/quic/quic_connection_logger.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 dict->SetInteger("stream_id", frame->stream_id); 95 dict->SetInteger("stream_id", frame->stream_id);
96 dict->SetBoolean("fin", frame->fin); 96 dict->SetBoolean("fin", frame->fin);
97 dict->SetString("offset", base::Uint64ToString(frame->offset)); 97 dict->SetString("offset", base::Uint64ToString(frame->offset));
98 dict->SetInteger("length", frame->data.TotalBufferSize()); 98 dict->SetInteger("length", frame->data.TotalBufferSize());
99 return dict; 99 return dict;
100 } 100 }
101 101
102 base::Value* NetLogQuicAckFrameCallback(const QuicAckFrame* frame, 102 base::Value* NetLogQuicAckFrameCallback(const QuicAckFrame* frame,
103 NetLog::LogLevel /* log_level */) { 103 NetLog::LogLevel /* log_level */) {
104 base::DictionaryValue* dict = new base::DictionaryValue(); 104 base::DictionaryValue* dict = new base::DictionaryValue();
105 base::DictionaryValue* received_info = new base::DictionaryValue(); 105 dict->SetString("largest_observed",
106 dict->Set("received_info", received_info); 106 base::Uint64ToString(frame->largest_observed));
107 received_info->SetString( 107 dict->SetBoolean("truncated", frame->is_truncated);
108 "largest_observed",
109 base::Uint64ToString(frame->received_info.largest_observed));
110 received_info->SetBoolean("truncated", frame->received_info.is_truncated);
111 base::ListValue* missing = new base::ListValue(); 108 base::ListValue* missing = new base::ListValue();
112 received_info->Set("missing_packets", missing); 109 dict->Set("missing_packets", missing);
113 const SequenceNumberSet& missing_packets = 110 const SequenceNumberSet& missing_packets = frame->missing_packets;
114 frame->received_info.missing_packets;
115 for (SequenceNumberSet::const_iterator it = missing_packets.begin(); 111 for (SequenceNumberSet::const_iterator it = missing_packets.begin();
116 it != missing_packets.end(); ++it) { 112 it != missing_packets.end(); ++it) {
117 missing->AppendString(base::Uint64ToString(*it)); 113 missing->AppendString(base::Uint64ToString(*it));
118 } 114 }
119 return dict; 115 return dict;
120 } 116 }
121 117
122 base::Value* NetLogQuicCongestionFeedbackFrameCallback( 118 base::Value* NetLogQuicCongestionFeedbackFrameCallback(
123 const QuicCongestionFeedbackFrame* frame, 119 const QuicCongestionFeedbackFrame* frame,
124 NetLog::LogLevel /* log_level */) { 120 NetLog::LogLevel /* log_level */) {
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
352 break; 348 break;
353 case STREAM_FRAME: 349 case STREAM_FRAME:
354 net_log_.AddEvent( 350 net_log_.AddEvent(
355 NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_SENT, 351 NetLog::TYPE_QUIC_SESSION_STREAM_FRAME_SENT,
356 base::Bind(&NetLogQuicStreamFrameCallback, frame.stream_frame)); 352 base::Bind(&NetLogQuicStreamFrameCallback, frame.stream_frame));
357 break; 353 break;
358 case ACK_FRAME: 354 case ACK_FRAME:
359 net_log_.AddEvent( 355 net_log_.AddEvent(
360 NetLog::TYPE_QUIC_SESSION_ACK_FRAME_SENT, 356 NetLog::TYPE_QUIC_SESSION_ACK_FRAME_SENT,
361 base::Bind(&NetLogQuicAckFrameCallback, frame.ack_frame)); 357 base::Bind(&NetLogQuicAckFrameCallback, frame.ack_frame));
362 if (frame.ack_frame->received_info.is_truncated) 358 if (frame.ack_frame->is_truncated)
363 ++num_truncated_acks_sent_; 359 ++num_truncated_acks_sent_;
364 break; 360 break;
365 case CONGESTION_FEEDBACK_FRAME: 361 case CONGESTION_FEEDBACK_FRAME:
366 net_log_.AddEvent( 362 net_log_.AddEvent(
367 NetLog::TYPE_QUIC_SESSION_CONGESTION_FEEDBACK_FRAME_SENT, 363 NetLog::TYPE_QUIC_SESSION_CONGESTION_FEEDBACK_FRAME_SENT,
368 base::Bind(&NetLogQuicCongestionFeedbackFrameCallback, 364 base::Bind(&NetLogQuicCongestionFeedbackFrameCallback,
369 frame.congestion_feedback_frame)); 365 frame.congestion_feedback_frame));
370 break; 366 break;
371 case RST_STREAM_FRAME: 367 case RST_STREAM_FRAME:
372 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.RstStreamErrorCodeClient", 368 UMA_HISTOGRAM_SPARSE_SLOWLY("Net.QuicSession.RstStreamErrorCodeClient",
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 void QuicConnectionLogger::OnAckFrame(const QuicAckFrame& frame) { 491 void QuicConnectionLogger::OnAckFrame(const QuicAckFrame& frame) {
496 net_log_.AddEvent( 492 net_log_.AddEvent(
497 NetLog::TYPE_QUIC_SESSION_ACK_FRAME_RECEIVED, 493 NetLog::TYPE_QUIC_SESSION_ACK_FRAME_RECEIVED,
498 base::Bind(&NetLogQuicAckFrameCallback, &frame)); 494 base::Bind(&NetLogQuicAckFrameCallback, &frame));
499 495
500 const size_t kApproximateLargestSoloAckBytes = 100; 496 const size_t kApproximateLargestSoloAckBytes = 100;
501 if (last_received_packet_sequence_number_ < received_acks_.size() && 497 if (last_received_packet_sequence_number_ < received_acks_.size() &&
502 last_received_packet_size_ < kApproximateLargestSoloAckBytes) 498 last_received_packet_size_ < kApproximateLargestSoloAckBytes)
503 received_acks_[last_received_packet_sequence_number_] = true; 499 received_acks_[last_received_packet_sequence_number_] = true;
504 500
505 if (frame.received_info.is_truncated) 501 if (frame.is_truncated)
506 ++num_truncated_acks_received_; 502 ++num_truncated_acks_received_;
507 503
508 if (frame.received_info.missing_packets.empty()) 504 if (frame.missing_packets.empty())
509 return; 505 return;
510 506
511 SequenceNumberSet missing_packets = frame.received_info.missing_packets; 507 SequenceNumberSet missing_packets = frame.missing_packets;
512 SequenceNumberSet::const_iterator it = missing_packets.lower_bound( 508 SequenceNumberSet::const_iterator it = missing_packets.lower_bound(
513 largest_received_missing_packet_sequence_number_); 509 largest_received_missing_packet_sequence_number_);
514 if (it == missing_packets.end()) 510 if (it == missing_packets.end())
515 return; 511 return;
516 512
517 if (*it == largest_received_missing_packet_sequence_number_) { 513 if (*it == largest_received_missing_packet_sequence_number_) {
518 ++it; 514 ++it;
519 if (it == missing_packets.end()) 515 if (it == missing_packets.end())
520 return; 516 return;
521 } 517 }
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 continue; 815 continue;
820 } 816 }
821 // Record some overlapping patterns, to get a better picture, since this is 817 // Record some overlapping patterns, to get a better picture, since this is
822 // not very expensive. 818 // not very expensive.
823 if (i % 3 == 0) 819 if (i % 3 == 0)
824 six_packet_histogram->Add(recent_6_mask); 820 six_packet_histogram->Add(recent_6_mask);
825 } 821 }
826 } 822 }
827 823
828 } // namespace net 824 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698