summaryrefslogtreecommitdiffstats
path: root/chrome/browser/io_thread.cc
diff options
context:
space:
mode:
authorahendrickson@google.com <ahendrickson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 12:17:44 +0000
committerahendrickson@google.com <ahendrickson@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-25 12:17:44 +0000
commit1ce73ededde9015c4834d258d1b78a73ff449d1a (patch)
tree0c5aafc2b14f32f411ddb74e3b9ba9009050123f /chrome/browser/io_thread.cc
parente25c955957145bd1b772cf1b716c102da73bc6dc (diff)
downloadchromium_src-1ce73ededde9015c4834d258d1b78a73ff449d1a.zip
chromium_src-1ce73ededde9015c4834d258d1b78a73ff449d1a.tar.gz
chromium_src-1ce73ededde9015c4834d258d1b78a73ff449d1a.tar.bz2
HttpAuthFilterWhitelist is now getting entries from the Windows
registry, and adding them to whatever is in the command line. Added a basic IsIntranetHost() member function to HttpNetworkTransaction. Removed it until we figure out what to do with it. Added unit tests. Refactored SetFilters() to be less confusing. Unit tests now use a dummy registry key. BUG=29596 TEST=net_unittests.exe --gtest_filter=HttpAuthFilterTest.* Review URL: http://codereview.chromium.org/669068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42600 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/io_thread.cc')
-rw-r--r--chrome/browser/io_thread.cc25
1 files changed, 14 insertions, 11 deletions
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 83d81b6..60d0d4e 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -195,22 +195,25 @@ net::HttpAuthHandlerFactory* IOThread::CreateDefaultAuthHandlerFactory() {
// Get the whitelist information from the command line, create an
// HttpAuthFilterWhitelist, and attach it to the HttpAuthHandlerFactory.
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
+ std::string auth_server_whitelist;
- // Set the NTLM and Negotiate filters (from the same whitelist)
+ // Get whitelist information from the command line.
if (command_line.HasSwitch(switches::kAuthServerWhitelist)) {
- std::string ntlm_server_whitelist =
+ auth_server_whitelist =
command_line.GetSwitchValueASCII(switches::kAuthServerWhitelist);
- net::HttpAuthFilterWhitelist* ntlm_whitelist =
- new net::HttpAuthFilterWhitelist();
- net::HttpAuthFilterWhitelist* negotiate_whitelist =
- new net::HttpAuthFilterWhitelist();
-
- ntlm_whitelist->SetFilters(ntlm_server_whitelist);
- negotiate_whitelist->SetFilters(ntlm_server_whitelist);
- registry_factory->SetFilter("ntlm", ntlm_whitelist);
- registry_factory->SetFilter("negotiate", negotiate_whitelist);
}
+ // Set the NTLM and Negotiate filters (from the same whitelist).
+ net::HttpAuthFilterWhitelist* ntlm_filter =
+ new net::HttpAuthFilterWhitelist();
+ net::HttpAuthFilterWhitelist* negotiate_filter =
+ new net::HttpAuthFilterWhitelist();
+
+ ntlm_filter->SetWhitelist(auth_server_whitelist);
+ negotiate_filter->SetWhitelist(auth_server_whitelist);
+ registry_factory->SetFilter("ntlm", ntlm_filter);
+ registry_factory->SetFilter("negotiate", negotiate_filter);
+
return registry_factory;
}