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

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

Issue 1305293004: Notfiy NQE of QUIC RTT (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased, addressed comments, added more tests Created 5 years, 3 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 #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/network_change_notifier.h" 11 #include "net/base/network_change_notifier.h"
12 #include "net/base/socket_performance_watcher.h"
12 #include "net/log/net_log.h" 13 #include "net/log/net_log.h"
13 #include "net/quic/quic_connection.h" 14 #include "net/quic/quic_connection.h"
14 #include "net/quic/quic_protocol.h" 15 #include "net/quic/quic_protocol.h"
15 #include "net/quic/quic_spdy_session.h" 16 #include "net/quic/quic_spdy_session.h"
16 17
17 namespace net { 18 namespace net {
18 namespace test { 19 namespace test {
19 class QuicConnectionLoggerPeer; 20 class QuicConnectionLoggerPeer;
20 } // namespace test 21 } // namespace test
21 22
22 class CryptoHandshakeMessage; 23 class CryptoHandshakeMessage;
23 class CertVerifyResult; 24 class CertVerifyResult;
24 25
25 // This class is a debug visitor of a QuicConnection which logs 26 // This class is a debug visitor of a QuicConnection which logs
26 // events to |net_log|. 27 // events to |net_log|.
27 class NET_EXPORT_PRIVATE QuicConnectionLogger 28 class NET_EXPORT_PRIVATE QuicConnectionLogger
28 : public QuicConnectionDebugVisitor { 29 : public QuicConnectionDebugVisitor {
29 public: 30 public:
30 QuicConnectionLogger(QuicSpdySession* session, 31 QuicConnectionLogger(
31 const char* const connection_description, 32 QuicSpdySession* session,
32 const BoundNetLog& net_log); 33 const char* const connection_description,
34 const BoundNetLog& net_log,
35 scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher);
Ryan Hamilton 2015/09/18 15:56:38 nit: by convention net_log should come last.
tbansal1 2015/09/18 17:21:20 Done.
33 36
34 ~QuicConnectionLogger() override; 37 ~QuicConnectionLogger() override;
35 38
36 // QuicPacketGenerator::DebugDelegateInterface 39 // QuicPacketGenerator::DebugDelegateInterface
37 void OnFrameAddedToPacket(const QuicFrame& frame) override; 40 void OnFrameAddedToPacket(const QuicFrame& frame) override;
38 41
39 // QuicConnectionDebugVisitorInterface 42 // QuicConnectionDebugVisitorInterface
40 void OnPacketSent(const SerializedPacket& serialized_packet, 43 void OnPacketSent(const SerializedPacket& serialized_packet,
41 QuicPacketNumber original_packet_number, 44 QuicPacketNumber original_packet_number,
42 EncryptionLevel level, 45 EncryptionLevel level,
(...skipping 18 matching lines...) Expand all
61 void OnBlockedFrame(const QuicBlockedFrame& frame) override; 64 void OnBlockedFrame(const QuicBlockedFrame& frame) override;
62 void OnGoAwayFrame(const QuicGoAwayFrame& frame) override; 65 void OnGoAwayFrame(const QuicGoAwayFrame& frame) override;
63 void OnPingFrame(const QuicPingFrame& frame) override; 66 void OnPingFrame(const QuicPingFrame& frame) override;
64 void OnPublicResetPacket(const QuicPublicResetPacket& packet) override; 67 void OnPublicResetPacket(const QuicPublicResetPacket& packet) override;
65 void OnVersionNegotiationPacket( 68 void OnVersionNegotiationPacket(
66 const QuicVersionNegotiationPacket& packet) override; 69 const QuicVersionNegotiationPacket& packet) override;
67 void OnRevivedPacket(const QuicPacketHeader& revived_header, 70 void OnRevivedPacket(const QuicPacketHeader& revived_header,
68 base::StringPiece payload) override; 71 base::StringPiece payload) override;
69 void OnConnectionClosed(QuicErrorCode error, bool from_peer) override; 72 void OnConnectionClosed(QuicErrorCode error, bool from_peer) override;
70 void OnSuccessfulVersionNegotiation(const QuicVersion& version) override; 73 void OnSuccessfulVersionNegotiation(const QuicVersion& version) override;
74 void OnRttChanged(QuicTime::Delta rtt) const override;
71 75
72 void OnCryptoHandshakeMessageReceived( 76 void OnCryptoHandshakeMessageReceived(
73 const CryptoHandshakeMessage& message); 77 const CryptoHandshakeMessage& message);
74 void OnCryptoHandshakeMessageSent( 78 void OnCryptoHandshakeMessageSent(
75 const CryptoHandshakeMessage& message); 79 const CryptoHandshakeMessage& message);
76 void UpdateReceivedFrameCounts(QuicStreamId stream_id, 80 void UpdateReceivedFrameCounts(QuicStreamId stream_id,
77 int num_frames_received, 81 int num_frames_received,
78 int num_duplicate_frames_received); 82 int num_duplicate_frames_received);
79 void OnCertificateVerified(const CertVerifyResult& result); 83 void OnCertificateVerified(const CertVerifyResult& result);
80 84
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // false means never received. Zero is not a valid packet number, so 174 // false means never received. Zero is not a valid packet number, so
171 // that offset is never used, and we'll track 150 packets. 175 // that offset is never used, and we'll track 150 packets.
172 std::bitset<151> received_packets_; 176 std::bitset<151> received_packets_;
173 // Vector to indicate which of the initial 150 received packets turned out to 177 // Vector to indicate which of the initial 150 received packets turned out to
174 // contain solo ACK frames. An element is true iff an ACK frame was in the 178 // contain solo ACK frames. An element is true iff an ACK frame was in the
175 // corresponding packet, and there was very little else. 179 // corresponding packet, and there was very little else.
176 std::bitset<151> received_acks_; 180 std::bitset<151> received_acks_;
177 // The available type of connection (WiFi, 3G, etc.) when connection was first 181 // The available type of connection (WiFi, 3G, etc.) when connection was first
178 // used. 182 // used.
179 const char* const connection_description_; 183 const char* const connection_description_;
184 // Watches the performance of the UDP socket underlying this QUIC connection.
185 // May be null.
186 const scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher_;
180 187
181 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); 188 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger);
182 }; 189 };
183 190
184 } // namespace net 191 } // namespace net
185 192
186 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ 193 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698