diff options
author | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 21:55:51 +0000 |
---|---|---|
committer | wtc@chromium.org <wtc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-09 21:55:51 +0000 |
commit | 2fabd24b9eabb8a66c5553b7b45af134a5b929e5 (patch) | |
tree | adc0dc3cadf6130abfed37d1eab5e2871e7d6a69 /chrome | |
parent | 23d8bdd59fd22a2c7aee9187349d802bdcd3da8e (diff) | |
download | chromium_src-2fabd24b9eabb8a66c5553b7b45af134a5b929e5.zip chromium_src-2fabd24b9eabb8a66c5553b7b45af134a5b929e5.tar.gz chromium_src-2fabd24b9eabb8a66c5553b7b45af134a5b929e5.tar.bz2 |
Add the ssl_client_socket_nss_factory.h header and declare
the SSLClientSocketNSSFactory function there.
Put the --use-nss-for-ssl command-line switch inside ifdefs
for the platforms that need it.
Call EnsureNSPRInit on the main thread so that PR_Cleanup
will be called on the main thread.
R=mark
BUG=28744
TEST=No build errors.
Review URL: http://codereview.chromium.org/573041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/browser_main.cc | 22 | ||||
-rw-r--r-- | chrome/common/chrome_switches.cc | 10 | ||||
-rw-r--r-- | chrome/common/chrome_switches.h | 5 |
3 files changed, 22 insertions, 15 deletions
diff --git a/chrome/browser/browser_main.cc b/chrome/browser/browser_main.cc index 04ec0ed..c81140e 100644 --- a/chrome/browser/browser_main.cc +++ b/chrome/browser/browser_main.cc @@ -65,7 +65,6 @@ #include "net/base/cookie_monster.h" #include "net/base/net_module.h" #include "net/http/http_network_session.h" -#include "net/socket/client_socket_factory.h" #include "net/socket/client_socket_pool_base.h" #if defined(OS_POSIX) @@ -97,6 +96,7 @@ #include <shellapi.h> #include "app/win_util.h" +#include "base/nss_util.h" #include "base/registry.h" #include "base/win_util.h" #include "chrome/browser/browser.h" @@ -114,7 +114,7 @@ #include "net/base/net_util.h" #include "net/base/sdch_manager.h" #include "net/base/winsock_init.h" -#include "net/http/http_network_layer.h" +#include "net/socket/ssl_client_socket_nss_factory.h" #include "printing/printed_document.h" #include "sandbox/src/sandbox.h" #endif // defined(OS_WIN) @@ -397,6 +397,16 @@ int BrowserMain(const MainFunctionParams& parameters) { net::EnsureWinsockInit(); #endif // defined(OS_WIN) +#if defined(OS_WIN) + if (parsed_command_line.HasSwitch(switches::kUseNSSForSSL) || + parsed_command_line.HasSwitch(switches::kUseSpdy)) { + net::ClientSocketFactory::SetSSLClientSocketFactory( + net::SSLClientSocketNSSFactory); + // We want to be sure to init NSPR on the main thread. + base::EnsureNSPRInit(); + } +#endif + // Do platform-specific things (such as finishing initializing Cocoa) // prior to instantiating the message loop. This could be turned into a // broadcast notification. @@ -719,14 +729,6 @@ int BrowserMain(const MainFunctionParams& parameters) { } } -#if defined(OS_WIN) - if (parsed_command_line.HasSwitch(switches::kUseNSSForSSL) || - parsed_command_line.HasSwitch(switches::kUseSpdy)) { - net::ClientSocketFactory::SetSSLClientSocketFactory( - net::SSLClientSocketNSSFactory); - } -#endif - // Try to create/load the profile. ProfileManager* profile_manager = browser_process->profile_manager(); Profile* profile = profile_manager->GetDefaultProfile(user_data_dir); diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc index d3fdbcb..db0e7d3 100644 --- a/chrome/common/chrome_switches.cc +++ b/chrome/common/chrome_switches.cc @@ -631,10 +631,6 @@ const char kTryChromeAgain[] = "try-chrome-again"; // Runs un-installation steps that were done by chrome first-run. const char kUninstall[] = "uninstall"; -// Use NSS instead of the system SSL library for SSL. -// This is a temporary testing flag. -const char kUseNSSForSSL[] = "use-nss-for-ssl"; - // Use Spdy for the transport protocol instead of HTTP. // This is a temporary testing flag. const char kUseSpdy[] = "use-spdy"; @@ -730,6 +726,12 @@ const char kProfile[] = "profile"; const char kChromeosFrame[] = "chromeos-frame"; #endif +#if defined(OS_WIN) +// Use NSS instead of the system SSL library for SSL. +// This is a temporary testing flag. +const char kUseNSSForSSL[] = "use-nss-for-ssl"; +#endif + #if defined(OS_LINUX) // A temporary switch before we implement the client certificate selection UI. // When an SSL server requests client authentication, select a client diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h index e6be99f..8ba978e4 100644 --- a/chrome/common/chrome_switches.h +++ b/chrome/common/chrome_switches.h @@ -182,7 +182,6 @@ extern const char kThumbnailStore[]; extern const char kTrustedPlugins[]; extern const char kTryChromeAgain[]; extern const char kUninstall[]; -extern const char kUseNSSForSSL[]; extern const char kUseSpdy[]; extern const char kFixedHost[]; extern const char kFixedHttpPort[]; @@ -213,6 +212,10 @@ extern const char kProfile[]; extern const char kChromeosFrame[]; #endif +#if defined(OS_WIN) +extern const char kUseNSSForSSL[]; +#endif + #if defined(OS_LINUX) extern const char kAutoSSLClientAuth[]; #endif |