diff options
author | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-11 21:34:46 +0000 |
---|---|---|
committer | mbelshe@google.com <mbelshe@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-11 21:34:46 +0000 |
commit | 9fc38b3ac8e8c9cfad867a1177d5b295a7646b57 (patch) | |
tree | db1f4d7ba7b87cf2f006f608448ba92ba596fe64 /net/http/http_response_info.cc | |
parent | e1c16492b1113c01e7467eaa526a01db85bf6470 (diff) | |
download | chromium_src-9fc38b3ac8e8c9cfad867a1177d5b295a7646b57.zip chromium_src-9fc38b3ac8e8c9cfad867a1177d5b295a7646b57.tar.gz chromium_src-9fc38b3ac8e8c9cfad867a1177d5b295a7646b57.tar.bz2 |
Enable JS detection of whether SPDY was used to load a web page.
Augments the loadTimes() API with a new field, "wasFetchedViaSpdy".
BUG=31615
TEST=flip_network_transaction_unittest
Review URL: http://codereview.chromium.org/518039
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35943 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_info.cc')
-rw-r--r-- | net/http/http_response_info.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc index cf6a363..873d017 100644 --- a/net/http/http_response_info.cc +++ b/net/http/http_response_info.cc @@ -38,6 +38,9 @@ enum { // This bit is set if the request was cancelled before completion. RESPONSE_INFO_TRUNCATED = 1 << 12, + // This bit is set if the response was received via SPDY. + RESPONSE_INFO_WAS_SPDY = 1 << 13, + // TODO(darin): Add other bits to indicate alternate request methods. // For now, we don't support storing those. }; @@ -103,6 +106,8 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, return false; } + was_fetched_via_spdy = (flags & RESPONSE_INFO_WAS_SPDY) != 0; + *response_truncated = (flags & RESPONSE_INFO_TRUNCATED) ? true : false; return true; @@ -122,6 +127,8 @@ void HttpResponseInfo::Persist(Pickle* pickle, flags |= RESPONSE_INFO_HAS_VARY_DATA; if (response_truncated) flags |= RESPONSE_INFO_TRUNCATED; + if (was_fetched_via_spdy) + flags |= RESPONSE_INFO_WAS_SPDY; pickle->WriteInt(flags); pickle->WriteInt64(request_time.ToInternalValue()); |