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.
5 #include "chrome/browser/net/async_dns_field_trial.h"
7 #include "base/metrics/field_trial.h"
8 #include "base/strings/string_util.h"
9 #include "build/build_config.h"
11 namespace chrome_browser_net
{
13 bool ConfigureAsyncDnsFieldTrial() {
14 #if defined(OS_ANDROID) || defined(OS_IOS)
15 // There is no DnsConfigService on those platforms so disable the field trial.
19 #if defined(OS_CHROMEOS) || defined(OS_LINUX) || defined(OS_MACOSX)
20 const bool kDefault
= true;
22 const bool kDefault
= false;
25 // Configure the AsyncDns field trial as follows:
26 // groups AsyncDnsA and AsyncDnsB: return true,
27 // groups SystemDnsA and SystemDnsB: return false,
28 // otherwise (trial absent): return default.
29 std::string group_name
= base::FieldTrialList::FindFullName("AsyncDns");
30 if (!group_name
.empty())
31 return StartsWithASCII(group_name
, "AsyncDns", false /* case_sensitive */);
35 } // namespace chrome_browser_net