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

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

Issue 1502503002: Move encryption_level from QueuedPacket into SerializedPacket. No functional change. Not flag pro… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@108718393
Patch Set: Created 5 years 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_logger.h ('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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 NetLogCaptureMode /* capture_mode */) { 42 NetLogCaptureMode /* capture_mode */) {
43 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 43 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
44 dict->SetString("self_address", self_address->ToString()); 44 dict->SetString("self_address", self_address->ToString());
45 dict->SetString("peer_address", peer_address->ToString()); 45 dict->SetString("peer_address", peer_address->ToString());
46 dict->SetInteger("size", packet_size); 46 dict->SetInteger("size", packet_size);
47 return dict.Pass(); 47 return dict.Pass();
48 } 48 }
49 49
50 scoped_ptr<base::Value> NetLogQuicPacketSentCallback( 50 scoped_ptr<base::Value> NetLogQuicPacketSentCallback(
51 const SerializedPacket& serialized_packet, 51 const SerializedPacket& serialized_packet,
52 EncryptionLevel level,
53 TransmissionType transmission_type, 52 TransmissionType transmission_type,
54 size_t packet_size, 53 size_t packet_size,
55 QuicTime sent_time, 54 QuicTime sent_time,
56 NetLogCaptureMode /* capture_mode */) { 55 NetLogCaptureMode /* capture_mode */) {
57 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue()); 56 scoped_ptr<base::DictionaryValue> dict(new base::DictionaryValue());
58 dict->SetInteger("encryption_level", level);
59 dict->SetInteger("transmission_type", transmission_type); 57 dict->SetInteger("transmission_type", transmission_type);
60 dict->SetString("packet_number", 58 dict->SetString("packet_number",
61 base::Uint64ToString(serialized_packet.packet_number)); 59 base::Uint64ToString(serialized_packet.packet_number));
62 dict->SetInteger("size", packet_size); 60 dict->SetInteger("size", packet_size);
63 dict->SetString("sent_time_us", 61 dict->SetString("sent_time_us",
64 base::Int64ToString(sent_time.ToDebuggingValue())); 62 base::Int64ToString(sent_time.ToDebuggingValue()));
65 return dict.Pass(); 63 return dict.Pass();
66 } 64 }
67 65
68 scoped_ptr<base::Value> NetLogQuicPacketRetransmittedCallback( 66 scoped_ptr<base::Value> NetLogQuicPacketRetransmittedCallback(
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
429 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_MTU_DISCOVERY_FRAME_SENT); 427 net_log_.AddEvent(NetLog::TYPE_QUIC_SESSION_MTU_DISCOVERY_FRAME_SENT);
430 break; 428 break;
431 default: 429 default:
432 DCHECK(false) << "Illegal frame type: " << frame.type; 430 DCHECK(false) << "Illegal frame type: " << frame.type;
433 } 431 }
434 } 432 }
435 433
436 void QuicConnectionLogger::OnPacketSent( 434 void QuicConnectionLogger::OnPacketSent(
437 const SerializedPacket& serialized_packet, 435 const SerializedPacket& serialized_packet,
438 QuicPacketNumber original_packet_number, 436 QuicPacketNumber original_packet_number,
439 EncryptionLevel level,
440 TransmissionType transmission_type, 437 TransmissionType transmission_type,
441 size_t encrypted_length, 438 size_t encrypted_length,
442 QuicTime sent_time) { 439 QuicTime sent_time) {
443 if (original_packet_number == 0) { 440 if (original_packet_number == 0) {
444 net_log_.AddEvent( 441 net_log_.AddEvent(
445 NetLog::TYPE_QUIC_SESSION_PACKET_SENT, 442 NetLog::TYPE_QUIC_SESSION_PACKET_SENT,
446 base::Bind(&NetLogQuicPacketSentCallback, serialized_packet, level, 443 base::Bind(&NetLogQuicPacketSentCallback, serialized_packet,
447 transmission_type, encrypted_length, sent_time)); 444 transmission_type, encrypted_length, sent_time));
448 } else { 445 } else {
449 net_log_.AddEvent( 446 net_log_.AddEvent(
450 NetLog::TYPE_QUIC_SESSION_PACKET_RETRANSMITTED, 447 NetLog::TYPE_QUIC_SESSION_PACKET_RETRANSMITTED,
451 base::Bind(&NetLogQuicPacketRetransmittedCallback, 448 base::Bind(&NetLogQuicPacketRetransmittedCallback,
452 original_packet_number, serialized_packet.packet_number)); 449 original_packet_number, serialized_packet.packet_number));
453 } 450 }
454 // Record time duration from last packet sent to the new packet sent. 451 // Record time duration from last packet sent to the new packet sent.
455 if (last_packet_sent_time_.IsInitialized()) { 452 if (last_packet_sent_time_.IsInitialized()) {
456 UMA_HISTOGRAM_CUSTOM_TIMES( 453 UMA_HISTOGRAM_CUSTOM_TIMES(
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
890 continue; 887 continue;
891 } 888 }
892 // Record some overlapping patterns, to get a better picture, since this is 889 // Record some overlapping patterns, to get a better picture, since this is
893 // not very expensive. 890 // not very expensive.
894 if (i % 3 == 0) 891 if (i % 3 == 0)
895 six_packet_histogram->Add(recent_6_mask); 892 six_packet_histogram->Add(recent_6_mask);
896 } 893 }
897 } 894 }
898 895
899 } // namespace net 896 } // namespace net
OLDNEW
« no previous file with comments | « net/quic/quic_connection_logger.h ('k') | net/quic/quic_connection_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698