summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 02:08:35 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-21 02:08:35 +0000
commit0b0c008023454cbb6c9328f23bda8422db46bebd (patch)
tree38e540f1b037f969c76b214cb779b3a438449fdd /net/http
parenta2c2bfdd83030cd9063926f899c28db419ff35ae (diff)
downloadchromium_src-0b0c008023454cbb6c9328f23bda8422db46bebd.zip
chromium_src-0b0c008023454cbb6c9328f23bda8422db46bebd.tar.gz
chromium_src-0b0c008023454cbb6c9328f23bda8422db46bebd.tar.bz2
Track whether a resource was loaded via a proxy. I'm going to use
this so I can more precisely refine some histograms and filter whether individual resources came through proxies or not. BUG=none TEST=none Review URL: http://codereview.chromium.org/2097012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47877 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_network_transaction.cc2
-rw-r--r--net/http/http_response_info.cc10
-rw-r--r--net/http/http_response_info.h9
3 files changed, 18 insertions, 3 deletions
diff --git a/net/http/http_network_transaction.cc b/net/http/http_network_transaction.cc
index d6c0d5f1..c8c210e 100644
--- a/net/http/http_network_transaction.cc
+++ b/net/http/http_network_transaction.cc
@@ -841,6 +841,8 @@ int HttpNetworkTransaction::DoInitConnection() {
endpoint_.port = session_->fixed_http_port();
}
+ response_.was_fetched_via_proxy = !proxy_info_.is_direct();
+
// Check first if we have a spdy session for this group. If so, then go
// straight to using that.
if (session_->spdy_session_pool()->HasSession(endpoint_)) {
diff --git a/net/http/http_response_info.cc b/net/http/http_response_info.cc
index 1a548b1..3ce8cdd 100644
--- a/net/http/http_response_info.cc
+++ b/net/http/http_response_info.cc
@@ -41,13 +41,17 @@ enum {
// This bit is set if the response was received via SPDY.
RESPONSE_INFO_WAS_SPDY = 1 << 13,
+ // This bit is set if the response was received via SPDY.
+ RESPONSE_INFO_WAS_PROXY = 1 << 15,
+
// TODO(darin): Add other bits to indicate alternate request methods.
// For now, we don't support storing those.
};
HttpResponseInfo::HttpResponseInfo()
: was_cached(false),
- was_fetched_via_spdy(false) {
+ was_fetched_via_spdy(false),
+ was_fetched_via_proxy(false) {
}
HttpResponseInfo::~HttpResponseInfo() {
@@ -109,6 +113,8 @@ bool HttpResponseInfo::InitFromPickle(const Pickle& pickle,
was_fetched_via_spdy = (flags & RESPONSE_INFO_WAS_SPDY) != 0;
+ was_fetched_via_proxy = (flags & RESPONSE_INFO_WAS_PROXY) != 0;
+
*response_truncated = (flags & RESPONSE_INFO_TRUNCATED) ? true : false;
return true;
@@ -130,6 +136,8 @@ void HttpResponseInfo::Persist(Pickle* pickle,
flags |= RESPONSE_INFO_TRUNCATED;
if (was_fetched_via_spdy)
flags |= RESPONSE_INFO_WAS_SPDY;
+ if (was_fetched_via_proxy)
+ flags |= RESPONSE_INFO_WAS_PROXY;
pickle->WriteInt(flags);
pickle->WriteInt64(request_time.ToInternalValue());
diff --git a/net/http/http_response_info.h b/net/http/http_response_info.h
index 201595c..a61c299 100644
--- a/net/http/http_response_info.h
+++ b/net/http/http_response_info.h
@@ -28,13 +28,18 @@ class HttpResponseInfo {
// request_time may corresponds to a time "far" in the past. Note that
// stale content (perhaps un-cacheable) may be fetched from cache subject to
// the load flags specified on the request info. For example, this is done
- // when a user presses the back button to re-render pages, or at startup, when
- // reloading previously visited pages (without going over the network).
+ // when a user presses the back button to re-render pages, or at startup,
+ // when reloading previously visited pages (without going over the network).
bool was_cached;
// True if the request was fetched over a SPDY channel.
bool was_fetched_via_spdy;
+ // True if the request was fetched via an explicit proxy. The proxy could
+ // be any type of proxy, HTTP or SOCKS. Note, we do not know if a
+ // transparent proxy may have been involved.
+ bool was_fetched_via_proxy;
+
// The time at which the request was made that resulted in this response.
// For cached responses, this is the last time the cache entry was validated.
base::Time request_time;