| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <bitset> | 10 #include <bitset> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 // This class is a debug visitor of a QuicConnection which logs | 30 // This class is a debug visitor of a QuicConnection which logs |
| 31 // events to |net_log|. | 31 // events to |net_log|. |
| 32 class NET_EXPORT_PRIVATE QuicConnectionLogger | 32 class NET_EXPORT_PRIVATE QuicConnectionLogger |
| 33 : public QuicConnectionDebugVisitor, | 33 : public QuicConnectionDebugVisitor, |
| 34 public QuicPacketCreator::DebugDelegate { | 34 public QuicPacketCreator::DebugDelegate { |
| 35 public: | 35 public: |
| 36 QuicConnectionLogger( | 36 QuicConnectionLogger( |
| 37 QuicSpdySession* session, | 37 QuicSpdySession* session, |
| 38 const char* const connection_description, | 38 const char* const connection_description, |
| 39 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, | 39 std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher, |
| 40 const BoundNetLog& net_log); | 40 const NetLogWithSource& net_log); |
| 41 | 41 |
| 42 ~QuicConnectionLogger() override; | 42 ~QuicConnectionLogger() override; |
| 43 | 43 |
| 44 // QuicPacketCreator::DebugDelegateInterface | 44 // QuicPacketCreator::DebugDelegateInterface |
| 45 void OnFrameAddedToPacket(const QuicFrame& frame) override; | 45 void OnFrameAddedToPacket(const QuicFrame& frame) override; |
| 46 | 46 |
| 47 // QuicConnectionDebugVisitorInterface | 47 // QuicConnectionDebugVisitorInterface |
| 48 void OnPacketSent(const SerializedPacket& serialized_packet, | 48 void OnPacketSent(const SerializedPacket& serialized_packet, |
| 49 QuicPathId original_path_id, | 49 QuicPathId original_path_id, |
| 50 QuicPacketNumber original_packet_number, | 50 QuicPacketNumber original_packet_number, |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 private: | 91 private: |
| 92 // Do a factory get for a histogram to record a 6-packet loss-sequence as a | 92 // Do a factory get for a histogram to record a 6-packet loss-sequence as a |
| 93 // sample. The histogram will record the 64 distinct possible combinations. | 93 // sample. The histogram will record the 64 distinct possible combinations. |
| 94 // |which_6| is used to adjust the name of the histogram to distinguish the | 94 // |which_6| is used to adjust the name of the histogram to distinguish the |
| 95 // first 6 packets in a connection, vs. some later 6 packets. | 95 // first 6 packets in a connection, vs. some later 6 packets. |
| 96 base::HistogramBase* Get6PacketHistogram(const char* which_6) const; | 96 base::HistogramBase* Get6PacketHistogram(const char* which_6) const; |
| 97 // For connections longer than 21 received packets, this call will calculate | 97 // For connections longer than 21 received packets, this call will calculate |
| 98 // the overall packet loss rate, and record it into a histogram. | 98 // the overall packet loss rate, and record it into a histogram. |
| 99 void RecordAggregatePacketLossRate() const; | 99 void RecordAggregatePacketLossRate() const; |
| 100 | 100 |
| 101 BoundNetLog net_log_; | 101 NetLogWithSource net_log_; |
| 102 QuicSpdySession* session_; // Unowned. | 102 QuicSpdySession* session_; // Unowned. |
| 103 // The last packet number received. | 103 // The last packet number received. |
| 104 QuicPacketNumber last_received_packet_number_; | 104 QuicPacketNumber last_received_packet_number_; |
| 105 // The size of the most recently received packet. | 105 // The size of the most recently received packet. |
| 106 size_t last_received_packet_size_; | 106 size_t last_received_packet_size_; |
| 107 // True if a PING frame has been sent and no packet has been received. | 107 // True if a PING frame has been sent and no packet has been received. |
| 108 bool no_packet_received_after_ping_; | 108 bool no_packet_received_after_ping_; |
| 109 // The size of the previously received packet. | 109 // The size of the previously received packet. |
| 110 size_t previous_received_packet_size_; | 110 size_t previous_received_packet_size_; |
| 111 // The largest packet number received. In the case where a packet is | 111 // The largest packet number received. In the case where a packet is |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 // Receives notifications regarding the performance of the underlying socket | 158 // Receives notifications regarding the performance of the underlying socket |
| 159 // for the QUIC connection. May be null. | 159 // for the QUIC connection. May be null. |
| 160 const std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher_; | 160 const std::unique_ptr<SocketPerformanceWatcher> socket_performance_watcher_; |
| 161 | 161 |
| 162 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); | 162 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); |
| 163 }; | 163 }; |
| 164 | 164 |
| 165 } // namespace net | 165 } // namespace net |
| 166 | 166 |
| 167 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ | 167 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ |
| OLD | NEW |