Chromium Code Reviews| Index: net/http/http_response_info.cc |
| diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc |
| index 9c33ab4f53e8b0bef1ef03cb6c82cf16f7b6152a..a904b01ddc7bd691729288268b7b234364f6036f 100644 |
| --- a/net/http/http_response_info.cc |
| +++ b/net/http/http_response_info.cc |
| @@ -81,6 +81,10 @@ enum { |
| // This bit is set if the response info has protocol version. |
| RESPONSE_INFO_HAS_NPN_NEGOTIATED_PROTOCOL = 1 << 17, |
| + // This bit is set if the request was overriden from cache due to |
| + // various load flags being set. |
| + RESPONSE_INFO_WAS_CACHE_OVERRIDE = 1 << 18, |
|
rvargas (doing something else)
2013/03/05 02:58:19
This enum is for storing info about this response
Randy Smith (Not in Mondays)
2013/03/05 23:16:14
The enum was used for pickling and unpickling. If
rvargas (doing something else)
2013/03/06 03:11:48
But we don't really want to persist this flag. Tha
Randy Smith (Not in Mondays)
2013/03/06 22:55:55
Done.
|
| + |
| // TODO(darin): Add other bits to indicate alternate request methods. |
| // For now, we don't support storing those. |
| }; |
| @@ -89,7 +93,8 @@ HttpResponseInfo::HttpResponseInfo() |
| : was_cached(false), |
| was_fetched_via_spdy(false), |
| was_npn_negotiated(false), |
| - was_fetched_via_proxy(false) { |
| + was_fetched_via_proxy(false), |
| + was_cache_override(false) { |
| } |
| HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) |
| @@ -97,6 +102,7 @@ HttpResponseInfo::HttpResponseInfo(const HttpResponseInfo& rhs) |
| was_fetched_via_spdy(rhs.was_fetched_via_spdy), |
| was_npn_negotiated(rhs.was_npn_negotiated), |
| was_fetched_via_proxy(rhs.was_fetched_via_proxy), |
| + was_cache_override(rhs.was_cache_override), |
| socket_address(rhs.socket_address), |
| npn_negotiated_protocol(rhs.npn_negotiated_protocol), |
| request_time(rhs.request_time), |
| @@ -117,6 +123,7 @@ HttpResponseInfo& HttpResponseInfo::operator=(const HttpResponseInfo& rhs) { |
| was_fetched_via_spdy = rhs.was_fetched_via_spdy; |
| was_npn_negotiated = rhs.was_npn_negotiated; |
| was_fetched_via_proxy = rhs.was_fetched_via_proxy; |
| + was_cache_override = rhs.was_cache_override; |
| socket_address = rhs.socket_address; |
| npn_negotiated_protocol = rhs.npn_negotiated_protocol; |
| request_time = rhs.request_time; |
| @@ -221,6 +228,8 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle, |
| was_fetched_via_proxy = (flags & RESPONSE_INFO_WAS_PROXY) != 0; |
| + was_cache_override = (flags & RESPONSE_INFO_WAS_CACHE_OVERRIDE) != 0; |
| + |
| *response_truncated = (flags & RESPONSE_INFO_TRUNCATED) != 0; |
| return true; |
| @@ -250,6 +259,8 @@ void HttpResponseInfo::Persist(Pickle* pickle, |
| } |
| if (was_fetched_via_proxy) |
| flags |= RESPONSE_INFO_WAS_PROXY; |
| + if (was_cache_override) |
| + flags |= RESPONSE_INFO_WAS_CACHE_OVERRIDE; |
| pickle->WriteInt(flags); |
| pickle->WriteInt64(request_time.ToInternalValue()); |