mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 833935 - Stop using one static var per compilation unit. r=jdm
This commit is contained in:
parent
8b848b2b7f
commit
ec242ba8a0
@ -35,6 +35,7 @@ EXPORTS_mozilla/net = \
|
||||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
NeckoCommon.cpp \
|
||||
NeckoChild.cpp \
|
||||
NeckoParent.cpp \
|
||||
ChannelEventQueue.cpp \
|
||||
|
19
netwerk/ipc/NeckoCommon.cpp
Normal file
19
netwerk/ipc/NeckoCommon.cpp
Normal file
@ -0,0 +1,19 @@
|
||||
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* vim: set sw=2 ts=8 et tw=80 : */
|
||||
|
||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "NeckoCommon.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace net {
|
||||
|
||||
namespace NeckoCommonInternal {
|
||||
bool gSecurityDisabled = true;
|
||||
bool gRegisteredBool = false;
|
||||
}
|
||||
|
||||
} // namespace net
|
||||
} // namespace mozilla
|
@ -100,19 +100,22 @@ IsNeckoChild()
|
||||
return amChild;
|
||||
}
|
||||
|
||||
namespace NeckoCommonInternal {
|
||||
extern bool gSecurityDisabled;
|
||||
extern bool gRegisteredBool;
|
||||
}
|
||||
|
||||
// This should always return true unless xpcshell tests are being used
|
||||
inline bool
|
||||
UsingNeckoIPCSecurity()
|
||||
{
|
||||
static bool securityDisabled = true;
|
||||
static bool registeredBool = false;
|
||||
|
||||
if (!registeredBool) {
|
||||
Preferences::AddBoolVarCache(&securityDisabled,
|
||||
if (!NeckoCommonInternal::gRegisteredBool) {
|
||||
Preferences::AddBoolVarCache(&NeckoCommonInternal::gSecurityDisabled,
|
||||
"network.disable.ipc.security");
|
||||
registeredBool = true;
|
||||
NeckoCommonInternal::gRegisteredBool = true;
|
||||
}
|
||||
return !securityDisabled;
|
||||
return !NeckoCommonInternal::gSecurityDisabled;
|
||||
}
|
||||
|
||||
inline bool
|
||||
|
Loading…
Reference in New Issue
Block a user