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

Unified Diff: chrome/browser/io_thread.cc

Issue 7011044: Add a command line option to turn off retry attempts to resolve host (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/net/connection_tester.cc » ('j') | chrome/common/chrome_switches.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/io_thread.cc
===================================================================
--- chrome/browser/io_thread.cc (revision 85450)
+++ chrome/browser/io_thread.cc (working copy)
@@ -122,8 +122,23 @@
parallelism = 20;
}
+ size_t retry_attempts = net::HostResolver::kDefaultRetryAttempts;
+
+ // Use the retry attempts override from the command-line, if any.
+ if (command_line.HasSwitch(switches::kHostResolverRetryAttempts)) {
+ std::string s =
+ command_line.GetSwitchValueASCII(switches::kHostResolverRetryAttempts);
+ // Parse the switch (it should be a non-negative integer).
+ int n;
+ if (base::StringToInt(s, &n) && n >= 0) {
+ retry_attempts = static_cast<size_t>(n);
+ } else {
+ LOG(ERROR) << "Invalid switch for host resolver retry attempts: " << s;
+ }
+ }
+
net::HostResolver* global_host_resolver =
- net::CreateSystemHostResolver(parallelism, net_log);
+ net::CreateSystemHostResolver(parallelism, retry_attempts, net_log);
// Determine if we should disable IPv6 support.
if (!command_line.HasSwitch(switches::kEnableIPv6)) {
« no previous file with comments | « no previous file | chrome/browser/net/connection_tester.cc » ('j') | chrome/common/chrome_switches.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698