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

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
« no previous file with comments | « net/quic/quic_chromium_client_stream.h ('k') | net/quic/quic_chromium_client_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a60fc4cc6ba3ad9159b98ddcfae681eaa5509654 100644
--- a/net/quic/quic_chromium_client_stream.cc
+++ b/net/quic/quic_chromium_client_stream.cc
@@ -139,6 +139,27 @@ int QuicChromiumClientStream::WriteStreamData(
return ERR_IO_PENDING;
}
+int QuicChromiumClientStream::WritevStreamData(
+ const std::vector<IOBuffer*>& buffers,
+ const std::vector<int>& lengths,
+ bool fin,
+ const CompletionCallback& callback) {
+ // Must not be called when data is buffered.
+ DCHECK(!HasBufferedData());
+ // Writes the data, or buffers it.
+ for (size_t i = 0; i < buffers.size(); ++i) {
+ bool is_fin = fin && (i == buffers.size() - 1);
+ base::StringPiece string_data(buffers[i]->data(), lengths[i]);
+ WriteOrBufferData(string_data, is_fin, nullptr);
+ }
+ if (!HasBufferedData()) {
+ return OK;
+ }
+
+ callback_ = callback;
+ return ERR_IO_PENDING;
+}
+
void QuicChromiumClientStream::SetDelegate(
QuicChromiumClientStream::Delegate* delegate) {
DCHECK(!(delegate_ && delegate));
« no previous file with comments | « net/quic/quic_chromium_client_stream.h ('k') | net/quic/quic_chromium_client_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698