RTCQuicTransport uses proper buffer size constants.

This updates the RTCQuicTransport to use the proper read and write
buffer sizes that are defined in RTCQuicStream.

Bug: 874296
Change-Id: I38fb97cc19c1ed21338b8c0d6ecd03177eb602d8
Reviewed-on: https://chromium-review.googlesource.com/c/1435137
Commit-Queue: Seth Hampson <shampson@chromium.org>
Auto-Submit: Seth Hampson <shampson@chromium.org>
Reviewed-by: Steve Anton <steveanton@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#625942}(cherry picked from commit 35aaf51aa2fe66020b110711ae52a3884446af36)
Reviewed-on: https://chromium-review.googlesource.com/c/1437581
Cr-Commit-Position: refs/branch-heads/3683@{#80}
Cr-Branched-From: e51029943e0a38dd794b73caaf6373d5496ae783-refs/heads/master@{#625896}
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream.cc b/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream.cc
index f8dd776..ca89b40 100644
--- a/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream.cc
+++ b/third_party/blink/renderer/modules/peerconnection/rtc_quic_stream.cc
@@ -11,8 +11,12 @@
 
 namespace blink {
 
-const uint32_t RTCQuicStream::kWriteBufferSize = 4 * 1024;
-const uint32_t RTCQuicStream::kReadBufferSize = 4 * 1024;
+// 6 MB allows a reasonable amount to buffer on the read and write side.
+// TODO(https://crbug.com/874296): Consider exposing these configurations.
+// TODO(shampson): Investigate why wpt get slow throughput when this value
+// is higher (24 MB).
+const uint32_t RTCQuicStream::kWriteBufferSize = 6 * 1024 * 1024;
+const uint32_t RTCQuicStream::kReadBufferSize = 6 * 1024 * 1024;
 
 class RTCQuicStream::PendingReadBufferedAmountPromise
     : public GarbageCollected<PendingReadBufferedAmountPromise> {
diff --git a/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.cc b/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.cc
index b0eb464..0f50373 100644
--- a/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.cc
+++ b/third_party/blink/renderer/modules/peerconnection/rtc_quic_transport.cc
@@ -23,8 +23,6 @@
 namespace {
 // QUIC requires 128 bits of entropy for the pre shared key.
 const size_t kPreSharedKeyLength = 128 / 8;
-// 24 MB allows a reasonable amount to buffer on the read and write side.
-const uint32_t kStreamBufferSize = 24 * 1024 * 1024;
 
 // This class wraps a P2PQuicTransportFactoryImpl but does not construct it
 // until CreateQuicTransport is called for the first time. This ensures that it
@@ -290,8 +288,8 @@
   IceTransportProxy* transport_proxy = transport_->ConnectConsumer(this);
   P2PQuicTransportConfig quic_transport_config(
       perspective, rtc_certificates,
-      /*stream_delegate_read_buffer_size_in=*/kStreamBufferSize,
-      /*stream_write_buffer_size_in=*/kStreamBufferSize);
+      /*stream_delegate_read_buffer_size_in=*/RTCQuicStream::kReadBufferSize,
+      /*stream_write_buffer_size_in=*/RTCQuicStream::kWriteBufferSize);
   proxy_.reset(new QuicTransportProxy(this, transport_proxy,
                                       std::move(p2p_quic_transport_factory_),
                                       quic_transport_config));