| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/net/dns_global.h" | 5 #include "chrome/browser/net/dns_global.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
| (...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 574 | 574 |
| 575 trial_ = new FieldTrial("DnsImpact", kDivisor); | 575 trial_ = new FieldTrial("DnsImpact", kDivisor); |
| 576 | 576 |
| 577 // First option is to disable prefetching completely. | 577 // First option is to disable prefetching completely. |
| 578 int disabled_prefetch = trial_->AppendGroup("_disabled_prefetch", | 578 int disabled_prefetch = trial_->AppendGroup("_disabled_prefetch", |
| 579 kProbabilityPerGroup); | 579 kProbabilityPerGroup); |
| 580 // Set parallel prefetch limit to 4 instead of default 8. | 580 // Set parallel prefetch limit to 4 instead of default 8. |
| 581 int parallel_4_prefetch = trial_->AppendGroup("_parallel_4_prefetch", | 581 int parallel_4_prefetch = trial_->AppendGroup("_parallel_4_prefetch", |
| 582 kProbabilityPerGroup); | 582 kProbabilityPerGroup); |
| 583 // Set congestion detection at 500ms, rather than the 1 second default. | 583 // Set congestion detection at 500ms, rather than the 1 second default. |
| 584 int max_500ms_prefetch = trial_->AppendGroup("_max_500ms_prefetch_queue", | 584 int max_500ms_prefetch = trial_->AppendGroup("_max_500ms_queue_prefetch", |
| 585 kProbabilityPerGroup); | 585 kProbabilityPerGroup); |
| 586 // Set congestion detection at 2 seconds instead of the 1 second default. | 586 // Set congestion detection at 2 seconds instead of the 1 second default. |
| 587 int max_2s_prefetch = trial_->AppendGroup("_max_2s_prefetch_queue", | 587 int max_2s_prefetch = trial_->AppendGroup("_max_2s_queue_prefetch", |
| 588 kProbabilityPerGroup); | 588 kProbabilityPerGroup); |
| 589 | 589 |
| 590 trial_->AppendGroup("_default_enabled_prefetch", |
| 591 FieldTrial::kAllRemainingProbability); |
| 592 |
| 590 if (trial_->group() != disabled_prefetch) { | 593 if (trial_->group() != disabled_prefetch) { |
| 591 // Initialize the DNS prefetch system. | 594 // Initialize the DNS prefetch system. |
| 592 | 595 |
| 593 size_t max_concurrent = kMaxConcurrentLookups; | 596 size_t max_concurrent = kMaxConcurrentLookups; |
| 594 | 597 |
| 595 int max_queueing_delay_ms = kMaxQueueingDelayMs; | 598 int max_queueing_delay_ms = kMaxQueueingDelayMs; |
| 596 | 599 |
| 597 if (trial_->group() == parallel_4_prefetch) | 600 if (trial_->group() == parallel_4_prefetch) |
| 598 max_concurrent = 4; | 601 max_concurrent = 4; |
| 599 else if (trial_->group() == max_500ms_prefetch) | 602 else if (trial_->group() == max_500ms_prefetch) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 612 } | 615 } |
| 613 } | 616 } |
| 614 | 617 |
| 615 DnsPrefetcherInit::~DnsPrefetcherInit() { | 618 DnsPrefetcherInit::~DnsPrefetcherInit() { |
| 616 if (dns_master) | 619 if (dns_master) |
| 617 FreeDnsPrefetchResources(); | 620 FreeDnsPrefetchResources(); |
| 618 } | 621 } |
| 619 | 622 |
| 620 } // namespace chrome_browser_net | 623 } // namespace chrome_browser_net |
| 621 | 624 |
| OLD | NEW |