OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/async_dns_field_trial.h" | 5 #include "chrome/browser/net/async_dns_field_trial.h" |
6 | 6 |
7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 } // namespace | 61 } // namespace |
62 | 62 |
63 bool ConfigureAsyncDnsFieldTrial() { | 63 bool ConfigureAsyncDnsFieldTrial() { |
64 #if defined(OS_ANDROID) || defined(OS_IOS) | 64 #if defined(OS_ANDROID) || defined(OS_IOS) |
65 // There is no DnsConfigService on those platforms so disable the field trial. | 65 // There is no DnsConfigService on those platforms so disable the field trial. |
66 HistogramPrefDefaultSource(PLATFORM, false); | 66 HistogramPrefDefaultSource(PLATFORM, false); |
67 return false; | 67 return false; |
68 #endif | 68 #endif |
69 | 69 |
70 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX) | 70 #if defined(OS_CHROMEOS) || defined(OS_MACOSX) |
71 const bool kDefault = true; | 71 const bool kDefault = true; |
72 #else | 72 #else |
73 const bool kDefault = false; | 73 const bool kDefault = false; |
74 #endif | 74 #endif |
75 | 75 |
76 // Configure the AsyncDns field trial as follows: | 76 // Configure the AsyncDns field trial as follows: |
77 // groups AsyncDnsA and AsyncDnsB: return true, | 77 // groups AsyncDnsA and AsyncDnsB: return true, |
78 // groups SystemDnsA and SystemDnsB: return false, | 78 // groups SystemDnsA and SystemDnsB: return false, |
79 // otherwise (trial absent): return default. | 79 // otherwise (trial absent): return default. |
80 std::string group_name = base::FieldTrialList::FindFullName("AsyncDns"); | 80 std::string group_name = base::FieldTrialList::FindFullName("AsyncDns"); |
(...skipping 23 matching lines...) Expand all Loading... |
104 HistogramPrefSource(EXTENSION_PREF, enabled); | 104 HistogramPrefSource(EXTENSION_PREF, enabled); |
105 else if (pref->IsUserControlled()) | 105 else if (pref->IsUserControlled()) |
106 HistogramPrefSource(USER_PREF, enabled); | 106 HistogramPrefSource(USER_PREF, enabled); |
107 else if (pref->IsDefaultValue()) | 107 else if (pref->IsDefaultValue()) |
108 HistogramPrefSource(DEFAULT_PREF, enabled); | 108 HistogramPrefSource(DEFAULT_PREF, enabled); |
109 else | 109 else |
110 HistogramPrefSource(UNKNOWN_PREF, enabled); | 110 HistogramPrefSource(UNKNOWN_PREF, enabled); |
111 } | 111 } |
112 | 112 |
113 } // namespace chrome_browser_net | 113 } // namespace chrome_browser_net |
OLD | NEW |