Landing Recent QUIC changes until 3/28/2016 18:39 UTC

Deprecate FLAGS_quic_dont_limit_max_cwnd.

Removing the limit had no effect on QUIC retransmit rates.

Merge internal change: 118377740
https://codereview.chromium.org/1849543004/

clean up #includes and namespace for std usage in QUIC code; no behavior change.

* Add includes (list, vector, string, deque, algorithm) where needed.
* Remove includes where not needed, for example, in .cc if already
  included in .h
* Add using std::list where makes sense.
* Add namespace qualifier to list where there is no using directive.

Merge internal change: 118254530
https://codereview.chromium.org/1849443004/

Fix flaky test.

Problem: The end_to_end BandwidthEstimate test was occasionally
disconnecting the client before it had received its ServerConfigUpdate
(scup) message.

Solution:  Added client member state to track the number of scup
messages received.  The client now waits for this counter to increase
from zero to one before disconnecting and checking its state.

Merge internal change: 118240946
https://codereview.chromium.org/1850563002/

Introduce a QUIC_ATTEMPT_TO_SEND_UNENCRYPTED_STREAM_DATA error code to disambiguate "Attempted to send unencrypted stream data and did not" from "recieved unencrypted stream data".

Merge internal change: 118076629

add logging for quic QUIC_UNENCRYPTED_STREAM_DATA and clean up more QUIC_BUGs

This mostly involves plumbing QUIC connection close error_details string
through a bunch of different APIs.

Merge internal change: 118059765
https://codereview.chromium.org/1849563003/

Add comments in QuicSpdyStream when parse status code.

n/a (comment-only change)

Merge internal change: 118050732
https://codereview.chromium.org/1850533002/

Enforce strict three-digit-integer check for response status code per https://tools.ietf.org/html/rfc7231#section-6.

Merge internal change: 118045091
https://codereview.chromium.org/1839423003/

Move QUIC connection close DLOG from SendConnectionClosePacket to CloseConnection, which is now the single path through which (almost) all connection closes take place.

n/a (debug logging)

Merge internal change: 118027993
https://codereview.chromium.org/1846763002/

Changing error strings for QUIC connection closes and QUIC_BUGs.

Move duplicated strings into variables, adds periods to the
end of some CloseConnection strings.

Merge internal change: 118025806
https://codereview.chromium.org/1848633002/

Make QuicConnection::SendConnectionClosePacket a protected method. No behavior change.

This is one of the final steps in simplifying how a QuicConnection is
closed. Now there is a single public method, CloseConnection. The GFE still can
send close packets only in rapid shutdown, but this is not exposed in the base
class.

Merge internal change: 118022182
https://codereview.chromium.org/1841313005/

Adds {} around single line if statements. No behavior change.

Merge internal change: 117958861
https://codereview.chromium.org/1846583003/

Makes QuicConnection::TearDownLocalConnectionState a private method. Previous callers now call CloseConnection with connection_close_behavior set to SILENT_CLOSE. No behavior change.

Merge internal change: 117956256
https://codereview.chromium.org/1844433002/

Add logging when QuicSpdyClientStream receives invalid data.

n/a (debug logging)

Merge internal change: 117942577
https://codereview.chromium.org/1834193003/

Refactor of connection migration code to move witnessing and validation of peer address migration from GfeQuicConnection into QuicConnection. A minor change in functionality is being introduced -- a successful peer migration is now recorded only on successfully decrypting received packets.

Merge internal change: 117886133
https://codereview.chromium.org/1835843004/

Rename QuicConnection::SendConnectionCloseWithDetails to simply CloseConnection. No behavior change.

This is by far the most common way a connection is closed, and aside
from making the method name shorter, this name is more general: it
doesn't just send a connection close, it also tears down local state.

A followup CL will introduce a silent_close argument to CloseConnection,
and make TearDownLocalConnectionState a private method.

Merge internal change: 117858120
https://codereview.chromium.org/1837953003/

Rename QuicConnection::CloseConnection to TearDownLocalConnectionState, to hopefully better reflect what it actually does. No behavior change.

Merge internal change: 117841956
https://codereview.chromium.org/1836153002/

Deprecate FLAGS_quic_save_initial_subkey_secret

Merge internal change: 117764406
https://codereview.chromium.org/1835423002/

Still more logs for QUIC's unencrypted data debugging

Merge internal change: 117753548
https://codereview.chromium.org/1837043002/

BUG=

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

Cr-Commit-Position: refs/heads/master@{#384334}
diff --git a/net/tools/quic/quic_simple_server_session.cc b/net/tools/quic/quic_simple_server_session.cc
index 5b5b57e..38dac8e 100644
--- a/net/tools/quic/quic_simple_server_session.cc
+++ b/net/tools/quic/quic_simple_server_session.cc
@@ -50,8 +50,9 @@
 void QuicSimpleServerSession::OnStreamFrame(const QuicStreamFrame& frame) {
   if (!IsIncomingStream(frame.stream_id)) {
     LOG(WARNING) << "Client shouldn't send data on server push stream";
-    connection()->SendConnectionCloseWithDetails(
-        QUIC_INVALID_STREAM_ID, "Client sent data on server push stream");
+    connection()->CloseConnection(
+        QUIC_INVALID_STREAM_ID, "Client sent data on server push stream",
+        ConnectionCloseBehavior::SEND_CONNECTION_CLOSE_PACKET);
     return;
   }
   QuicSpdySession::OnStreamFrame(frame);
@@ -59,7 +60,7 @@
 
 void QuicSimpleServerSession::PromisePushResources(
     const string& request_url,
-    const list<QuicInMemoryCache::ServerPushInfo>& resources,
+    const std::list<QuicInMemoryCache::ServerPushInfo>& resources,
     QuicStreamId original_stream_id,
     const SpdyHeaderBlock& original_request_headers) {
   for (QuicInMemoryCache::ServerPushInfo resource : resources) {