OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/net/async_dns_field_trial.h" | |
6 | |
7 #include "base/metrics/field_trial.h" | |
8 #include "build/build_config.h" | |
9 #include "chrome/common/chrome_version_info.h" | |
10 | |
11 namespace net { | |
12 | |
13 bool ConfigureAsyncDnsFieldTrial() { | |
14 #if defined(OS_ANDROID) || defined(OS_IOS) | |
cbentzel
2012/08/22 17:16:55
CrOS as well?
| |
15 // There is no DnsConfigService on those platforms so disable the field trial. | |
16 return false; | |
17 #else | |
cbentzel
2012/08/22 17:16:55
I would just do a #endif here rather than an else.
| |
18 const base::FieldTrial::Probability kAsyncDnsDivisor = 100; | |
19 base::FieldTrial::Probability enabled_probability = 0; | |
20 | |
21 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); | |
22 if (channel == chrome::VersionInfo::CHANNEL_DEV || | |
23 channel == chrome::VersionInfo::CHANNEL_CANARY) { | |
szym
2012/08/21 20:09:40
Should this be |channel <= CHANNEL_DEV| to allow T
cbentzel
2012/08/22 17:16:55
Fine with this.
| |
24 enabled_probability = 50; | |
25 } | |
26 | |
27 scoped_refptr<base::FieldTrial> trial( | |
28 base::FieldTrialList::FactoryGetFieldTrial( | |
29 "AsyncDns", kAsyncDnsDivisor, "disabled", 2012, 9, 30, NULL)); | |
30 | |
31 int enabled_group = trial->AppendGroup("enabled", enabled_probability); | |
32 return trial->group() == enabled_group; | |
33 #endif | |
34 } | |
35 | |
36 } // namespace net | |
OLD | NEW |