| Index: crypto/nss_util.cc
|
| ===================================================================
|
| --- crypto/nss_util.cc (revision 79901)
|
| +++ crypto/nss_util.cc (working copy)
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "base/nss_util.h"
|
| -#include "base/nss_util_internal.h"
|
| +#include "crypto/nss_util.h"
|
| +#include "crypto/nss_util_internal.h"
|
|
|
| #include <nss.h>
|
| #include <plarena.h>
|
| @@ -20,7 +20,6 @@
|
|
|
| #include <vector>
|
|
|
| -#include "base/crypto/scoped_nss_types.h"
|
| #include "base/environment.h"
|
| #include "base/file_path.h"
|
| #include "base/file_util.h"
|
| @@ -30,6 +29,7 @@
|
| #include "base/native_library.h"
|
| #include "base/stringprintf.h"
|
| #include "base/threading/thread_restrictions.h"
|
| +#include "crypto/scoped_nss_types.h"
|
|
|
| // USE_NSS means we use NSS for everything crypto-related. If USE_NSS is not
|
| // defined, such as on Mac and Windows, we use NSS for SSL only -- we don't
|
| @@ -40,7 +40,7 @@
|
| #include "base/synchronization/lock.h"
|
| #endif // defined(USE_NSS)
|
|
|
| -namespace base {
|
| +namespace crypto {
|
|
|
| namespace {
|
|
|
| @@ -196,7 +196,7 @@
|
| // singleton.
|
| class NSPRInitSingleton {
|
| private:
|
| - friend struct DefaultLazyInstanceTraits<NSPRInitSingleton>;
|
| + friend struct base::DefaultLazyInstanceTraits<NSPRInitSingleton>;
|
|
|
| NSPRInitSingleton() {
|
| PR_Init(PR_USER_THREAD, PR_PRIORITY_NORMAL, 0);
|
| @@ -214,8 +214,9 @@
|
| }
|
| };
|
|
|
| -LazyInstance<NSPRInitSingleton, LeakyLazyInstanceTraits<NSPRInitSingleton> >
|
| - g_nspr_singleton(LINKER_INITIALIZED);
|
| +base::LazyInstance<NSPRInitSingleton,
|
| + base::LeakyLazyInstanceTraits<NSPRInitSingleton> >
|
| + g_nspr_singleton(base::LINKER_INITIALIZED);
|
|
|
| class NSSInitSingleton {
|
| public:
|
| @@ -327,7 +328,7 @@
|
| }
|
|
|
| private:
|
| - friend struct DefaultLazyInstanceTraits<NSSInitSingleton>;
|
| + friend struct base::DefaultLazyInstanceTraits<NSSInitSingleton>;
|
|
|
| NSSInitSingleton()
|
| : opencryptoki_module_(NULL),
|
| @@ -546,8 +547,9 @@
|
| // static
|
| bool NSSInitSingleton::force_nodb_init_ = false;
|
|
|
| -LazyInstance<NSSInitSingleton, LeakyLazyInstanceTraits<NSSInitSingleton> >
|
| - g_nss_singleton(LINKER_INITIALIZED);
|
| +base::LazyInstance<NSSInitSingleton,
|
| + base::LeakyLazyInstanceTraits<NSSInitSingleton> >
|
| + g_nss_singleton(base::LINKER_INITIALIZED);
|
|
|
| } // namespace
|
|
|
| @@ -567,7 +569,7 @@
|
| // Initializing SSL causes us to do blocking IO.
|
| // Temporarily allow it until we fix
|
| // http://code.google.com/p/chromium/issues/detail?id=59847
|
| - ThreadRestrictions::ScopedAllowIO allow_io;
|
| + base::ThreadRestrictions::ScopedAllowIO allow_io;
|
| g_nss_singleton.Get();
|
| }
|
|
|
| @@ -576,7 +578,7 @@
|
| }
|
|
|
| void DisableNSSForkCheck() {
|
| - scoped_ptr<Environment> env(Environment::Create());
|
| + scoped_ptr<base::Environment> env(base::Environment::Create());
|
| env->SetVar("NSS_STRICT_NOFORK", "DISABLED");
|
| }
|
|
|
| @@ -671,11 +673,11 @@
|
|
|
| // TODO(port): Implement this more simply. We can convert by subtracting an
|
| // offset (the difference between NSPR's and base::Time's epochs).
|
| -Time PRTimeToBaseTime(PRTime prtime) {
|
| +base::Time PRTimeToBaseTime(PRTime prtime) {
|
| PRExplodedTime prxtime;
|
| PR_ExplodeTime(prtime, PR_GMTParameters, &prxtime);
|
|
|
| - Time::Exploded exploded;
|
| + base::Time::Exploded exploded;
|
| exploded.year = prxtime.tm_year;
|
| exploded.month = prxtime.tm_month + 1;
|
| exploded.day_of_week = prxtime.tm_wday;
|
| @@ -685,7 +687,7 @@
|
| exploded.second = prxtime.tm_sec;
|
| exploded.millisecond = prxtime.tm_usec / 1000;
|
|
|
| - return Time::FromUTCExploded(exploded);
|
| + return base::Time::FromUTCExploded(exploded);
|
| }
|
|
|
| PK11SlotInfo* GetPublicNSSKeySlot() {
|
| @@ -696,4 +698,4 @@
|
| return g_nss_singleton.Get().GetPrivateNSSKeySlot();
|
| }
|
|
|
| -} // namespace base
|
| +} // namespace crypto
|
|
|