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 #ifndef NET_QUIC_QUIC_CONNECTION_LOGGER_H_ | 5 #ifndef NET_QUIC_QUIC_CONNECTION_LOGGER_H_ |
6 #define NET_QUIC_QUIC_CONNECTION_LOGGER_H_ | 6 #define NET_QUIC_QUIC_CONNECTION_LOGGER_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 | 9 |
10 #include "net/base/ip_endpoint.h" | 10 #include "net/base/ip_endpoint.h" |
11 #include "net/base/net_log.h" | 11 #include "net/base/net_log.h" |
12 #include "net/base/network_change_notifier.h" | 12 #include "net/base/network_change_notifier.h" |
13 #include "net/quic/quic_connection.h" | 13 #include "net/quic/quic_connection.h" |
14 #include "net/quic/quic_protocol.h" | 14 #include "net/quic/quic_protocol.h" |
15 | 15 |
16 namespace net { | 16 namespace net { |
| 17 namespace test { |
| 18 class QuicConnectionLoggerPeer; |
| 19 } // namespace test |
17 | 20 |
18 class CryptoHandshakeMessage; | 21 class CryptoHandshakeMessage; |
19 class CertVerifyResult; | 22 class CertVerifyResult; |
20 | 23 |
21 // This class is a debug visitor of a QuicConnection which logs | 24 // This class is a debug visitor of a QuicConnection which logs |
22 // events to |net_log|. | 25 // events to |net_log|. |
23 class NET_EXPORT_PRIVATE QuicConnectionLogger | 26 class NET_EXPORT_PRIVATE QuicConnectionLogger |
24 : public QuicConnectionDebugVisitor { | 27 : public QuicConnectionDebugVisitor { |
25 public: | 28 public: |
26 explicit QuicConnectionLogger(const BoundNetLog& net_log); | 29 explicit QuicConnectionLogger(const BoundNetLog& net_log); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 void OnCryptoHandshakeMessageReceived( | 77 void OnCryptoHandshakeMessageReceived( |
75 const CryptoHandshakeMessage& message); | 78 const CryptoHandshakeMessage& message); |
76 void OnCryptoHandshakeMessageSent( | 79 void OnCryptoHandshakeMessageSent( |
77 const CryptoHandshakeMessage& message); | 80 const CryptoHandshakeMessage& message); |
78 void UpdateReceivedFrameCounts(QuicStreamId stream_id, | 81 void UpdateReceivedFrameCounts(QuicStreamId stream_id, |
79 int num_frames_received, | 82 int num_frames_received, |
80 int num_duplicate_frames_received); | 83 int num_duplicate_frames_received); |
81 void OnCertificateVerified(const CertVerifyResult& result); | 84 void OnCertificateVerified(const CertVerifyResult& result); |
82 | 85 |
83 private: | 86 private: |
| 87 friend class test::QuicConnectionLoggerPeer; |
| 88 |
84 // Do a factory get for a histogram for recording data, about individual | 89 // Do a factory get for a histogram for recording data, about individual |
85 // packet sequence numbers, that was gathered in the vectors | 90 // packet sequence numbers, that was gathered in the vectors |
86 // received_packets_ and received_acks_. |statistic_name| identifies which | 91 // received_packets_ and received_acks_. |statistic_name| identifies which |
87 // element of data is recorded, and is used to form the histogram name. | 92 // element of data is recorded, and is used to form the histogram name. |
88 base::HistogramBase* GetPacketSequenceNumberHistogram( | 93 base::HistogramBase* GetPacketSequenceNumberHistogram( |
89 const char* statistic_name) const; | 94 const char* statistic_name) const; |
90 // Do a factory get for a histogram to record a 6-packet loss-sequence as a | 95 // Do a factory get for a histogram to record a 6-packet loss-sequence as a |
91 // sample. The histogram will record the 64 distinct possible combinations. | 96 // sample. The histogram will record the 64 distinct possible combinations. |
92 // |which_6| is used to adjust the name of the histogram to distinguish the | 97 // |which_6| is used to adjust the name of the histogram to distinguish the |
93 // first 6 packets in a connection, vs. some later 6 packets. | 98 // first 6 packets in a connection, vs. some later 6 packets. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // The available type of connection (WiFi, 3G, etc.) when connection was first | 167 // The available type of connection (WiFi, 3G, etc.) when connection was first |
163 // used. | 168 // used. |
164 const char* const connection_description_; | 169 const char* const connection_description_; |
165 | 170 |
166 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); | 171 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); |
167 }; | 172 }; |
168 | 173 |
169 } // namespace net | 174 } // namespace net |
170 | 175 |
171 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ | 176 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ |
OLD | NEW |