| OLD | NEW |
| 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 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 return std::move(dict); | 97 return std::move(dict); |
| 98 } | 98 } |
| 99 | 99 |
| 100 std::unique_ptr<base::Value> NetLogQuicStreamFrameCallback( | 100 std::unique_ptr<base::Value> NetLogQuicStreamFrameCallback( |
| 101 const QuicStreamFrame* frame, | 101 const QuicStreamFrame* frame, |
| 102 NetLogCaptureMode /* capture_mode */) { | 102 NetLogCaptureMode /* capture_mode */) { |
| 103 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 103 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 104 dict->SetInteger("stream_id", frame->stream_id); | 104 dict->SetInteger("stream_id", frame->stream_id); |
| 105 dict->SetBoolean("fin", frame->fin); | 105 dict->SetBoolean("fin", frame->fin); |
| 106 dict->SetString("offset", base::Uint64ToString(frame->offset)); | 106 dict->SetString("offset", base::Uint64ToString(frame->offset)); |
| 107 dict->SetInteger("length", frame->frame_length); | 107 dict->SetInteger("length", frame->data_length); |
| 108 return std::move(dict); | 108 return std::move(dict); |
| 109 } | 109 } |
| 110 | 110 |
| 111 std::unique_ptr<base::Value> NetLogQuicAckFrameCallback( | 111 std::unique_ptr<base::Value> NetLogQuicAckFrameCallback( |
| 112 const QuicAckFrame* frame, | 112 const QuicAckFrame* frame, |
| 113 NetLogCaptureMode /* capture_mode */) { | 113 NetLogCaptureMode /* capture_mode */) { |
| 114 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); | 114 std::unique_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); |
| 115 dict->SetString("largest_observed", | 115 dict->SetString("largest_observed", |
| 116 base::Uint64ToString(frame->largest_observed)); | 116 base::Uint64ToString(frame->largest_observed)); |
| 117 dict->SetString("delta_time_largest_observed_us", | 117 dict->SetString("delta_time_largest_observed_us", |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 421 // MtuDiscoveryFrame is PingFrame on wire, it does not have any payload. | 421 // MtuDiscoveryFrame is PingFrame on wire, it does not have any payload. |
| 422 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_MTU_DISCOVERY_FRAME_SENT); | 422 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_MTU_DISCOVERY_FRAME_SENT); |
| 423 break; | 423 break; |
| 424 default: | 424 default: |
| 425 DCHECK(false) << "Illegal frame type: " << frame.type; | 425 DCHECK(false) << "Illegal frame type: " << frame.type; |
| 426 } | 426 } |
| 427 } | 427 } |
| 428 | 428 |
| 429 void QuicConnectionLogger::OnPacketSent( | 429 void QuicConnectionLogger::OnPacketSent( |
| 430 const SerializedPacket& serialized_packet, | 430 const SerializedPacket& serialized_packet, |
| 431 QuicPathId /* original_path_id */, |
| 431 QuicPacketNumber original_packet_number, | 432 QuicPacketNumber original_packet_number, |
| 432 TransmissionType transmission_type, | 433 TransmissionType transmission_type, |
| 433 QuicTime sent_time) { | 434 QuicTime sent_time) { |
| 434 if (original_packet_number == 0) { | 435 if (original_packet_number == 0) { |
| 435 net_log_.AddEvent( | 436 net_log_.AddEvent( |
| 436 NetLog::TYPE_QUIC_SESSION_PACKET_SENT, | 437 NetLog::TYPE_QUIC_SESSION_PACKET_SENT, |
| 437 base::Bind(&NetLogQuicPacketSentCallback, serialized_packet, | 438 base::Bind(&NetLogQuicPacketSentCallback, serialized_packet, |
| 438 transmission_type, sent_time)); | 439 transmission_type, sent_time)); |
| 439 } else { | 440 } else { |
| 440 net_log_.AddEvent( | 441 net_log_.AddEvent( |
| (...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 continue; | 874 continue; |
| 874 } | 875 } |
| 875 // Record some overlapping patterns, to get a better picture, since this is | 876 // Record some overlapping patterns, to get a better picture, since this is |
| 876 // not very expensive. | 877 // not very expensive. |
| 877 if (i % 3 == 0) | 878 if (i % 3 == 0) |
| 878 six_packet_histogram->Add(recent_6_mask); | 879 six_packet_histogram->Add(recent_6_mask); |
| 879 } | 880 } |
| 880 } | 881 } |
| 881 | 882 |
| 882 } // namespace net | 883 } // namespace net |
| OLD | NEW |