Landing Recent QUIC changes until 03:18 AM, May 28, UTC
Flags updated.
https://codereview.chromium.org/2920713002/
Default to BBR congestion control for QUIC. Protected by
FLAGS_quic_reloadable_flag_quic_default_to_bbr.
Merge internal change: 157287886
https://codereview.chromium.org/2917823004/
Remove is_deletable_ from QuicStream. Add QuicStream::IsWaitingForAcks which returns true if stream is waiting for acks.
Merge internal change: 157256038
https://codereview.chromium.org/2916233002/
Remove QuicPacketNumberQueue::Complement() because it is no longer
used and will add work to the process of changing over to a deque from
an IntervalSet.
n/a (Test only)
Merge internal change: 157226948
https://codereview.chromium.org/2919733002/
Groundwork for cancelling quartc streams after a deadline is exceeded.
In the quic/quartc wrapper:
- Adds a method to QuartcSessionInterface to cancel a stream by number
- Fixes stream error code reporting
- Fixes spurious reset frames sent with QUIC_RST_STREAM_ACKNOWLEDGEMENT
This is done by number on QuartcSessionInterface instead of by a
method on a stream (or by passing the session a pointer to the stream)
because the quartc session owns quartc streams and may delete them
before the deadline. Under the covers, the CancelStream method resets
a stream with error code 6 (QUIC_STREAM_CANCELLED).
QuartcStream currently only reports a non-zero error code if there's a
connection error. This cl rectifies that by exposing both
stream_error() and connection_error() and letting callers examine
whichever one they want.
Since Quartc only sends on outgoing streams, it never sent a fin on
incoming streams. This led to it not closing incoming streams
cleanly. Whenever it closed an incoming stream, it sent a reset frame
with the error code QUIC_RST_STREAM_ACKNOWLEDGEMENT, in order to
communicate a final byte offset. This isn't necessary, since we never
send anything (the final offset is always 0). Instead, we now close
the reverse direction (sending on inbound streams, receiving on
outbound streams) immediately on stream creation, by simulating a fin.
This prevents spurious reset frames that look like errors.
In quartc:
- Adds CancelStream to the thread-safe wrapper
- Adds an optional parameter to SendOutgoingFrame to set a deadline
- Fixes incorrectly ordered boolean parameters in the
quartc_connection_test
SendOutgoingFrame will now schedule a task to cancel a stream if it is
given a non-infinite deadline. The new deadline parameter defaults to
infinite to preserve current behavior. We'll likely only use this for
video and audio streams, not for data and control streams.
n/a (only linked by quartc)
Merge internal change: 157132817
https://codereview.chromium.org/2913413002/
n/a (test-only change)
Merge internal change: 156881271
https://codereview.chromium.org/2913153003/
Inline methods of QuicBandwidth class. No functional change; not
flag-protected.
Since "B" in "BBR" stands for bandwidth, we've been using
QuicBandwidth class much more actively on the hot paths. The overhead
from calling QuicBandwidth methods started to show up on profiles, so
I've maked a CL to make them all inlined, as it was done with
QuicTime::Delta.
This removes the non-negativity check from the QuicBandwidth
constructor where it would previously result in a QUIC_BUG, since it's
now constexpr.
Merge internal change: 156806926
https://codereview.chromium.org/2921603002/
This QUIC change includes: 1) Change QuicStream's life
time. QuicStream is not deletable when it has unacked data (including
FIN). 2) Closed but not deletable QuicStream is moved to
zombie_streams in QuicSession. 3) Move ack listener to QuicStream. 4)
QuicHeaderStream keeps track of unacked headers which have not null
ack listener. 5) Both QuicStream and QuicSession implement
StreamNotifier which will be notified when stream frame is acked or
retransmitted.
Protected by FLAGS_quic_reloadable_flag_quic_use_stream_notifier.
Merge internal change: 156886444
https://codereview.chromium.org/2915873003/
Move tests from portable_quic to the new quic/quartc wrapper location.
n/a (test only, tests code that is only linked by Quartc)
Merge internal change: 156794055
https://codereview.chromium.org/2915993002/
Use BBR for Quartc congestion control.
We think BBR will do what we want in Quartc: generally avoid queuing
packets in the network and keep RTT low. WebRTC does something
similar with its own bandwidth estimator.
We're starting work to optimize media flow, and we don't want to waste
effort optimizing on top of the wrong congestion control algorithm.
n/a (only linked by quartc)
Merge internal change: 156746324
https://codereview.chromium.org/2912393003/
BUG=
Review-Url: https://codereview.chromium.org/2916033003
Cr-Commit-Position: refs/heads/master@{#476570}
diff --git a/net/quic/quartc/quartc_session_interface.h b/net/quic/quartc/quartc_session_interface.h
index f4d88453..03996e6 100644
--- a/net/quic/quartc/quartc_session_interface.h
+++ b/net/quic/quartc/quartc_session_interface.h
@@ -9,6 +9,8 @@
#include <stdint.h>
#include <string>
+#include "net/quic/core/quic_error_codes.h"
+#include "net/quic/core/quic_types.h"
#include "net/quic/quartc/quartc_stream_interface.h"
namespace net {
@@ -16,7 +18,7 @@
// Given a PacketTransport, provides a way to send and receive separate streams
// of reliable, in-order, encrypted data. For example, this can build on top of
// a WebRTC IceTransport for sending and receiving data over QUIC.
-class QuartcSessionInterface {
+class QUIC_EXPORT_PRIVATE QuartcSessionInterface {
public:
virtual ~QuartcSessionInterface() {}
@@ -48,6 +50,13 @@
virtual QuartcStreamInterface* CreateOutgoingStream(
const OutgoingStreamParameters& params) = 0;
+ // If the given stream is still open, sends a reset frame to cancel it.
+ // Note: This method cancels a stream by QuicStreamId rather than by pointer
+ // (or by a method on QuartcStreamInterface) because QuartcSession (and not
+ // the caller) owns the streams. Streams may finish and be deleted before the
+ // caller tries to cancel them, rendering the caller's pointers invalid.
+ virtual void CancelStream(QuicStreamId stream_id) = 0;
+
// Send and receive packets, like a virtual UDP socket. For example, this
// could be implemented by WebRTC's IceTransport.
class PacketTransport {