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

Unified Diff: net/spdy/spdy_stream.cc

Issue 2169583002: Eliminate SpdyHeaderBlock copy in SpdyStream. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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/spdy/spdy_stream.h ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_stream.cc
diff --git a/net/spdy/spdy_stream.cc b/net/spdy/spdy_stream.cc
index fd17850580158cc9b336c24f2e6d791532200f40..35b84f6a2ac0a75866b95ddfdb13d97c774223e1 100644
--- a/net/spdy/spdy_stream.cc
+++ b/net/spdy/spdy_stream.cc
@@ -209,7 +209,8 @@ std::unique_ptr<SpdySerializedFrame> SpdyStream::ProduceSynStreamFrame() {
(pending_send_status_ == NO_MORE_DATA_TO_SEND) ?
CONTROL_FLAG_FIN : CONTROL_FLAG_NONE;
std::unique_ptr<SpdySerializedFrame> frame(session_->CreateSynStream(
- stream_id_, priority_, flags, request_headers_.Clone()));
+ stream_id_, priority_, flags, std::move(request_headers_)));
+ request_headers_valid_ = false;
send_time_ = base::TimeTicks::Now();
return frame;
}
@@ -473,6 +474,7 @@ void SpdyStream::OnPushPromiseHeadersReceived(const SpdyHeaderBlock& headers) {
io_state_ = STATE_RESERVED_REMOTE;
request_headers_ = headers.Clone();
request_headers_valid_ = true;
+ url_from_header_block_ = GetUrlFromHeaderBlock(request_headers_);
}
void SpdyStream::OnDataReceived(std::unique_ptr<SpdyBuffer> buffer) {
@@ -691,6 +693,7 @@ int SpdyStream::SendRequestHeaders(SpdyHeaderBlock request_headers,
CHECK_EQ(io_state_, STATE_IDLE);
request_headers_ = std::move(request_headers);
request_headers_valid_ = true;
+ url_from_header_block_ = GetUrlFromHeaderBlock(request_headers_);
pending_send_status_ = send_status;
session_->EnqueueStreamWrite(GetWeakPtr(), SYN_STREAM,
std::unique_ptr<SpdyBufferProducer>(
@@ -775,17 +778,6 @@ bool SpdyStream::GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const {
return result;
}
-GURL SpdyStream::GetUrlFromHeaders() const {
- if (!request_headers_valid_)
- return GURL();
-
- return GetUrlFromHeaderBlock(request_headers_);
-}
-
-bool SpdyStream::HasUrlFromHeaders() const {
- return !GetUrlFromHeaders().is_empty();
-}
-
void SpdyStream::UpdateHistograms() {
// We need at least the receive timers to be filled in, as otherwise
// metrics can be bogus.
« no previous file with comments | « net/spdy/spdy_stream.h ('k') | net/spdy/spdy_stream_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698