Prevent DCHECK in WritevStreamData with IETF QUIC

This CL takes the fix to WriteStreamData from
https://crrev.com/c/2549463 and applies it to WritevStreamData.
That CL should have handled both in the first place.

[email protected]

Bug: b/177847150
Change-Id: I68af12826324d493574a681a910358c653a3aff7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2826522
Commit-Queue: David Schinazi <[email protected]>
Commit-Queue: Fan Yang <[email protected]>
Auto-Submit: David Schinazi <[email protected]>
Reviewed-by: Fan Yang <[email protected]>
Cr-Commit-Position: refs/heads/master@{#872522}
diff --git a/net/quic/quic_chromium_client_stream.cc b/net/quic/quic_chromium_client_stream.cc
index 05ca88d..24ed449 100644
--- a/net/quic/quic_chromium_client_stream.cc
+++ b/net/quic/quic_chromium_client_stream.cc
@@ -645,8 +645,9 @@
     const std::vector<scoped_refptr<IOBuffer>>& buffers,
     const std::vector<int>& lengths,
     bool fin) {
-  // Must not be called when data is buffered.
-  DCHECK(!HasBufferedData());
+  // For gQUIC, this must not be called when data is buffered because headers
+  // are sent on the dedicated header stream.
+  DCHECK(!HasBufferedData() || VersionUsesHttp3(quic_version_));
   // Writes the data, or buffers it.
   for (size_t i = 0; i < buffers.size(); ++i) {
     bool is_fin = fin && (i == buffers.size() - 1);