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
This commit is contained in:
Aaron Klotz 2019-02-20 03:27:00 +00:00
Родитель 147caaf718
Коммит c8b2ad1720
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -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;
}