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 647ebb1b6b70e62d4bdb7f68604e18339b616da0..d9f99290ac57394ec107ef0a5aca942257df15cd 100644 |
--- a/net/quic/chromium/quic_http_stream.cc |
+++ b/net/quic/chromium/quic_http_stream.cc |
@@ -46,6 +46,7 @@ QuicHttpStream::QuicHttpStream( |
const base::WeakPtr<QuicChromiumClientSession>& session) |
: next_state_(STATE_NONE), |
session_(session), |
+ quic_version_(session->GetQuicVersion()), |
session_error_(OK), |
was_handshake_confirmed_(session->IsCryptoHandshakeConfirmed()), |
stream_(nullptr), |
@@ -127,6 +128,26 @@ void QuicHttpStream::OnRendezvousResult(QuicSpdyStream* stream) { |
OnIOComplete(OK); |
} |
+HttpResponseInfo::ConnectionInfo QuicHttpStream::ConnectionInfoFromQuicVersion( |
+ QuicVersion quic_version) { |
+ switch (quic_version) { |
+ case QUIC_VERSION_UNSUPPORTED: |
+ return HttpResponseInfo::CONNECTION_INFO_QUIC_UNKNOWN_VERSION; |
+ case QUIC_VERSION_32: |
+ return HttpResponseInfo::CONNECTION_INFO_QUIC_32; |
+ case QUIC_VERSION_33: |
+ return HttpResponseInfo::CONNECTION_INFO_QUIC_33; |
+ case QUIC_VERSION_34: |
+ return HttpResponseInfo::CONNECTION_INFO_QUIC_34; |
+ case QUIC_VERSION_35: |
+ return HttpResponseInfo::CONNECTION_INFO_QUIC_35; |
+ case QUIC_VERSION_36: |
+ return HttpResponseInfo::CONNECTION_INFO_QUIC_36; |
+ } |
+ NOTREACHED(); |
+ return HttpResponseInfo::CONNECTION_INFO_QUIC_UNKNOWN_VERSION; |
+} |
+ |
int QuicHttpStream::InitializeStream(const HttpRequestInfo* request_info, |
RequestPriority priority, |
const NetLogWithSource& stream_net_log, |
@@ -430,7 +451,7 @@ void QuicHttpStream::Drain(HttpNetworkSession* session) { |
} |
void QuicHttpStream::PopulateNetErrorDetails(NetErrorDetails* details) { |
- details->connection_info = HttpResponseInfo::CONNECTION_INFO_QUIC; |
+ details->connection_info = ConnectionInfoFromQuicVersion(quic_version_); |
if (was_handshake_confirmed_) |
details->quic_connection_error = quic_connection_error_; |
if (session_) { |
@@ -531,6 +552,11 @@ void QuicHttpStream::OnCryptoHandshakeConfirmed() { |
} |
} |
+void QuicHttpStream::OnSuccessfulVersionNegotiation( |
+ const QuicVersion& version) { |
+ quic_version_ = version; |
+} |
+ |
void QuicHttpStream::OnSessionClosed(int error, bool port_migration_detected) { |
Close(false); |
session_error_ = error; |
@@ -788,11 +814,13 @@ int QuicHttpStream::ProcessResponseHeaders(const SpdyHeaderBlock& headers) { |
// Put the peer's IP address and port into the response. |
IPEndPoint address = session_->peer_address(); |
response_info_->socket_address = HostPortPair::FromIPEndPoint(address); |
- response_info_->connection_info = HttpResponseInfo::CONNECTION_INFO_QUIC; |
+ response_info_->connection_info = |
+ ConnectionInfoFromQuicVersion(quic_version_); |
response_info_->vary_data.Init(*request_info_, |
*response_info_->headers.get()); |
response_info_->was_alpn_negotiated = true; |
- response_info_->alpn_negotiated_protocol = "quic/1+spdy/3"; |
+ response_info_->alpn_negotiated_protocol = |
+ HttpResponseInfo::ConnectionInfoToString(response_info_->connection_info); |
response_info_->response_time = base::Time::Now(); |
response_info_->request_time = request_time_; |
response_headers_received_ = true; |