diff options
author | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-27 14:35:44 +0000 |
---|---|---|
committer | jar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-27 14:35:44 +0000 |
commit | 602faf3ca5a9b1753d1f4f10639b134555d60352 (patch) | |
tree | 3533436e773b9648f1f9660f97cb14656f0f756c /chrome/browser/browser_main.cc | |
parent | a1e646a13a0041b19b9e55fef1d7d228835cde3d (diff) | |
download | chromium_src-602faf3ca5a9b1753d1f4f10639b134555d60352.zip chromium_src-602faf3ca5a9b1753d1f4f10639b134555d60352.tar.gz chromium_src-602faf3ca5a9b1753d1f4f10639b134555d60352.tar.bz2 |
Refactor DNS A/B experient, and add test of congestion time limits
I added another option in the DNS experiment: user 2 seconds or 500ms
for the congestion limit (that causes pre-resolutions to be discarded
from the queue.
The code in browser_main.cc was getting toooo large, so I pulled all
the experiment code into dns_global.cc.
BUG=15479
r=eroman
Review URL: http://codereview.chromium.org/147215
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19464 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r-- | chrome/browser/browser_main.cc | 49 |
1 files changed, 2 insertions, 47 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index df94b45..91bc5e4 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -635,53 +635,8 @@ int BrowserMain(const MainFunctionParams& parameters) { net::EnsureWinsockInit(); #endif // defined(OS_WIN) - // Set up a field trial to see what disabling DNS pre-resolution does to - // latency of network transactions. - FieldTrial::Probability kDIVISOR = 100; - FieldTrial::Probability k_PROBABILITY_PER_GROUP = 10; // 10% probability. - // For options we don't (currently) wish to test, we use zero probability. - FieldTrial::Probability k_PROBABILITY_DISABLED = 0; - scoped_refptr<FieldTrial> dns_trial = new FieldTrial("DnsImpact", kDIVISOR); - - // First option is to disable prefetching completele. - dns_trial->AppendGroup("_disabled_prefetch", k_PROBABILITY_PER_GROUP); - // Second option is to set parallel prefetch limit to 4 instead of default 8. - int parallel_4_prefetch = dns_trial->AppendGroup("_parallel_4_prefetch", - k_PROBABILITY_PER_GROUP); - - // Don't discard names (erase these lines) yet, as we may use them, and we - // have histogram data named for these options. - - // Next two options relate to the number of parallel http connections that can - // be made to a single host. The default is currently 6, and we wanted to see - // what would happen when we restricted this to 4. (Historically the limit - // was a mere 2, but several browsers including Chromium increased it to 6 - // recently). - int disabled_plus_4_connections = dns_trial->AppendGroup( - "_disabled_prefetch_4_connections", k_PROBABILITY_DISABLED); - int enabled_plus_4_connections = dns_trial->AppendGroup( - "_enabled_prefetch_4_connections", k_PROBABILITY_DISABLED); - - scoped_ptr<chrome_browser_net::DnsPrefetcherInit> dns_prefetch_init; - if (dns_trial->group() == FieldTrial::kNotParticipating || - dns_trial->group() == enabled_plus_4_connections || - dns_trial->group() == parallel_4_prefetch) { - // Initialize the DNS prefetch system - if (dns_trial->group() == parallel_4_prefetch) - dns_prefetch_init.reset(new chrome_browser_net::DnsPrefetcherInit( - 4, user_prefs)); - else - dns_prefetch_init.reset(new chrome_browser_net::DnsPrefetcherInit( - chrome_browser_net::DnsPrefetcherInit::kMaxConcurrentLookups, - user_prefs)); - chrome_browser_net::DnsPrefetchHostNamesAtStartup(user_prefs, local_state); - chrome_browser_net::RestoreSubresourceReferrers(local_state); - } - - if (dns_trial->group() == disabled_plus_4_connections || - dns_trial->group() == enabled_plus_4_connections) { - net::HttpNetworkSession::set_max_sockets_per_group(4); - } + // Initialize and maintain DNS prefetcher module. + chrome_browser_net::DnsPrefetcherInit dns_prefetch(user_prefs, local_state); scoped_refptr<FieldTrial> http_prioritization_trial = new FieldTrial("HttpPrioritization", 100); |