summaryrefslogtreecommitdiffstats
path: root/net/http
diff options
context:
space:
mode:
authormbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 18:23:21 +0000
committermbelshe@chromium.org <mbelshe@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-16 18:23:21 +0000
commit17d7d3ab19145001a7d512d3c16982c46463175d (patch)
treef580d12f296990aebd77424f8bdcd9e2e1323b5f /net/http
parentb10c54d852dc3dd198df86430eeeaf5325f3129b (diff)
downloadchromium_src-17d7d3ab19145001a7d512d3c16982c46463175d.zip
chromium_src-17d7d3ab19145001a7d512d3c16982c46463175d.tar.gz
chromium_src-17d7d3ab19145001a7d512d3c16982c46463175d.tar.bz2
The SPDY Exclusions were broken; the intent of the exclusion is so that our
benchmark harness can force SPDY, but still report to the benchmark harness itself in non-spdy mode. BUG=none TEST=none Review URL: http://codereview.chromium.org/6674031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@78400 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http')
-rw-r--r--net/http/http_stream_factory.cc13
-rw-r--r--net/http/http_stream_factory.h5
-rw-r--r--net/http/http_stream_factory_impl.cc15
-rw-r--r--net/http/http_stream_factory_impl_job.cc6
4 files changed, 20 insertions, 19 deletions
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index 9189e99..e5ffc26 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -108,6 +108,19 @@ void HttpStreamFactory::add_forced_spdy_exclusion(const std::string& value) {
}
// static
+bool HttpStreamFactory::HasSpdyExclusion(const HostPortPair& endpoint) {
+ std::list<HostPortPair>* exclusions = forced_spdy_exclusions_;
+ if (!exclusions)
+ return false;
+
+ std::list<HostPortPair>::const_iterator it;
+ for (it = exclusions->begin(); it != exclusions->end(); ++it)
+ if (it->Equals(endpoint))
+ return true;
+ return false;
+}
+
+// static
void HttpStreamFactory::SetHostMappingRules(const std::string& rules) {
HostMappingRules* host_mapping_rules = new HostMappingRules;
host_mapping_rules->SetRulesFromString(rules);
diff --git a/net/http/http_stream_factory.h b/net/http/http_stream_factory.h
index 9268746..eeecf16 100644
--- a/net/http/http_stream_factory.h
+++ b/net/http/http_stream_factory.h
@@ -204,9 +204,8 @@ class HttpStreamFactory {
// Add a URL to exclude from forced SPDY.
static void add_forced_spdy_exclusion(const std::string& value);
- static std::list<HostPortPair>* forced_spdy_exclusions() {
- return forced_spdy_exclusions_;
- }
+ // Check if a HostPortPair is excluded from using spdy.
+ static bool HasSpdyExclusion(const HostPortPair& endpoint);
// Sets the next protocol negotiation value used during the SSL handshake.
static void set_next_protos(const std::string& value) {
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
index 8a1ee60..63db456 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -18,19 +18,6 @@ namespace net {
namespace {
-bool HasSpdyExclusion(const HostPortPair& endpoint) {
- std::list<HostPortPair>* exclusions =
- HttpStreamFactory::forced_spdy_exclusions();
- if (!exclusions)
- return false;
-
- std::list<HostPortPair>::const_iterator it;
- for (it = exclusions->begin(); it != exclusions->end(); it++)
- if (it->Equals(endpoint))
- return true;
- return false;
-}
-
GURL UpgradeUrlToHttps(const GURL& original_url) {
GURL::Replacements replacements;
// new_sheme and new_port need to be in scope here because GURL::Replacements
@@ -158,7 +145,7 @@ bool HttpStreamFactoryImpl::GetAlternateProtocolRequestFor(
return false;
origin.set_port(alternate.port);
- if (HasSpdyExclusion(origin))
+ if (HttpStreamFactory::HasSpdyExclusion(origin))
return false;
*alternate_url = UpgradeUrlToHttps(original_url);
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index f648b81..de7ea92 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -499,11 +499,13 @@ int HttpStreamFactoryImpl::Job::DoResolveProxyComplete(int result) {
}
bool HttpStreamFactoryImpl::Job::ShouldForceSpdySSL() const {
- return force_spdy_always_ && force_spdy_over_ssl_;
+ bool rv = force_spdy_always_ && force_spdy_over_ssl_;
+ return rv && !HttpStreamFactory::HasSpdyExclusion(origin_);
}
bool HttpStreamFactoryImpl::Job::ShouldForceSpdyWithoutSSL() const {
- return force_spdy_always_ && !force_spdy_over_ssl_;
+ bool rv = force_spdy_always_ && !force_spdy_over_ssl_;
+ return rv && !HttpStreamFactory::HasSpdyExclusion(origin_);
}
int HttpStreamFactoryImpl::Job::DoWaitForJob() {