diff options
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); |