summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/io_thread.cc4
-rw-r--r--chrome/browser/io_thread.h1
-rw-r--r--chrome/browser/resources/net_internals/quic_view.html1
-rw-r--r--chrome/browser/resources/net_internals/quic_view.js5
-rw-r--r--chrome/common/chrome_switches.cc4
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--net/http/http_network_session.cc7
-rw-r--r--net/http/http_network_session.h1
-rw-r--r--net/quic/quic_stream_factory.cc7
-rw-r--r--net/quic/quic_stream_factory.h6
-rw-r--r--net/quic/quic_stream_factory_test.cc2
11 files changed, 32 insertions, 7 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index c55cf8b0..cd6d292 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -520,6 +520,9 @@ void IOThread::Init() {
GetSwitchValueAsInt(command_line,
switches::kOriginPortToForceQuicOn));
}
+ if (command_line.HasSwitch(switches::kUseSpdyOverQuic)) {
+ globals_->use_spdy_over_quic.set(true);
+ }
InitializeNetworkOptions(command_line);
@@ -824,6 +827,7 @@ void IOThread::InitializeNetworkSessionParams(
&params->spdy_default_protocol);
globals_->origin_port_to_force_quic_on.CopyToIfSet(
&params->origin_port_to_force_quic_on);
+ globals_->use_spdy_over_quic.CopyToIfSet(&params->use_spdy_over_quic);
}
net::SSLConfigService* IOThread::GetSSLConfigService() {
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index ec09bd8..df89dde 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -161,6 +161,7 @@ class IOThread : public content::BrowserThreadDelegate {
Optional<bool> enable_spdy_ping_based_connection_checking;
Optional<net::NextProto> spdy_default_protocol;
Optional<uint16> origin_port_to_force_quic_on;
+ Optional<bool> use_spdy_over_quic;
// NetErrorTabHelper uses |dns_probe_service| to send DNS probes when a
// main frame load fails with a DNS error in order to provide more useful
// information to the renderer so it can show a more specific error page.
diff --git a/chrome/browser/resources/net_internals/quic_view.html b/chrome/browser/resources/net_internals/quic_view.html
index a84bebc..c212f22 100644
--- a/chrome/browser/resources/net_internals/quic_view.html
+++ b/chrome/browser/resources/net_internals/quic_view.html
@@ -2,6 +2,7 @@
<h4>QUIC Status</h4>
<ul>
<li>QUIC Enabled: <span id=quic-view-enabled-span>????</span></li>
+ <li>Use SPDY over QUIC: <span id=quic-view-use-spdy-over-quic-span>????</span></li>
<li>Origin Port To Force QUIC On: <span id=quic-view-force-port-span>????</span></li>
</ul>
diff --git a/chrome/browser/resources/net_internals/quic_view.js b/chrome/browser/resources/net_internals/quic_view.js
index a365ca3..e501d3a 100644
--- a/chrome/browser/resources/net_internals/quic_view.js
+++ b/chrome/browser/resources/net_internals/quic_view.js
@@ -24,6 +24,7 @@ var QuicView = (function() {
g_browser.addQuicInfoObserver(this, true);
this.quicEnabledSpan_ = $(QuicView.ENABLED_SPAN_ID);
+ this.quicUseSpdyOverQuicSpan_ = $(QuicView.USE_SPDY_OVER_QUIC_SPAN_ID);
this.quicForcePortSpan_ = $(QuicView.FORCE_PORT_SPAN_ID);
this.quicSessionNoneSpan_ = $(QuicView.SESSION_NONE_SPAN_ID);
@@ -37,6 +38,7 @@ var QuicView = (function() {
// IDs for special HTML elements in quic_view.html
QuicView.MAIN_BOX_ID = 'quic-view-tab-content';
QuicView.ENABLED_SPAN_ID = 'quic-view-enabled-span';
+ QuicView.USE_SPDY_OVER_QUIC_SPAN_ID = 'quic-view-use-spdy-over-quic-span';
QuicView.FORCE_PORT_SPAN_ID = 'quic-view-force-port-span';
QuicView.SESSION_NONE_SPAN_ID = 'quic-view-session-none-span';
QuicView.SESSION_LINK_SPAN_ID = 'quic-view-session-link-span';
@@ -69,7 +71,8 @@ var QuicView = (function() {
if (!quicInfo)
return false;
- this.quicEnabledSpan_.textContent = quicInfo.quic_enabled;
+ this.quicEnabledSpan_.textContent = !!quicInfo.quic_enabled;
+ this.quicUseSpdyOverQuicSpan_.textContent = !!quicInfo.use_spdy_over_quic;
this.quicForcePortSpan_.textContent =
quicInfo.origin_port_to_force_quic_on;
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 3e99b984a..776bed4 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -1313,6 +1313,10 @@ const char kUninstall[] = "uninstall";
// testing flag.
const char kUseSpdy[] = "use-spdy";
+// Uses Spdy for encoding QUIC requests instead of HTTP. This is a temporary
+// testing flag.
+const char kUseSpdyOverQuic[] = "use-spdy-over-quic";
+
// Disables use of the spelling web service and only provides suggestions.
// This will only work if asynchronous spell checking is not disabled.
const char kUseSpellingSuggestions[] = "use-spelling-suggestions";
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 0b57ac3..a49aa20 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -350,6 +350,7 @@ extern const char kTrustedSpdyProxy[];
extern const char kTryChromeAgain[];
extern const char kUninstall[];
extern const char kUseSpdy[];
+extern const char kUseSpdyOverQuic[];
extern const char kUseSpellingSuggestions[];
extern const char kMaxSpdySessionsPerDomain[];
extern const char kMaxSpdyConcurrentStreams[];
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index b12a1ee..1111562 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -80,7 +80,8 @@ HttpNetworkSession::Params::Params()
spdy_initial_max_concurrent_streams(0),
spdy_max_concurrent_streams_limit(0),
time_func(&base::TimeTicks::Now),
- origin_port_to_force_quic_on(0) {
+ origin_port_to_force_quic_on(0),
+ use_spdy_over_quic(false) {
}
// TODO(mbelshe): Move the socket factories into HttpStreamFactory.
@@ -100,7 +101,8 @@ HttpNetworkSession::HttpNetworkSession(const Params& params)
quic_stream_factory_(params.host_resolver,
net::ClientSocketFactory::GetDefaultFactory(),
QuicRandom::GetInstance(),
- new QuicClock()),
+ new QuicClock(),
+ params.use_spdy_over_quic),
spdy_session_pool_(params.host_resolver,
params.ssl_config_service,
params.http_server_properties,
@@ -185,6 +187,7 @@ Value* HttpNetworkSession::QuicInfoToValue() const {
dict->SetBoolean("quic_enabled", params_.origin_port_to_force_quic_on != 0);
dict->SetInteger("origin_port_to_force_quic_on",
params_.origin_port_to_force_quic_on);
+ dict->SetBoolean("use_spdy_over_quic", params_.use_spdy_over_quic);
return dict;
}
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index 8a15c9c8..1004ab4 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -81,6 +81,7 @@ class NET_EXPORT HttpNetworkSession
SpdySessionPool::TimeFunc time_func;
std::string trusted_spdy_proxy;
uint16 origin_port_to_force_quic_on;
+ bool use_spdy_over_quic;
};
enum SocketPoolType {
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index e9908be..db84d74 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -219,11 +219,13 @@ QuicStreamFactory::QuicStreamFactory(
HostResolver* host_resolver,
ClientSocketFactory* client_socket_factory,
QuicRandom* random_generator,
- QuicClock* clock)
+ QuicClock* clock,
+ bool use_spdy_over_quic)
: host_resolver_(host_resolver),
client_socket_factory_(client_socket_factory),
random_generator_(random_generator),
clock_(clock),
+ use_spdy_over_quic_(use_spdy_over_quic),
ALLOW_THIS_IN_INITIALIZER_LIST(weak_factory_(this)) {
}
@@ -300,7 +302,8 @@ scoped_ptr<QuicHttpStream> QuicStreamFactory::CreateIfSessionExists(
QuicClientSession* session = active_sessions_[host_port_proxy_pair];
DCHECK(session);
return scoped_ptr<QuicHttpStream>(
- new QuicHttpStream(session->CreateOutgoingReliableStream(), true));
+ new QuicHttpStream(session->CreateOutgoingReliableStream(),
+ use_spdy_over_quic_));
}
void QuicStreamFactory::OnIdleSession(QuicClientSession* session) {
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index 077835d..073286c 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -64,7 +64,8 @@ class NET_EXPORT_PRIVATE QuicStreamFactory {
QuicStreamFactory(HostResolver* host_resolver,
ClientSocketFactory* client_socket_factory,
QuicRandom* random_generator,
- QuicClock* clock);
+ QuicClock* clock,
+ bool use_spdy_over_quic);
virtual ~QuicStreamFactory();
// Creates a new QuicHttpStream to |host_port_proxy_pair| which will be
@@ -131,6 +132,9 @@ class NET_EXPORT_PRIVATE QuicStreamFactory {
JobRequestsMap job_requests_map_;
RequestMap active_requests_;
+ // True of request should be encoded using SPDY header blocks.
+ bool use_spdy_over_quic_;
+
base::WeakPtrFactory<QuicStreamFactory> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(QuicStreamFactory);
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index fdae38d..3c88467 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -25,7 +25,7 @@ class QuicStreamFactoryTest : public ::testing::Test {
QuicStreamFactoryTest()
: clock_(new MockClock()),
factory_(&host_resolver_, &socket_factory_,
- &random_generator_, clock_),
+ &random_generator_, clock_, false),
host_port_proxy_pair_(HostPortPair("www.google.com", 443),
ProxyServer::Direct()) {
}