Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / net / quic / quic_connection_logger.h
index bbb87e0..766dedb 100644 (file)
@@ -14,6 +14,9 @@
 #include "net/quic/quic_protocol.h"
 
 namespace net {
+namespace test {
+class QuicConnectionLoggerPeer;
+}  // namespace test
 
 class CryptoHandshakeMessage;
 class CertVerifyResult;
@@ -42,6 +45,11 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
   virtual void OnPacketReceived(const IPEndPoint& self_address,
                                 const IPEndPoint& peer_address,
                                 const QuicEncryptedPacket& packet) OVERRIDE;
+  virtual void OnIncorrectConnectionId(
+      QuicConnectionId connection_id) OVERRIDE;
+  virtual void OnUndecryptablePacket() OVERRIDE;
+  virtual void OnDuplicatePacket(QuicPacketSequenceNumber sequence_number)
+      OVERRIDE;
   virtual void OnProtocolVersionMismatch(QuicVersion version) OVERRIDE;
   virtual void OnPacketHeader(const QuicPacketHeader& header) OVERRIDE;
   virtual void OnStreamFrame(const QuicStreamFrame& frame) OVERRIDE;
@@ -63,18 +71,21 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
   virtual void OnRevivedPacket(const QuicPacketHeader& revived_header,
                                base::StringPiece payload) OVERRIDE;
   virtual void OnConnectionClosed(QuicErrorCode error, bool from_peer) OVERRIDE;
+  virtual void OnSuccessfulVersionNegotiation(
+      const QuicVersion& version) OVERRIDE;
 
   void OnCryptoHandshakeMessageReceived(
       const CryptoHandshakeMessage& message);
   void OnCryptoHandshakeMessageSent(
       const CryptoHandshakeMessage& message);
-  void OnSuccessfulVersionNegotiation(const QuicVersion& version);
   void UpdateReceivedFrameCounts(QuicStreamId stream_id,
                                  int num_frames_received,
                                  int num_duplicate_frames_received);
   void OnCertificateVerified(const CertVerifyResult& result);
 
  private:
+  friend class test::QuicConnectionLoggerPeer;
+
   // Do a factory get for a histogram for recording data, about individual
   // packet sequence numbers, that was gathered in the vectors
   // received_packets_ and received_acks_. |statistic_name| identifies which
@@ -139,6 +150,12 @@ class NET_EXPORT_PRIVATE QuicConnectionLogger
   int num_frames_received_;
   // Count of the number of duplicate frames received.
   int num_duplicate_frames_received_;
+  // Count of the number of packets received with incorrect connection IDs.
+  int num_incorrect_connection_ids_;
+  // Count of the number of undecryptable packets received.
+  int num_undecryptable_packets_;
+  // Count of the number of duplicate packets received.
+  int num_duplicate_packets_;
   // Vector of inital packets status' indexed by packet sequence numbers, where
   // false means never received.  Zero is not a valid packet sequence number, so
   // that offset is never used, and we'll track 150 packets.