summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorrch <rch@chromium.org>2015-06-10 14:27:23 -0700
committerCommit bot <commit-bot@chromium.org>2015-06-10 21:28:48 +0000
commit9976b0c7309301acc2d115c3b3856613948488fb (patch)
tree3ad8462518bf4591578b609d768e87128b82d184 /net
parent4f1226d35342914dbbf3decb806d0592838b49c6 (diff)
downloadchromium_src-9976b0c7309301acc2d115c3b3856613948488fb.zip
chromium_src-9976b0c7309301acc2d115c3b3856613948488fb.tar.gz
chromium_src-9976b0c7309301acc2d115c3b3856613948488fb.tar.bz2
Add a new prefer_aes finch options for QUIC.
Review URL: https://codereview.chromium.org/1165283004 Cr-Commit-Position: refs/heads/master@{#333805}
Diffstat (limited to 'net')
-rw-r--r--net/http/http_network_session.cc2
-rw-r--r--net/http/http_network_session.h1
-rw-r--r--net/quic/quic_stream_factory.cc4
-rw-r--r--net/quic/quic_stream_factory.h4
-rw-r--r--net/quic/quic_stream_factory_test.cc1
5 files changed, 11 insertions, 1 deletions
diff --git a/net/http/http_network_session.cc b/net/http/http_network_session.cc
index c3d1f51..4b7edeb 100644
--- a/net/http/http_network_session.cc
+++ b/net/http/http_network_session.cc
@@ -98,6 +98,7 @@ HttpNetworkSession::Params::Params()
quic_enable_connection_racing(false),
quic_enable_non_blocking_io(false),
quic_disable_disk_cache(false),
+ quic_prefer_aes(false),
quic_max_number_of_lossy_connections(0),
quic_packet_loss_threshold(1.0f),
quic_socket_receive_buffer_size(kQuicSocketReceiveBufferSize),
@@ -147,6 +148,7 @@ HttpNetworkSession::HttpNetworkSession(const Params& params)
params.quic_enable_connection_racing,
params.quic_enable_non_blocking_io,
params.quic_disable_disk_cache,
+ params.quic_prefer_aes,
params.quic_max_number_of_lossy_connections,
params.quic_packet_loss_threshold,
params.quic_socket_receive_buffer_size,
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index 5ee2752..3327195 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -115,6 +115,7 @@ class NET_EXPORT HttpNetworkSession
bool quic_enable_connection_racing;
bool quic_enable_non_blocking_io;
bool quic_disable_disk_cache;
+ bool quic_prefer_aes;
int quic_max_number_of_lossy_connections;
float quic_packet_loss_threshold;
int quic_socket_receive_buffer_size;
diff --git a/net/quic/quic_stream_factory.cc b/net/quic/quic_stream_factory.cc
index 23d02cd..e1ca618 100644
--- a/net/quic/quic_stream_factory.cc
+++ b/net/quic/quic_stream_factory.cc
@@ -553,6 +553,7 @@ QuicStreamFactory::QuicStreamFactory(
bool enable_connection_racing,
bool enable_non_blocking_io,
bool disable_disk_cache,
+ bool prefer_aes,
int max_number_of_lossy_connections,
float packet_loss_threshold,
int socket_receive_buffer_size,
@@ -578,6 +579,7 @@ QuicStreamFactory::QuicStreamFactory(
enable_connection_racing_(enable_connection_racing),
enable_non_blocking_io_(enable_non_blocking_io),
disable_disk_cache_(disable_disk_cache),
+ prefer_aes_(prefer_aes),
max_number_of_lossy_connections_(max_number_of_lossy_connections),
packet_loss_threshold_(packet_loss_threshold),
socket_receive_buffer_size_(socket_receive_buffer_size),
@@ -602,7 +604,7 @@ QuicStreamFactory::QuicStreamFactory(
bool has_aes_hardware_support = cpu.has_aesni() && cpu.has_avx();
UMA_HISTOGRAM_BOOLEAN("Net.QuicSession.PreferAesGcm",
has_aes_hardware_support);
- if (has_aes_hardware_support)
+ if (has_aes_hardware_support || prefer_aes_)
crypto_config_.PreferAesGcm();
if (!IsEcdsaSupported())
crypto_config_.DisableEcdsa();
diff --git a/net/quic/quic_stream_factory.h b/net/quic/quic_stream_factory.h
index 185da1f..25e03ea 100644
--- a/net/quic/quic_stream_factory.h
+++ b/net/quic/quic_stream_factory.h
@@ -115,6 +115,7 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
bool enable_connection_racing,
bool enable_non_blocking_io,
bool disable_disk_cache,
+ bool prefer_aes,
int max_number_of_lossy_connections,
float packet_loss_threshold,
int socket_receive_buffer_size,
@@ -345,6 +346,9 @@ class NET_EXPORT_PRIVATE QuicStreamFactory
// Set if we do not want to load server config from the disk cache.
bool disable_disk_cache_;
+ // Set if AES-GCM should be preferred, even if there is no hardware support.
+ bool prefer_aes_;
+
// Set if we want to disable QUIC when there is high packet loss rate.
// Specifies the maximum number of connections with high packet loss in a row
// after which QUIC will be disabled.
diff --git a/net/quic/quic_stream_factory_test.cc b/net/quic/quic_stream_factory_test.cc
index bc85df2..7ccd018 100644
--- a/net/quic/quic_stream_factory_test.cc
+++ b/net/quic/quic_stream_factory_test.cc
@@ -218,6 +218,7 @@ class QuicStreamFactoryTest : public ::testing::TestWithParam<TestParams> {
/*enable_connection_racing=*/false,
/*enable_non_blocking_io=*/true,
/*disable_disk_cache=*/false,
+ /*prefer_aes=*/false,
/*max_number_of_lossy_connections=*/0,
/*packet_loss_threshold=*/1.0f,
/*receive_buffer_size=*/0,