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

Unified Diff: net/quic/quic_http_stream.cc

Issue 2096713002: Reduce SpdyHeaderBlock copies with move semantics. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: clear() does not work after all. Created 4 years, 6 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/bidirectional_stream_quic_impl_unittest.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index c0b30c1c6438b8ce25d9cbe8b8b16ef82919401e..5009a2edf6d22c2576a4dffda433d3e31c94619c 100644
--- a/net/quic/quic_http_stream.cc
+++ b/net/quic/quic_http_stream.cc
@@ -4,6 +4,8 @@
#include "net/quic/quic_http_stream.h"
+#include <utility>
+
#include "base/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/string_split.h"
@@ -678,11 +680,11 @@ int QuicHttpStream::DoSendHeaders() {
bool has_upload_data = request_body_stream_ != nullptr;
next_state_ = STATE_SEND_HEADERS_COMPLETE;
- size_t frame_len =
- stream_->WriteHeaders(request_headers_, !has_upload_data, nullptr);
+ size_t frame_len = stream_->WriteHeaders(std::move(request_headers_),
+ !has_upload_data, nullptr);
headers_bytes_sent_ += frame_len;
- request_headers_.clear();
+ request_headers_ = SpdyHeaderBlock();
return static_cast<int>(frame_len);
}
« no previous file with comments | « net/quic/bidirectional_stream_quic_impl_unittest.cc ('k') | net/quic/quic_http_stream_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698