Chromium Code Reviews| Index: net/http/http_response_info.cc |
| =================================================================== |
| --- net/http/http_response_info.cc (revision 71766) |
| +++ net/http/http_response_info.cc (working copy) |
| @@ -56,6 +56,9 @@ |
| // will ingore the alternate protocol if spdy is not enabled. |
| RESPONSE_INFO_WAS_ALTERNATE_PROTOCOL_AVAILABLE = 1 << 16, |
| + // This bit is set if the response info has a socket_address string. |
| + RESPONSE_INFO_HAS_SOCKET_ADDRESS = 1 << 17, |
| + |
| // TODO(darin): Add other bits to indicate alternate request methods. |
| // For now, we don't support storing those. |
| }; |
| @@ -74,6 +77,7 @@ |
| was_npn_negotiated(rhs.was_npn_negotiated), |
| was_alternate_protocol_available(rhs.was_alternate_protocol_available), |
| was_fetched_via_proxy(rhs.was_fetched_via_proxy), |
| + socket_address(rhs.socket_address), |
| request_time(rhs.request_time), |
| response_time(rhs.response_time), |
| auth_challenge(rhs.auth_challenge), |
| @@ -93,6 +97,7 @@ |
| was_npn_negotiated = rhs.was_npn_negotiated; |
| was_alternate_protocol_available = rhs.was_alternate_protocol_available; |
| was_fetched_via_proxy = rhs.was_fetched_via_proxy; |
| + socket_address = rhs.socket_address; |
| request_time = rhs.request_time; |
| response_time = rhs.response_time; |
| auth_challenge = rhs.auth_challenge; |
| @@ -158,6 +163,12 @@ |
| return false; |
| } |
| + // read socket_address. |
| + if (flags & RESPONSE_INFO_HAS_SOCKET_ADDRESS) { |
| + if (!pickle.ReadString(&iter, &socket_address)) |
| + return false; |
| + } |
| + |
| was_fetched_via_spdy = (flags & RESPONSE_INFO_WAS_SPDY) != 0; |
| was_npn_negotiated = (flags & RESPONSE_INFO_WAS_NPN) != 0; |
| @@ -195,6 +206,8 @@ |
| flags |= RESPONSE_INFO_WAS_ALTERNATE_PROTOCOL_AVAILABLE; |
| if (was_fetched_via_proxy) |
| flags |= RESPONSE_INFO_WAS_PROXY; |
| + if (!socket_address.empty()) |
| + flags |= RESPONSE_INFO_HAS_SOCKET_ADDRESS; |
|
eroman
2011/01/19 19:21:30
Is the flag necessary? I would expect that pickle-
pmarks
2011/01/21 08:21:56
I added this flag so that it'd be possible to unpi
|
| pickle->WriteInt(flags); |
| pickle->WriteInt64(request_time.ToInternalValue()); |
| @@ -223,6 +236,9 @@ |
| if (vary_data.is_valid()) |
| vary_data.Persist(pickle); |
| + |
| + if (!socket_address.empty()) |
| + pickle->WriteString(socket_address); |
| } |
| } // namespace net |