Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: net/http/http_response_info.cc

Issue 6369003: New extension API: "tab.socketAddress" (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_response_info.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « net/http/http_response_info.h ('k') | net/http/http_stream_parser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698