Landing Recent QUIC changes until 06/17/2015 14:59.

relnote: Minor QUIC code cleanups.  No functional change.

Mostly removed unused sequence_number_length from the MinAckFrameSize.

Merge internal change: 96206723
https://codereview.chromium.org/1191823003/

relnote: Increase the maximum number of tracked QUIC packets to 5000.

This is intended to be in advance of Chrome M44, which is going to
increase the CWND from 256k bytes to 1MB.

Merge internal change: 96205856
https://codereview.chromium.org/1180073011/

Change the QUICStreamSequencerTest to test the sequencer interface,
rather than reaching into the implementation.

relnote: N/A. Test only change.

Merge internal change: 96134592
https://codereview.chromium.org/1181283007/

Introduce tests for QUIC's AckNotifierManager.

Some of the features of the test fixture related to non-retransmittable
packets are not used yet.  They will be used by CL 96040825 (from which
this CL was forked off).

relnote: n/a (test-only change)

Merge internal change: 96120706
https://codereview.chromium.org/1179183004/

Cleanup: Fix a dangling reference.

When a StringPiece is initialized with a temporary string, the string
will be destroyed at the end of the expression and the StringPiece will
contain a dangling reference.

Found by internal stringpiece dangling code.

Merge internal change: 96106102
https://codereview.chromium.org/1180143007/

relnote: Remove IOVector from the write path in favor of a simpler QuicIOVector struct.

Estimated to save 2-3% of CPU.

Merge internal change: 95926412
https://codereview.chromium.org/1190913002/

relnote: QUIC - Added a new flag FLAGS_quic_send_fec_packet_only_on_fec_alarm
to send FEC packet only when FEC timer goes off.

When this flag is on, when FEC timeout goes off, it closes the FEC
group and sends the FEC packet.

Added a new QUIC connection option kFSPA('F', 'S', 'P', 'A') for the
client to set the packet_generator's fec_send_policy to
FEC_ALARM_TRIGGER (this is set only when the above flag is enabled).

Changed QuicConnection's unit tests to run with the following two
send polocies (and in combination with supported QUIC versions).
    FEC_ALARM_TRIGGER and FEC_ANY_TRIGGER

Merge internal change: 95850278
https://codereview.chromium.org/1192463007/

relnote: Remove QuicDataWriter::WriteIOVector, because it's never used.

Merge internal change: 95835632
https://codereview.chromium.org/1188193003/

[email protected]

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

Cr-Commit-Position: refs/heads/master@{#334997}
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index 1eea799..f7437a1 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -21,11 +21,12 @@
 #include "base/logging.h"
 #include "base/strings/string_piece.h"
 #include "net/base/int128.h"
+#include "net/base/iovec.h"
 #include "net/base/ip_endpoint.h"
 #include "net/base/net_export.h"
-#include "net/quic/iovector.h"
 #include "net/quic/quic_bandwidth.h"
 #include "net/quic/quic_time.h"
+#include "net/quic/quic_types.h"
 
 namespace net {
 
@@ -1014,7 +1015,7 @@
   const EncryptionLevel encryption_level_;
   IsHandshake has_crypto_handshake_;
   bool needs_padding_;
-  // Data referenced by the IOVector of a QuicStreamFrame.
+  // Data referenced by the StringPiece of a QuicStreamFrame.
   std::vector<const char*> stream_data_;
 
   DISALLOW_COPY_AND_ASSIGN(RetransmittableFrames);
@@ -1070,6 +1071,17 @@
   bool is_fec_packet;
 };
 
+// Convenience wrapper to wrap an iovec array and the total length, which must
+// be less than or equal to the actual total length of the iovecs.
+struct NET_EXPORT_PRIVATE QuicIOVector {
+  QuicIOVector(const struct iovec* iov, int iov_count, size_t total_length)
+      : iov(iov), iov_count(iov_count), total_length(total_length) {}
+
+  const struct iovec* iov;
+  const int iov_count;
+  const size_t total_length;
+};
+
 }  // namespace net
 
 #endif  // NET_QUIC_QUIC_PROTOCOL_H_