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

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: 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
Index: net/quic/quic_http_stream.cc
diff --git a/net/quic/quic_http_stream.cc b/net/quic/quic_http_stream.cc
index 0bec563cb3b543e549ba2b1dbdf7020d3e413cfa..de1db7c982b3369621de2732b6ca601e3a38116b 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();
Ryan Hamilton 2016/06/23 18:23:18 Doesn't move do the equivalent of clear()? maybe n
Bence 2016/06/23 23:36:16 I believe the convention is that the moved-from ob
Ryan Hamilton 2016/06/24 00:24:07 Ah! Right. So clear() in this case was to ensure t
Bence 2016/06/24 11:01:42 Done.
return static_cast<int>(frame_len);
}

Powered by Google App Engine
This is Rietveld 408576698