diff options
author | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 23:14:14 +0000 |
---|---|---|
committer | willchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 23:14:14 +0000 |
commit | 85c0ed8299a1c029964ed58082e6d94a32d4dd9b (patch) | |
tree | 9b8ee6b9c9a8240f9fbe58adc96fa379ab856b76 /chrome | |
parent | b7a12f7cfbace2b35037aac28d71b1a5159cad7e (diff) | |
download | chromium_src-85c0ed8299a1c029964ed58082e6d94a32d4dd9b.zip chromium_src-85c0ed8299a1c029964ed58082e6d94a32d4dd9b.tar.gz chromium_src-85c0ed8299a1c029964ed58082e6d94a32d4dd9b.tar.bz2 |
Flip: Comma delimit the various flip options. Redo the fixed testing server flags.
Renames --testing-fixed-server to --testing-fixed-host. Adds --testing-fixed-http-port and --testing-fixed-https-port.
Review URL: http://codereview.chromium.org/501032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34624 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_main.cc | 14 | ||||
-rw-r--r-- | chrome/browser/net/dns_global.cc | 9 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 10 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 4 |
4 files changed, 28 insertions, 9 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index f378f27..01debdb 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -644,6 +644,20 @@ int BrowserMain(const MainFunctionParams& parameters) { net::CookieMonster::EnableFileScheme(); } + if (parsed_command_line.HasSwitch(switches::kFixedHttpPort)) { + std::string http_port_str = + parsed_command_line.GetSwitchValueASCII(switches::kFixedHttpPort); + int http_port = StringToInt(http_port_str); + net::HttpNetworkSession::set_fixed_http_port(http_port); + } + + if (parsed_command_line.HasSwitch(switches::kFixedHttpsPort)) { + std::string https_port_str = + parsed_command_line.GetSwitchValueASCII(switches::kFixedHttpsPort); + int https_port = StringToInt(https_port_str); + net::HttpNetworkSession::set_fixed_https_port(https_port); + } + // Initialize histogram statistics gathering system. StatisticsRecorder statistics; diff --git a/chrome/browser/net/dns_global.cc b/chrome/browser/net/dns_global.cc index be0cae3..bb2abad 100644 --- a/chrome/browser/net/dns_global.cc +++ b/chrome/browser/net/dns_global.cc @@ -478,10 +478,10 @@ net::HostResolver* GetGlobalHostResolver() { // The FixedHostResolver allows us to send all network requests through // a designated test server. - if (command_line.HasSwitch(switches::kFixedServer)) { - std::string host_and_port = - WideToASCII(command_line.GetSwitchValue(switches::kFixedServer)); - global_host_resolver = new net::FixedHostResolver(host_and_port); + if (command_line.HasSwitch(switches::kFixedHost)) { + std::string host = + command_line.GetSwitchValueASCII(switches::kFixedHost); + global_host_resolver = new net::FixedHostResolver(host); } else { global_host_resolver = net::CreateSystemHostResolver(); @@ -672,4 +672,3 @@ DnsPrefetcherInit::~DnsPrefetcherInit() { } } // namespace chrome_browser_net - diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index e6fcabe..64ab2ee 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -599,12 +599,16 @@ const char kUseFlip[] = "use-flip"; // Force all requests to go to this server. This commandline is provided // for testing purposes only, and will likely be removed soon. It can also // hurt startup performance as it does a synchronous name resolution on the -// UI thread. The port is not optional. +// UI thread. // The host resolution using this scheme is done exactly once at startup. // From that point on, it is completely a static configuration. // TODO(mbelshe): Remove this flag when testing is complete. -// --testing-fixed-server=myserver:1000 -const char kFixedServer[] = "testing-fixed-server"; +// --testing-fixed-host=myserver +const char kFixedHost[] = "testing-fixed-host"; + +// These two flags are used to force http and https requests to fixed ports. +const char kFixedHttpPort[] = "testing-fixed-http-port"; +const char kFixedHttpsPort[] = "testing-fixed-https-port"; // Use the low fragmentation heap for the CRT. const char kUseLowFragHeapCrt[] = "use-lf-heap"; diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index d929821..4e9e702 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -169,7 +169,9 @@ extern const char kTrustedPlugins[]; extern const char kTryChromeAgain[]; extern const char kUninstall[]; extern const char kUseFlip[]; -extern const char kFixedServer[]; +extern const char kFixedHost[]; +extern const char kFixedHttpPort[]; +extern const char kFixedHttpsPort[]; extern const char kUseLowFragHeapCrt[]; extern const char kUserAgent[]; extern const char kUserDataDir[]; |