summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_main.cc
diff options
context:
space:
mode:
authorjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 18:31:36 +0000
committerjar@chromium.org <jar@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-01 18:31:36 +0000
commite085c30ad5cb73ad9497bcf566d93e48127bc48c (patch)
treee347e0cfaa36e6d688f5a03c3c8217b94b6e7835 /chrome/browser/browser_main.cc
parent1f2fe99dc4baa689bf34cef8c85f105d5957db75 (diff)
downloadchromium_src-e085c30ad5cb73ad9497bcf566d93e48127bc48c.zip
chromium_src-e085c30ad5cb73ad9497bcf566d93e48127bc48c.tar.gz
chromium_src-e085c30ad5cb73ad9497bcf566d93e48127bc48c.tar.bz2
Test impact of 4 rather than 8 parallel DNS prefetch
BUG=6532 r=wtc Review URL: http://codereview.chromium.org/115990 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17338 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_main.cc')
-rw-r--r--chrome/browser/browser_main.cc23
1 files changed, 20 insertions, 3 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc
index 84ab4f8..f7145a4 100644
--- a/chrome/browser/browser_main.cc
+++ b/chrome/browser/browser_main.cc
@@ -578,9 +578,20 @@ int BrowserMain(const MainFunctionParams& parameters) {
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(
@@ -588,10 +599,16 @@ int BrowserMain(const MainFunctionParams& parameters) {
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() == enabled_plus_4_connections ||
+ dns_trial->group() == parallel_4_prefetch) {
// Initialize the DNS prefetch system
- dns_prefetch_init.reset(
- new chrome_browser_net::DnsPrefetcherInit(user_prefs));
+ 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);
}