зеркало из https://github.com/mozilla/gecko-dev.git
Bug 833935 - Stop using one static var per compilation unit. r=jdm
This commit is contained in:
Родитель
8b848b2b7f
Коммит
ec242ba8a0
|
@ -35,6 +35,7 @@ EXPORTS_mozilla/net = \
|
|||
$(NULL)
|
||||
|
||||
CPPSRCS = \
|
||||
NeckoCommon.cpp \
|
||||
NeckoChild.cpp \
|
||||
NeckoParent.cpp \
|
||||
ChannelEventQueue.cpp \
|
||||
|
|
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче