# HG changeset patch # User Aaron Klotz # Date 1520625393 25200 # Node ID 1caceba533ebc4ecf677b434299e37e3511356dd # Parent f2f47b426884309d6eb3055f6f79d9a1505d0b8d Bug 1444494: Initialize DllServices in XPCShell; r=jimm diff --git a/js/xpconnect/src/XPCShellImpl.cpp b/js/xpconnect/src/XPCShellImpl.cpp --- a/js/xpconnect/src/XPCShellImpl.cpp +++ b/js/xpconnect/src/XPCShellImpl.cpp @@ -36,17 +36,19 @@ #include "nsIXULRuntime.h" #include "GeckoProfiler.h" #ifdef ANDROID #include #endif #ifdef XP_WIN +#include "mozilla/ScopeExit.h" #include "mozilla/widget/AudioSession.h" +#include "mozilla/WinDllServices.h" #include #if defined(MOZ_SANDBOX) #include "sandboxBroker.h" #endif #endif #ifdef MOZ_CODE_COVERAGE #include "mozilla/CodeCoverageHandler.h" @@ -1298,16 +1300,22 @@ XRE_XPCShellMain(int argc, char** argv, gfxPrefs::GetSingleton(); // Initialize e10s check on the main thread, if not already done BrowserTabsRemoteAutostart(); #ifdef XP_WIN // Plugin may require audio session if installed plugin can initialize // asynchronized. AutoAudioSession audioSession; + // Ensure that DLL Services are running + RefPtr dllSvc(DllServices::Get()); + auto dllServicesDisable = MakeScopeExit([&dllSvc]() { + dllSvc->Disable(); + }); + #if defined(MOZ_SANDBOX) // Required for sandboxed child processes. if (aShellData->sandboxBrokerServices) { SandboxBroker::Initialize(aShellData->sandboxBrokerServices); SandboxBroker::GeckoDependentInitialize(); } else { NS_WARNING("Failed to initialize broker services, sandboxed " "processes will fail to start.");