diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 16:20:14 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-31 16:20:14 +0000 |
commit | bcb84f8b62103f881ffcb50e8aed0e9bd1a2d821 (patch) | |
tree | c6cf85e5249bdd54dc57b463e1acca0db39fd0ac /chrome/browser/browser_init.cc | |
parent | b65272fdbd41b9571cb12fdb63804761e405f0ce (diff) | |
download | chromium_src-bcb84f8b62103f881ffcb50e8aed0e9bd1a2d821.zip chromium_src-bcb84f8b62103f881ffcb50e8aed0e9bd1a2d821.tar.gz chromium_src-bcb84f8b62103f881ffcb50e8aed0e9bd1a2d821.tar.bz2 |
Adding command-line option to override bans on certain port numbers through a comma-separated list of ports.
BUG= http://crbug.com/18307
TEST= url_request_unittest, use commandline flag allowed_ports=1,600. Navigate to http://www.google.com:1 or http://www.google.com:600. You should not get an ERR_UNSAFE_PORT, it will attempt to load the page.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@24883 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_init.cc')
-rw-r--r-- | chrome/browser/browser_init.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/browser_init.cc b/chrome/browser/browser_init.cc index 789b3a3..0accf67 100644 --- a/chrome/browser/browser_init.cc +++ b/chrome/browser/browser_init.cc @@ -57,6 +57,7 @@ #include "grit/generated_resources.h" #include "grit/locale_settings.h" #include "grit/theme_resources.h" +#include "net/url_request/url_request_http_job.h" #include "webkit/glue/webkit_glue.h" #if defined(OS_WIN) @@ -819,6 +820,12 @@ bool BrowserInit::ProcessCmdLineImpl(const CommandLine& command_line, silent_launch = !process_startup; } + if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { + std::wstring allowed_ports = + command_line.GetSwitchValue(switches::kExplicitlyAllowedPorts); + URLRequestHttpJob::SetExplicitlyAllowedPorts(allowed_ports); + } + // If we don't want to launch a new browser window or tab (in the case // of an automation request), we are done here. if (!silent_launch) { |