Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: chrome/common/net/net_error_info.cc

Issue 23496028: Disable DNS probes on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698