Bug 969165 - Convert Atomic<T> where T != bool but is used as a bool over to Atomic<bool>, now that it's supported, in security/manager/. r=bsmith

--HG--
extra : rebase_source : 3632af6471e41d099a0948542d26a7df527efaad
This commit is contained in:
Jeff Walden 2014-02-06 22:17:07 -08:00
Родитель bb4b656c3b
Коммит 4e3e68dab2
1 изменённых файлов: 8 добавлений и 8 удалений

Просмотреть файл

@ -27,8 +27,8 @@ using mozilla::unused;
namespace {
static Atomic<int32_t> sCertOverrideSvcExists(0);
static Atomic<int32_t> sCertDBExists(0);
static Atomic<bool> sCertOverrideSvcExists(false);
static Atomic<bool> sCertDBExists(false);
class MainThreadClearer : public SyncRunnableBase
{
@ -40,9 +40,9 @@ public:
// is in progress. We want to avoid this, since they do not handle the situation well,
// hence the flags to avoid instantiating the services if they don't already exist.
bool certOverrideSvcExists = (bool)sCertOverrideSvcExists.exchange(0);
bool certOverrideSvcExists = sCertOverrideSvcExists.exchange(false);
if (certOverrideSvcExists) {
sCertOverrideSvcExists = 1;
sCertOverrideSvcExists = true;
nsCOMPtr<nsICertOverrideService> icos = do_GetService(NS_CERTOVERRIDE_CONTRACTID);
if (icos) {
icos->ClearValidityOverride(
@ -51,9 +51,9 @@ public:
}
}
bool certDBExists = (bool)sCertDBExists.exchange(0);
bool certDBExists = sCertDBExists.exchange(false);
if (certDBExists) {
sCertDBExists = 1;
sCertDBExists = true;
nsCOMPtr<nsIX509CertDB> certdb = do_GetService(NS_X509CERTDB_CONTRACTID);
if (certdb) {
nsCOMPtr<nsIRecentBadCerts> badCerts;
@ -206,13 +206,13 @@ SharedSSLState::GlobalCleanup()
/*static*/ void
SharedSSLState::NoteCertOverrideServiceInstantiated()
{
sCertOverrideSvcExists = 1;
sCertOverrideSvcExists = true;
}
/*static*/ void
SharedSSLState::NoteCertDBServiceInstantiated()
{
sCertDBExists = 1;
sCertDBExists = true;
}
void