Land Recent QUIC Changes.

Change QUIC's RTO implementation. Protected by FLAGS_quic_use_new_rto.

Decides whether to invoke SendAlgorithmInterface's
OnRetransmissionTimeout after an ack has been received instead of
pro-actively invoking it and then having to revert it.

Fix a minor QUIC bug when both quic_use_new_rto and
quic_rto_uses_last_sent were enabled, a spurious retransmission didn't
expire the SRTT.

Merge internal change: 83625311, 83966746

https://codereview.chromium.org/841603005/

Remove unused original transmission stats from QuicAckNotifier.
No behavior change.

Merge internal change: 83598791
https://codereview.chromium.org/798873005/

Removing quic version 21

Merge internal change: 83551025
https://codereview.chromium.org/786953009/

Fixes typo, changing OnSpuriousPacketRetransmition to
OnSpuriousPacketRetransmission.

Merge internal change: 83546153
https://codereview.chromium.org/837273004/

Adds an alarm for sending a QUIC FEC packet.

This CL adds an alarm for sending an FEC packet. The alarm is based on
the connection's SRTT, and is set when the first FEC protected packet in
an FEC group is sent. This alarm puts some time between the sending of
an FEC protected packet and the corresponding FEC packet, to reduce the
probability of both these packets getting dropped in the network.

Merge internal change: 83543120
https://codereview.chromium.org/839163003/

Tell the QUIC AckNotifierManager about packets on serialization, rather
than when successfully sent.
Protected by ENABLEd FLAGS_quic_ack_notifier_informed_on_serialized.

Merge internal change: 83525991
https://codereview.chromium.org/854463003/

[email protected]
BUG=448688

Review URL: https://codereview.chromium.org/849123003

Cr-Commit-Position: refs/heads/master@{#311789}
diff --git a/net/quic/quic_sent_packet_manager.h b/net/quic/quic_sent_packet_manager.h
index 287b5fc4..f1ebe87e 100644
--- a/net/quic/quic_sent_packet_manager.h
+++ b/net/quic/quic_sent_packet_manager.h
@@ -48,7 +48,7 @@
     virtual ~DebugDelegate() {}
 
     // Called when a spurious retransmission is detected.
-    virtual void OnSpuriousPacketRetransmition(
+    virtual void OnSpuriousPacketRetransmission(
         TransmissionType transmission_type,
         QuicByteCount byte_size) {}
 
@@ -217,6 +217,9 @@
   // start threshold and will return 0.
   QuicPacketCount GetSlowStartThresholdInTcpMss() const;
 
+  // Called by the connection every time it receives a serialized packet.
+  void OnSerializedPacket(const SerializedPacket& serialized_packet);
+
   // Enables pacing if it has not already been enabled.
   void EnablePacing();
 
@@ -287,6 +290,10 @@
   // Retransmits all crypto stream packets.
   void RetransmitCryptoPackets();
 
+  // Retransmits two packets for an RTO and removes any non-retransmittable
+  // packets from flight.
+  void RetransmitRtoPackets();
+
   // Retransmits all the packets and abandons by invoking a full RTO.
   void RetransmitAllPackets();
 
@@ -390,7 +397,7 @@
   size_t consecutive_tlp_count_;
   // Number of times the crypto handshake has been retransmitted.
   size_t consecutive_crypto_retransmission_count_;
-  // Number of pending transmissions of TLP or crypto packets.
+  // Number of pending transmissions of TLP, RTO, or crypto packets.
   size_t pending_timer_transmission_count_;
   // Maximum number of tail loss probes to send before firing an RTO.
   size_t max_tail_loss_probes_;