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

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

Issue 1565303002: Change IPEndpoint::address() to return a net::IPAddress (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback eroman Created 4 years, 11 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
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 #include <utility> 9 #include <utility>
10 10
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 100); 452 100);
453 } 453 }
454 last_packet_sent_time_ = sent_time; 454 last_packet_sent_time_ = sent_time;
455 } 455 }
456 456
457 void QuicConnectionLogger::OnPacketReceived(const IPEndPoint& self_address, 457 void QuicConnectionLogger::OnPacketReceived(const IPEndPoint& self_address,
458 const IPEndPoint& peer_address, 458 const IPEndPoint& peer_address,
459 const QuicEncryptedPacket& packet) { 459 const QuicEncryptedPacket& packet) {
460 if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) { 460 if (local_address_from_self_.GetFamily() == ADDRESS_FAMILY_UNSPECIFIED) {
461 local_address_from_self_ = self_address; 461 local_address_from_self_ = self_address;
462 UMA_HISTOGRAM_ENUMERATION("Net.QuicSession.ConnectionTypeFromSelf", 462 UMA_HISTOGRAM_ENUMERATION(
463 GetRealAddressFamily(self_address.address()), 463 "Net.QuicSession.ConnectionTypeFromSelf",
464 ADDRESS_FAMILY_LAST); 464 GetRealAddressFamily(self_address.address().bytes()),
465 ADDRESS_FAMILY_LAST);
465 } 466 }
466 467
467 previous_received_packet_size_ = last_received_packet_size_; 468 previous_received_packet_size_ = last_received_packet_size_;
468 last_received_packet_size_ = packet.length(); 469 last_received_packet_size_ = packet.length();
469 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED, 470 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_PACKET_RECEIVED,
470 base::Bind(&NetLogQuicPacketCallback, &self_address, 471 base::Bind(&NetLogQuicPacketCallback, &self_address,
471 &peer_address, packet.length())); 472 &peer_address, packet.length()));
472 } 473 }
473 474
474 void QuicConnectionLogger::OnUnauthenticatedHeader( 475 void QuicConnectionLogger::OnUnauthenticatedHeader(
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message)); 654 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message));
654 655
655 if (message.tag() == kSHLO) { 656 if (message.tag() == kSHLO) {
656 StringPiece address; 657 StringPiece address;
657 QuicSocketAddressCoder decoder; 658 QuicSocketAddressCoder decoder;
658 if (message.GetStringPiece(kCADR, &address) && 659 if (message.GetStringPiece(kCADR, &address) &&
659 decoder.Decode(address.data(), address.size())) { 660 decoder.Decode(address.data(), address.size())) {
660 local_address_from_shlo_ = IPEndPoint(decoder.ip(), decoder.port()); 661 local_address_from_shlo_ = IPEndPoint(decoder.ip(), decoder.port());
661 UMA_HISTOGRAM_ENUMERATION( 662 UMA_HISTOGRAM_ENUMERATION(
662 "Net.QuicSession.ConnectionTypeFromPeer", 663 "Net.QuicSession.ConnectionTypeFromPeer",
663 GetRealAddressFamily(local_address_from_shlo_.address()), 664 GetRealAddressFamily(local_address_from_shlo_.address().bytes()),
664 ADDRESS_FAMILY_LAST); 665 ADDRESS_FAMILY_LAST);
665 } 666 }
666 } 667 }
667 } 668 }
668 669
669 void QuicConnectionLogger::OnCryptoHandshakeMessageSent( 670 void QuicConnectionLogger::OnCryptoHandshakeMessageSent(
670 const CryptoHandshakeMessage& message) { 671 const CryptoHandshakeMessage& message) {
671 net_log_.AddEvent( 672 net_log_.AddEvent(
672 NetLog::TYPE_QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_SENT, 673 NetLog::TYPE_QUIC_SESSION_CRYPTO_HANDSHAKE_MESSAGE_SENT,
673 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message)); 674 base::Bind(&NetLogQuicCryptoHandshakeMessageCallback, &message));
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698