diff options
author | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 22:55:46 +0000 |
---|---|---|
committer | ziadh@chromium.org <ziadh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-06 22:55:46 +0000 |
commit | bba3823dbc18cb50d6c43a9777f21f052b81dca7 (patch) | |
tree | ff838850ac8e6b8b7fc0cbdd2aac7d60caee0357 /chrome/browser/browser_main.cc | |
parent | 27c2e49c1fb5ea3869fce54c4ff49a674f842173 (diff) | |
download | chromium_src-bba3823dbc18cb50d6c43a9777f21f052b81dca7.zip chromium_src-bba3823dbc18cb50d6c43a9777f21f052b81dca7.tar.gz chromium_src-bba3823dbc18cb50d6c43a9777f21f052b81dca7.tar.bz2 |
Bad interaction between 2 A/B experiments
There is a 1/20 chance that the max number of sockets per group be greater than
the max number of sockets per proxy server. This would result in hitting a
DCHECK in client_socket_pool_base.cc:145. This CL attempts to circumvent that
event.
r=jar
Review URL: http://codereview.chromium.org/3044051
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@55303 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 7c35799..79f3f0d 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -165,6 +165,8 @@ BrowserMainParts::~BrowserMainParts() { void BrowserMainParts::EarlyInitialization() { PreEarlyInitialization(); + // Note: make sure to call ConnectionFieldTrial() before + // ProxyConnectionsFieldTrial(). ConnectionFieldTrial(); SocketTimeoutFieldTrial(); ProxyConnectionsFieldTrial(); @@ -273,9 +275,18 @@ void BrowserMainParts::ProxyConnectionsFieldTrial() { scoped_refptr<FieldTrial> proxy_connection_trial = new FieldTrial("ProxyConnectionImpact", kProxyConnectionsDivisor); - const int proxy_connections_8 = - proxy_connection_trial->AppendGroup("_proxy_connections_8", - kProxyConnectionProbability); + // The number of max sockets per group cannot be greater than the max number + // of sockets per proxy server. Consequently, we eliminate the + // |proxy_connections_8| trial group if we do happen to pass this lower bound + // (which may vary due to the existence of field trials). This leaves us with + // [16, 32, 64] to choose from. Otherwise, we have a set of four values: + // [8, 16, 32, 64]. + int proxy_connections_8 = -1; + if (net::HttpNetworkSession::max_sockets_per_group() <= 8) { + proxy_connections_8 = + proxy_connection_trial->AppendGroup("_proxy_connections_8", + kProxyConnectionProbability); + } const int proxy_connections_16 = proxy_connection_trial->AppendGroup("_proxy_connections_16", kProxyConnectionProbability); |