From c8b2ad17205746378f7acaea0a0b93587d6fa2d3 Mon Sep 17 00:00:00 2001 From: Aaron Klotz Date: Wed, 20 Feb 2019 03:27:00 +0000 Subject: [PATCH] Bug 1529060: Minor mscom::ProcessRuntime cleanup; r=Jamie * Be sure to set mInitResult = S_OK when we've already done process-wide initialization; * Don't bother checking for Win32 lockdown unless we're not in the parent process Differential Revision: https://phabricator.services.mozilla.com/D20386 --HG-- extra : moz-landing-system : lando --- ipc/mscom/ProcessRuntime.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipc/mscom/ProcessRuntime.cpp b/ipc/mscom/ProcessRuntime.cpp index 8e079ce2904c..90f825e9bb0f 100644 --- a/ipc/mscom/ProcessRuntime.cpp +++ b/ipc/mscom/ProcessRuntime.cpp @@ -55,7 +55,7 @@ ProcessRuntime::ProcessRuntime(GeckoProcessType aProcessType) // window, which implicitly requires user32 and Win32k, which are blocked. // Instead we start a multi-threaded apartment and conduct our process-wide // COM initialization on that MTA background thread. - if (IsWin32kLockedDown()) { + if (!mIsParentProcess && IsWin32kLockedDown()) { // It is possible that we're running so early that we might need to start // the thread manager ourselves. nsresult rv = nsThreadManager::get().Init(); @@ -87,6 +87,7 @@ void ProcessRuntime::InitInsideApartment() { ProcessInitLock lock; if (lock.IsInitialized()) { // COM has already been initialized by a previous ProcessRuntime instance + mInitResult = S_OK; return; }