Landing Recent QUIC Changes.

Remove largest_observed_ from QuicSentPacketManager, since it's also in
QuicUnackedPacketMap.

Merge internal change: 73713269
https://codereview.chromium.org/491663003/


Optimize QUIC's EntropyTracker in QuicReceivedPacketManager by using a
deque.

Merge internal change: 73709652
https://codereview.chromium.org/496133002/


Add logic for a client to enable pacing via config to the QUIC sent
packet manager.

Merge internal change: 73685838
https://codereview.chromium.org/497553003/


Clear the QUIC ping alarm when a connection in closed.

Merge internal change: 73684904
https://codereview.chromium.org/475173005/


Rename QuicConnection::OnPacketSent to OnWriteError, to reflect it's
actual functionality, and to only be called when there is an error.
Clean up some logging when packets are sent.

Merge internal change: 73651039
https://codereview.chromium.org/483093004/


Refactor QuicConnection's async write behavior to record a packet as
sent as soon as the write starts, not when it completes.

In QuicStreamFactoryTest, MockClock's now() is returning 0 and that
was causing a DFATAL in QuicUnackedPacketMap::GetLastPacketSentTime().
Noticed, in QuicConnection unittests, we are advancing clock by 1 second
and made a similar change to QuicStreamFactoryTest's MockClock.

Merge internal change: 73648585
https://codereview.chromium.org/473763004/


QUIC minor clean up to keep in sync with internal sources.

+ Use int64 for MaxBandwidthTimestamp (per rjshade).
+ Use DVLOG(1) instead of DLOG(INFO).
+ Reorder class statements.

This CL has changes that were found while merging (or back porting) the
following chroimum specific changes into the internal source tree.

Merge internal change: 73640117
Merge internal change: 73638556
https://codereview.chromium.org/495233002/


Move least_packet_awaited_by_peer_ from QuicReceivedPacketManager to
QuicSentPacketManager.

Merge internal change: 73630593
https://codereview.chromium.org/493183002/


Remove timestamp_receiver. Not used.

Merge internal change: 73627146
https://codereview.chromium.org/495173002/


Remove unused protected received_packet_manager_ accessor in
quic_connection.

Merge internal change: 73626837
https://codereview.chromium.org/496823002/


Convert QUIC's SentEntropyManager to use a deque instead of a map in
order to improve memory and CPU efficiency.

Merge internal change: 73625323
https://codereview.chromium.org/479543004/


When talking >=QUIC_VERSION_22, regularly send updated bandwidth
estimates to the client (in SCUP messages).

The main work is in QuicConnection, where a new alarm regularly checks
for substantially changed bandwidth estimates and sends them to the
client if so. The majority of the rest of this CL is plumbing, and test
code.

Feel free to suggest better values for:
- Timeout between bandwidth estimate alarms
- Definition of "substantial change" in estimate

The flow is:

- on every congestion event (ACK, packet loss) the sent packet manager
  passes a bandwidth estimate to the sustained bandwidth recorder
- on every congestion window change, the QuicServerSession checks to see
  if the bandwidth has changed sufficiently *and* enough time has passed
  since last time we sent an update to the client
- if so, it populates the CachedNetworkParams proto, and passes this to
  the CryptoStream which sends a SCUP message to the client

Merge internal change: 73579021
https://codereview.chromium.org/490263003/

R=rch@chromium.org

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

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291427 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Remove NOTREACHED() in ProxyConnectRedirectHttpStream::GetUploadProgress()

We can hit this, and it seems removing this is fine.

BUG=400968

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

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291439 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Replace StreamListenSocket with StreamSocket in HttpServer.
    
1) HttpServer gets ServerSocket instead of StreamListenSocket.
2) HttpConnection is just a container for socket, websocket, and pending read/write buffers.
3) HttpServer handles data buffering and asynchronous read/write.
4) HttpConnection has limit in data buffering, up to 1Mbytes by default.
5) For devtools, send buffer limit is 100Mbytes.
6) Unittests for buffer handling in HttpConnection.
    
BUG=371906

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

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291447 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Disable an unittest failed on windows build bot.

NOTRY=true
NOTREECHECKS=true

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

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291519 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Revert of Replace StreamListenSocket with StreamSocket in HttpServer. (patchset #29 of https://codereview.chromium.org/296053012/)

Reason for revert:
looks like it caused net_unittests failures: http://build.chromium.org/p/chromium.win/builders/Vista%20Tests%20(2)/builds/44610/steps/net_unittests/logs/MultipleRequestsOnSameConnection

Original issue's description:
> Replace StreamListenSocket with StreamSocket in HttpServer.
>     
> 1) HttpServer gets ServerSocket instead of StreamListenSocket.
> 2) HttpConnection is just a container for socket, websocket, and pending read/write buffers.
> 3) HttpServer handles data buffering and asynchronous read/write.
> 4) HttpConnection has limit in data buffering, up to 1Mbytes by default.
> 5) For devtools, send buffer limit is 100Mbytes.
> 6) Unittests for buffer handling in HttpConnection.
>     
> BUG=371906
> 
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=291447

NOTREECHECKS=true
NOTRY=true
TBR=rsleevi@chromium.org

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

git-svn-id: http://src.chromium.org/svn/trunk/src/net@291521 4ff67af0-8c30-449e-8e8b-ad334ec8d88c