зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1797301) for causing Bp-Hybrid bustages. CLOSED TREE
Backed out changeset 2552990ed77e (bug 1797301) Backed out changeset 147777c37f57 (bug 1797301)
This commit is contained in:
Родитель
68cb2f2844
Коммит
344193e4bd
|
@ -18,7 +18,6 @@
|
|||
# include "WMFUtils.h"
|
||||
|
||||
# include "mozilla/sandboxTarget.h"
|
||||
# include "mozilla/ipc/UtilityProcessImpl.h"
|
||||
#endif // defined(XP_WIN) && defined(MOZ_SANDBOX)
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
|
@ -70,20 +69,20 @@ void UtilityAudioDecoderParent::GenericPreloadForSandbox() {
|
|||
#if defined(MOZ_SANDBOX) && defined(OS_WIN)
|
||||
// Preload AV dlls so we can enable Binary Signature Policy
|
||||
// to restrict further dll loads.
|
||||
UtilityProcessImpl::LoadLibraryOrCrash(L"mozavcodec.dll");
|
||||
UtilityProcessImpl::LoadLibraryOrCrash(L"mozavutil.dll");
|
||||
::LoadLibraryW(L"mozavcodec.dll");
|
||||
::LoadLibraryW(L"mozavutil.dll");
|
||||
#endif // defined(MOZ_SANDBOX) && defined(OS_WIN)
|
||||
}
|
||||
|
||||
/* static */
|
||||
void UtilityAudioDecoderParent::WMFPreloadForSandbox() {
|
||||
#if defined(MOZ_SANDBOX) && defined(OS_WIN)
|
||||
UtilityProcessImpl::LoadLibraryOrCrash(L"mfplat.dll");
|
||||
UtilityProcessImpl::LoadLibraryOrCrash(L"mf.dll");
|
||||
::LoadLibraryW(L"mfplat.dll");
|
||||
::LoadLibraryW(L"mf.dll");
|
||||
|
||||
# if defined(DEBUG)
|
||||
// WMF Shutdown on debug build somehow requires this
|
||||
UtilityProcessImpl::LoadLibraryOrCrash(L"ole32.dll");
|
||||
::LoadLibraryW(L"ole32.dll");
|
||||
# endif // defined(DEBUG)
|
||||
|
||||
auto rv = wmf::MediaFoundationInitializer::HasInitialized();
|
||||
|
|
|
@ -22,16 +22,6 @@ namespace mozilla::ipc {
|
|||
|
||||
UtilityProcessImpl::~UtilityProcessImpl() = default;
|
||||
|
||||
#if defined(XP_WIN)
|
||||
/* static */
|
||||
void UtilityProcessImpl::LoadLibraryOrCrash(LPCWSTR aLib) {
|
||||
HMODULE module = ::LoadLibraryW(aLib);
|
||||
if (!module) {
|
||||
MOZ_CRASH("Unable to preload module");
|
||||
}
|
||||
}
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
bool UtilityProcessImpl::Init(int aArgc, char* aArgv[]) {
|
||||
Maybe<uint64_t> sandboxingKind = geckoargs::sSandboxingKind.Get(aArgc, aArgv);
|
||||
if (sandboxingKind.isNothing()) {
|
||||
|
@ -46,7 +36,7 @@ bool UtilityProcessImpl::Init(int aArgc, char* aArgv[]) {
|
|||
// We delay load winmm.dll so that its dependencies don't interfere with COM
|
||||
// initialization when win32k is locked down. We need to load it before we
|
||||
// lower the sandbox in processes where the policy will prevent loading.
|
||||
LoadLibraryOrCrash(L"winmm.dll");
|
||||
::LoadLibraryW(L"winmm.dll");
|
||||
|
||||
if (*sandboxingKind == SandboxingKind::GENERIC_UTILITY) {
|
||||
// Preload audio generic libraries required for ffmpeg only
|
||||
|
|
|
@ -26,10 +26,6 @@ class UtilityProcessImpl final : public ipc::ProcessChild {
|
|||
bool Init(int aArgc, char* aArgv[]) override;
|
||||
void CleanUp() override;
|
||||
|
||||
#if defined(XP_WIN)
|
||||
static void LoadLibraryOrCrash(LPCWSTR aLib);
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
private:
|
||||
RefPtr<UtilityProcessChild> mUtility = UtilityProcessChild::GetSingleton();
|
||||
|
||||
|
|
|
@ -13,10 +13,6 @@
|
|||
# include "nsServiceManagerUtils.h"
|
||||
#endif // defined(MOZ_WIDGET_ANDROID) || defined(XP_MACOSX)
|
||||
|
||||
#if defined(XP_WIN)
|
||||
# include "mozilla/ipc/UtilityProcessImpl.h"
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
#ifdef MOZ_WIDGET_ANDROID
|
||||
# define NS_APPSHELLSERVICE_CONTRACTID "@mozilla.org/widget/appshell/android;1"
|
||||
#endif // MOZ_WIDGET_ANDROID
|
||||
|
@ -138,17 +134,4 @@ TEST_F(UtilityProcess, DestroyProcess) {
|
|||
WAIT_FOR_EVENTS;
|
||||
}
|
||||
|
||||
#if defined(XP_WIN)
|
||||
static void LoadLibraryCrash_Test() {
|
||||
DisableCrashReporter();
|
||||
// Just a uuidgen name to have something random
|
||||
UtilityProcessImpl::LoadLibraryOrCrash(
|
||||
L"2b49036e-6ba3-400c-a297-38fa1f6c5255.dll");
|
||||
}
|
||||
|
||||
TEST_F(UtilityProcess, LoadLibraryCrash) {
|
||||
ASSERT_DEATH_IF_SUPPORTED(LoadLibraryCrash_Test(), "");
|
||||
}
|
||||
#endif // defined(XP_WIN)
|
||||
|
||||
#undef WAIT_FOR_EVENTS
|
||||
|
|
Загрузка…
Ссылка в новой задаче