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

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: Addressed rch comments, now using quic connection logger 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 QuicConnection* connection,
36 scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher);
33 37
34 ~QuicConnectionLogger() override; 38 ~QuicConnectionLogger() override;
35 39
36 // QuicPacketGenerator::DebugDelegateInterface 40 // QuicPacketGenerator::DebugDelegateInterface
37 void OnFrameAddedToPacket(const QuicFrame& frame) override; 41 void OnFrameAddedToPacket(const QuicFrame& frame) override;
38 42
39 // QuicConnectionDebugVisitorInterface 43 // QuicConnectionDebugVisitorInterface
40 void OnPacketSent(const SerializedPacket& serialized_packet, 44 void OnPacketSent(const SerializedPacket& serialized_packet,
41 QuicPacketNumber original_packet_number, 45 QuicPacketNumber original_packet_number,
42 EncryptionLevel level, 46 EncryptionLevel level,
(...skipping 127 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 const QuicConnection* connection_; // Unowned. May be null.
Ryan Hamilton 2015/09/17 01:59:49 |session_| already has a connection() accessor so
tbansal1 2015/09/17 22:23:42 Done. Removed.
185 // Watches the performance of the UDP socket underlying this QUIC connection.
186 // May be null.
187 const scoped_ptr<SocketPerformanceWatcher> socket_performance_watcher_;
180 188
181 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger); 189 DISALLOW_COPY_AND_ASSIGN(QuicConnectionLogger);
182 }; 190 };
183 191
184 } // namespace net 192 } // namespace net
185 193
186 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_ 194 #endif // NET_QUIC_QUIC_CONNECTION_LOGGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698