Index: net/quic/chromium/quic_http_stream.cc |
diff --git a/net/quic/chromium/quic_http_stream.cc b/net/quic/chromium/quic_http_stream.cc |
index 9ec364ce0833da527ac00ce86cea55bbf0ba219a..6f775cfd995c4cb3184436f7b41c3b324f083797 100644 |
--- a/net/quic/chromium/quic_http_stream.cc |
+++ b/net/quic/chromium/quic_http_stream.cc |
@@ -58,6 +58,7 @@ QuicHttpStream::QuicHttpStream( |
headers_bytes_sent_(0), |
closed_stream_received_bytes_(0), |
closed_stream_sent_bytes_(0), |
+ closed_stream_id_(kInvalidStreamId), |
user_buffer_len_(0), |
quic_connection_error_(QUIC_NO_ERROR), |
port_migration_detected_(false), |
@@ -416,7 +417,18 @@ int64_t QuicHttpStream::GetTotalSentBytes() const { |
} |
bool QuicHttpStream::GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const { |
- // TODO(mmenke): Figure out what to do here. |
+ QuicStreamId stream_id = closed_stream_id_; |
+ if (stream_) |
+ stream_id = stream_->id(); |
+ // If stream failed to be negotiated, return false. |
+ if (stream_id == kInvalidStreamId) |
+ return false; |
+ if (QuicChromiumClientStream::isFirstStream(stream_id)) { |
+ load_timing_info->socket_reused = false; |
+ load_timing_info->connect_timing = connect_timing_; |
Ryan Hamilton
2016/09/09 22:05:39
I'm not sure what the semantics should be for conn
|
+ } else { |
+ load_timing_info->socket_reused = true; |
+ } |
return true; |
} |
@@ -641,6 +653,7 @@ int QuicHttpStream::DoStreamRequest() { |
return was_handshake_confirmed_ ? ERR_CONNECTION_CLOSED |
: ERR_QUIC_HANDSHAKE_FAILED; |
} |
+ connect_timing_ = session_->GetConnectTiming(); |
int rv = stream_request_.StartRequest( |
session_, &stream_, |
base::Bind(&QuicHttpStream::OnStreamReady, weak_factory_.GetWeakPtr())); |
@@ -834,6 +847,7 @@ void QuicHttpStream::ResetStream() { |
return; |
closed_stream_received_bytes_ = stream_->stream_bytes_read(); |
closed_stream_sent_bytes_ = stream_->stream_bytes_written(); |
+ closed_stream_id_ = stream_->id(); |
stream_ = nullptr; |
// If |request_body_stream_| is non-NULL, Reset it, to abort any in progress |