Index: chrome/browser/io_thread.cc |
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc |
index 5e3374710a7687fd4e125d9d307600799f55a5ee..d621aff6eee410207a1ecab3eb315ba396bc8d17 100644 |
--- a/chrome/browser/io_thread.cc |
+++ b/chrome/browser/io_thread.cc |
@@ -109,10 +109,13 @@ class SystemURLRequestContext : public URLRequestContextWithUserAgent { |
net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
+ bool allow_async_dns_field_trial = true; |
+ |
size_t parallelism = net::HostResolver::kDefaultParallelism; |
// Use the concurrency override from the command-line, if any. |
if (command_line.HasSwitch(switches::kHostResolverParallelism)) { |
cbentzel
2012/08/20 11:45:56
Did you see if we could just get rid of the kHostR
szym
2012/08/20 17:54:21
Judging from the old bugs which established our cu
|
+ allow_async_dns_field_trial = false; |
std::string s = |
command_line.GetSwitchValueASCII(switches::kHostResolverParallelism); |
@@ -129,6 +132,7 @@ net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { |
// Use the retry attempts override from the command-line, if any. |
if (command_line.HasSwitch(switches::kHostResolverRetryAttempts)) { |
+ allow_async_dns_field_trial = false; |
std::string s = |
command_line.GetSwitchValueASCII(switches::kHostResolverRetryAttempts); |
// Parse the switch (it should be a non-negative integer). |
@@ -141,14 +145,24 @@ net::HostResolver* CreateGlobalHostResolver(net::NetLog* net_log) { |
} |
net::HostResolver* global_host_resolver = NULL; |
+ bool use_async = false; |
if (command_line.HasSwitch(switches::kEnableAsyncDns)) { |
cbentzel
2012/08/20 11:45:56
Why isn't this just --async-dns=[enabled|disabled|
szym
2012/08/20 17:54:21
I followed the existing flags. There's currently 8
cbentzel
2012/08/21 10:50:53
No - it sounds different from common practice.
|
- global_host_resolver = |
- net::CreateAsyncHostResolver(parallelism, retry_attempts, net_log); |
+ allow_async_dns_field_trial = false; |
+ use_async = true; |
+ } else if (command_line.HasSwitch(switches::kDisableAsyncDns)) { |
+ allow_async_dns_field_trial = false; |
+ use_async = false; |
} |
- if (!global_host_resolver) { |
+ if (allow_async_dns_field_trial) |
+ use_async = net::ConfigureAsyncDnsFieldTrial(); |
+ |
+ if (use_async) { |
+ global_host_resolver = |
+ net::CreateAsyncHostResolver(parallelism, retry_attempts, net_log); |
+ } else { |
global_host_resolver = |
- net::CreateSystemHostResolver(parallelism, retry_attempts, net_log); |
+ net::CreateSystemHostResolver(parallelism, retry_attempts, net_log); |
} |
// Determine if we should disable IPv6 support. |