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

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: rebase for ChromeOS Created 4 years, 10 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_crypto_server_stream.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 #include <utility> 9 #include <utility>
10 10
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« no previous file with comments | « net/quic/quic_connection.cc ('k') | net/quic/quic_crypto_server_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698