Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2263)

Unified Diff: net/quic/quic_chromium_client_stream.cc

Issue 1856073002: Coalesce small buffers in net::BidirectionalStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Javadoc Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/quic/quic_chromium_client_stream.cc
diff --git a/net/quic/quic_chromium_client_stream.cc b/net/quic/quic_chromium_client_stream.cc
index 06ec9426df6353c443be8cf3ff5f3162b7d5a2ae..bc53e94c13387ea966722c8e5304c05a9352290f 100644
--- a/net/quic/quic_chromium_client_stream.cc
+++ b/net/quic/quic_chromium_client_stream.cc
@@ -138,6 +138,24 @@ int QuicChromiumClientStream::WriteStreamData(
callback_ = callback;
return ERR_IO_PENDING;
}
+int QuicChromiumClientStream::WritevStreamData(
+ const std::vector<base::StringPiece>& data,
+ bool fin,
+ const CompletionCallback& callback) {
+ // We should not have data buffered.
+ DCHECK(!HasBufferedData());
+ // Writes the data, or buffers it.
+ for (size_t i = 0; i < data.size(); ++i) {
+ bool is_fin = fin && (i == data.size() - 1);
+ WriteOrBufferData(data[i], is_fin, nullptr);
+ }
+ if (!HasBufferedData()) {
+ return OK;
+ }
+
+ callback_ = callback;
+ return ERR_IO_PENDING;
+}
void QuicChromiumClientStream::SetDelegate(
QuicChromiumClientStream::Delegate* delegate) {

Powered by Google App Engine
This is Rietveld 408576698