Bug 1542037 - Only create nsDNSService on parent process r=dragana

Differential Revision: https://phabricator.services.mozilla.com/D41211

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Kershaw Chang 2019-08-14 19:37:13 +00:00
parent b869172d63
commit 91a654a9e3

View File

@ -523,11 +523,15 @@ NS_IMPL_ISUPPORTS(nsDNSService, nsIDNSService, nsPIDNSService, nsIObserver,
static StaticRefPtr<nsDNSService> gDNSService;
already_AddRefed<nsIDNSService> nsDNSService::GetXPCOMSingleton() {
if (XRE_IsParentProcess()) {
return GetSingleton();
}
if (XRE_IsContentProcess() || XRE_IsSocketProcess()) {
return ChildDNSService::GetSingleton();
}
return GetSingleton();
return nullptr;
}
already_AddRefed<nsDNSService> nsDNSService::GetSingleton() {