diff options
author | rtenneti@google.com <rtenneti@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 17:50:51 +0000 |
---|---|---|
committer | rtenneti@google.com <rtenneti@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-20 17:50:51 +0000 |
commit | c30bcce5bcaac902a63146da6151494b832bac13 (patch) | |
tree | f33179c11efe6383ada786fb201fc4a3e5e543e3 /net/http/http_response_info.cc | |
parent | ebc463107e2892419d560195b8325ba4c3229599 (diff) | |
download | chromium_src-c30bcce5bcaac902a63146da6151494b832bac13.zip chromium_src-c30bcce5bcaac902a63146da6151494b832bac13.tar.gz chromium_src-c30bcce5bcaac902a63146da6151494b832bac13.tar.bz2 |
Added protocol_version negotiated with the server.
protocol_version will be printed by the LoadTimes
extension.
R=willchan
BUG=108134
TEST=network unittests
Review URL: http://codereview.chromium.org/8914005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115145 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_info.cc')
-rw-r--r-- | net/http/http_response_info.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc index 2496731..50cd388 100644 --- a/net/http/http_response_info.cc +++ b/net/http/http_response_info.cc @@ -62,6 +62,9 @@ enum { // protocol version, compression method and whether SSLv3 fallback was used. RESPONSE_INFO_HAS_SSL_CONNECTION_STATUS = 1 << 16, + // This bit is set if the response info has protocol version. + RESPONSE_INFO_HAS_NPN_NEGOTIATED_PROTOCOL = 1 << 17, + // TODO(darin): Add other bits to indicate alternate request methods. // For now, we don't support storing those. }; @@ -79,6 +82,7 @@ HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) was_npn_negotiated(rhs.was_npn_negotiated), was_fetched_via_proxy(rhs.was_fetched_via_proxy), socket_address(rhs.socket_address), + npn_negotiated_protocol(rhs.npn_negotiated_protocol), request_time(rhs.request_time), response_time(rhs.response_time), auth_challenge(rhs.auth_challenge), @@ -98,6 +102,7 @@ HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { was_npn_negotiated = rhs.was_npn_negotiated; was_fetched_via_proxy = rhs.was_fetched_via_proxy; socket_address = rhs.socket_address; + npn_negotiated_protocol = rhs.npn_negotiated_protocol; request_time = rhs.request_time; response_time = rhs.response_time; auth_challenge = rhs.auth_challenge; @@ -190,6 +195,12 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, return false; } + // read protocol-version. + if (flags & RESPONSE_INFO_HAS_NPN_NEGOTIATED_PROTOCOL) { + if (!pickle.ReadString(&iter, &npn_negotiated_protocol)) + return false; + } + was_fetched_via_spdy = (flags & RESPONSE_INFO_WAS_SPDY) != 0; was_npn_negotiated = (flags & RESPONSE_INFO_WAS_NPN) != 0; @@ -219,8 +230,10 @@ void HttpResponseInfo::Persist(Pickle* pickle, flags |= RESPONSE_INFO_TRUNCATED; if (was_fetched_via_spdy) flags |= RESPONSE_INFO_WAS_SPDY; - if (was_npn_negotiated) + if (was_npn_negotiated) { flags |= RESPONSE_INFO_WAS_NPN; + flags |= RESPONSE_INFO_HAS_NPN_NEGOTIATED_PROTOCOL; + } if (was_fetched_via_proxy) flags |= RESPONSE_INFO_WAS_PROXY; @@ -256,6 +269,9 @@ void HttpResponseInfo::Persist(Pickle* pickle, pickle->WriteString(socket_address.host()); pickle->WriteUInt16(socket_address.port()); + + if (was_npn_negotiated) + pickle->WriteString(npn_negotiated_protocol); } } // namespace net |