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 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 100); | 451 100); |
452 } | 452 } |
453 last_packet_sent_time_ = sent_time; | 453 last_packet_sent_time_ = sent_time; |
454 } | 454 } |
455 | 455 |
456 void QuicConnectionLogger::OnPacketReceived(const IPEndPoint& self_address, | 456 void QuicConnectionLogger::OnPacketReceived(const IPEndPoint& self_address, |
457 const IPEndPoint& peer_address, | 457 const IPEndPoint& peer_address, |
458 const QuicEncryptedPacket& packet) { | 458 const QuicEncryptedPacket& packet) { |
459 if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) { | 459 if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) { |
460 local_address_from_self_ = self_address; | 460 local_address_from_self_ = self_address; |
461 UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.ConnectionTypeFromSelf", | 461 UMA_HISTOGRAM_ENUMERATION( |
462 GetRealAddressFamily(self_address.address()), | 462 "Net.QuicSession.ConnectionTypeFromSelf", |
463 ADDRESS_FAMILY_LAST); | 463 GetRealAddressFamily(self_address.address().bytes()), |
| 464 ADDRESS_FAMILY_LAST); |
464 } | 465 } |
465 | 466 |
466 previous_received_packet_size_ = last_received_packet_size_; | 467 previous_received_packet_size_ = last_received_packet_size_; |
467 last_received_packet_size_ = packet.length(); | 468 last_received_packet_size_ = packet.length(); |
468 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED, | 469 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED, |
469 base::Bind(&NetLogQuicPacketCallback, &self_address, | 470 base::Bind(&NetLogQuicPacketCallback, &self_address, |
470 &peer_address, packet.length())); | 471 &peer_address, packet.length())); |
471 } | 472 } |
472 | 473 |
473 void QuicConnectionLogger::OnUnauthenticatedHeader( | 474 void QuicConnectionLogger::OnUnauthenticatedHeader( |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
652 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message)); | 653 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message)); |
653 | 654 |
654 if (message.tag() == kSHLO) { | 655 if (message.tag() == kSHLO) { |
655 StringPiece address; | 656 StringPiece address; |
656 QuicSocketAddressCoder decoder; | 657 QuicSocketAddressCoder decoder; |
657 if (message.GetStringPiece(kCADR, &address) && | 658 if (message.GetStringPiece(kCADR, &address) && |
658 decoder.Decode(address.data(), address.size())) { | 659 decoder.Decode(address.data(), address.size())) { |
659 local_address_from_shlo_ = IPEndPoint(decoder.ip(), decoder.port()); | 660 local_address_from_shlo_ = IPEndPoint(decoder.ip(), decoder.port()); |
660 UMA_HISTOGRAM_ENUMERATION( | 661 UMA_HISTOGRAM_ENUMERATION( |
661 "Net.QuicSession.ConnectionTypeFromPeer", | 662 "Net.QuicSession.ConnectionTypeFromPeer", |
662 GetRealAddressFamily(local_address_from_shlo_.address()), | 663 GetRealAddressFamily(local_address_from_shlo_.address().bytes()), |
663 ADDRESS_FAMILY_LAST); | 664 ADDRESS_FAMILY_LAST); |
664 } | 665 } |
665 } | 666 } |
666 } | 667 } |
667 | 668 |
668 void QuicConnectionLogger::OnCryptoHandshakeMessageSent( | 669 void QuicConnectionLogger::OnCryptoHandshakeMessageSent( |
669 const CryptoHandshakeMessage& message) { | 670 const CryptoHandshakeMessage& message) { |
670 net_log_.AddEvent( | 671 net_log_.AddEvent( |
671 NetLog::TYPE_QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_SENT, | 672 NetLog::TYPE_QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_SENT, |
672 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message)); | 673 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message)); |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
872 continue; | 873 continue; |
873 } | 874 } |
874 // Record some overlapping patterns, to get a better picture, since this is | 875 // Record some overlapping patterns, to get a better picture, since this is |
875 // not very expensive. | 876 // not very expensive. |
876 if (i % 3 == 0) | 877 if (i % 3 == 0) |
877 six_packet_histogram->Add(recent_6_mask); | 878 six_packet_histogram->Add(recent_6_mask); |
878 } | 879 } |
879 } | 880 } |
880 | 881 |
881 } // namespace net | 882 } // namespace net |
OLD | NEW |