| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "base/metrics/field_trial.h" | 7 #include "base/metrics/field_trial.h" |
| 8 #include "chrome/common/chrome_switches.h" | 8 #include "chrome/common/chrome_switches.h" |
| 9 #include "chrome/common/net/net_error_info.h" | 9 #include "chrome/common/net/net_error_info.h" |
| 10 | 10 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 return ""; | 33 return ""; |
| 34 } | 34 } |
| 35 } | 35 } |
| 36 | 36 |
| 37 bool DnsProbeStatusIsFinished(DnsProbeStatus status) { | 37 bool DnsProbeStatusIsFinished(DnsProbeStatus status) { |
| 38 return status >= DNS_PROBE_FINISHED_INCONCLUSIVE && | 38 return status >= DNS_PROBE_FINISHED_INCONCLUSIVE && |
| 39 status < DNS_PROBE_MAX; | 39 status < DNS_PROBE_MAX; |
| 40 } | 40 } |
| 41 | 41 |
| 42 bool DnsProbesEnabled() { | 42 bool DnsProbesEnabled() { |
| 43 #if defined(OS_ANDROID) |
| 44 return false; |
| 45 #else |
| 43 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 46 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 44 | 47 |
| 45 if (command_line->HasSwitch(switches::kDisableDnsProbes)) | 48 if (command_line->HasSwitch(switches::kDisableDnsProbes)) |
| 46 return false; | 49 return false; |
| 47 else if (command_line->HasSwitch(switches::kEnableDnsProbes)) | 50 else if (command_line->HasSwitch(switches::kEnableDnsProbes)) |
| 48 return true; | 51 return true; |
| 49 | 52 |
| 50 const char kDnsProbeFieldTrialName[] = "DnsProbe-Enable"; | 53 const char kDnsProbeFieldTrialName[] = "DnsProbe-Enable"; |
| 51 const char kDnsProbeFieldTrialEnableGroupName[] = "enable"; | 54 const char kDnsProbeFieldTrialEnableGroupName[] = "enable"; |
| 52 | 55 |
| 53 return base::FieldTrialList::FindFullName(kDnsProbeFieldTrialName) == | 56 return base::FieldTrialList::FindFullName(kDnsProbeFieldTrialName) == |
| 54 kDnsProbeFieldTrialEnableGroupName; | 57 kDnsProbeFieldTrialEnableGroupName; |
| 58 #endif // OS_ANDROID |
| 55 } | 59 } |
| 56 | 60 |
| 57 } // namespace chrome_common_net | 61 } // namespace chrome_common_net |
| OLD | NEW |