NSS: don't set environment variables when multi-threaded.

We can't alter the envionment once we have gone multithreaded because
glibc's getenv doesn't take the environment lock. Thus we add an
EarlyNSSInit() function which can do so, early in startup.

BUG=66835
TEST=ThreadSanitizer

http://codereview.chromium.org/6185005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71351 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/base/nss_util.h b/base/nss_util.h
index 2b0139e..10bbdfb4 100644
--- a/base/nss_util.h
+++ b/base/nss_util.h
@@ -20,6 +20,13 @@
 class Lock;
 class Time;
 
+#if defined(USE_NSS)
+// EarlySetupForNSSInit performs lightweight setup which must occur before the
+// process goes multithreaded. This does not initialise NSS. For test, see
+// EnsureNSSInit.
+void EarlySetupForNSSInit();
+#endif
+
 // Initialize NRPR if it isn't already initialized.  This function is
 // thread-safe, and NSPR will only ever be initialized once.  NSPR will be
 // properly shut down on program exit.