Bug 1788596 - Remove extra lock() on UtilityProcessChild r=nika

Differential Revision: https://phabricator.services.mozilla.com/D156482
This commit is contained in:
Alexandre Lissy 2022-10-06 10:56:42 +00:00
parent 16c9919af1
commit c89a2edc37
2 changed files with 2 additions and 3 deletions

View File

@ -45,14 +45,13 @@ static StaticRefPtr<UtilityProcessChild> sUtilityProcessChild;
UtilityProcessChild::UtilityProcessChild() {
nsDebugImpl::SetMultiprocessMode("Utility");
StaticMutexAutoLock lock(sUtilityProcessChildMutex);
sUtilityProcessChild = this;
}
UtilityProcessChild::~UtilityProcessChild() = default;
/* static */
RefPtr<UtilityProcessChild> UtilityProcessChild::GetSingleton() {
MOZ_ASSERT(XRE_IsUtilityProcess());
StaticMutexAutoLock lock(sUtilityProcessChildMutex);
if (!sUtilityProcessChild) {
sUtilityProcessChild = new UtilityProcessChild();

View File

@ -27,7 +27,7 @@ class UtilityProcessImpl final : public ipc::ProcessChild {
void CleanUp() override;
private:
RefPtr<UtilityProcessChild> mUtility = new UtilityProcessChild();
RefPtr<UtilityProcessChild> mUtility = UtilityProcessChild::GetSingleton();
#if defined(XP_WIN)
mozilla::mscom::ProcessRuntime mCOMRuntime;