Bug 1641496 - P7: Allow to use SSLTokensCache in parent process with socket process enabled r=dragana

Differential Revision: https://phabricator.services.mozilla.com/D78228
This commit is contained in:
Kershaw Chang 2020-06-05 13:27:35 +00:00
Родитель f325bc0048
Коммит 8a93345ab3
1 изменённых файлов: 6 добавлений и 5 удалений

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

@ -76,11 +76,12 @@ NS_IMPL_ISUPPORTS(SSLTokensCache, nsIMemoryReporter)
nsresult SSLTokensCache::Init() {
StaticMutexAutoLock lock(sLock);
if (nsIOService::UseSocketProcess()) {
if (!XRE_IsSocketProcess()) {
return NS_OK;
}
} else if (!XRE_IsParentProcess()) {
// SSLTokensCache should be only used in parent process and socket process.
// Ideally, parent process should not use this when socket process is enabled.
// However, some xpcsehll tests may need to create and use sockets directly,
// so we still allow to use this in parent process no matter socket process is
// enabled or not.
if (!(XRE_IsSocketProcess() || XRE_IsParentProcess())) {
return NS_OK;
}