Issue #2301 - Make Gecko Media Plugins optional when not building EME or WebRTC

Co-authored-by: Moonchild <moonchild@palemoon.org>
This commit is contained in:
Matheus Marinho 2023-08-31 12:07:34 -03:00 committed by roytam1
commit 9e7d1492e6
54 changed files with 314 additions and 30 deletions

View file

@ -66,8 +66,10 @@
#include "mozilla/ipc/XPCShellEnvironment.h"
#include "mozilla/WindowsDllBlocklist.h"
#ifdef MOZ_GMP
#include "GMPProcessChild.h"
#include "GMPLoader.h"
#endif
#include "mozilla/gfx/GPUProcessImpl.h"
#include "GeckoProfiler.h"
@ -92,9 +94,11 @@ using mozilla::dom::ContentProcess;
using mozilla::dom::ContentParent;
using mozilla::dom::ContentChild;
#ifdef MOZ_GMP
using mozilla::gmp::GMPLoader;
using mozilla::gmp::CreateGMPLoader;
using mozilla::gmp::GMPProcessChild;
#endif
using mozilla::ipc::TestShellParent;
using mozilla::ipc::TestShellCommandParent;
@ -256,17 +260,23 @@ SetTaskbarGroupId(const nsString& aId)
nsresult
XRE_InitChildProcess(int aArgc,
#ifdef MOZ_GMP
char* aArgv[],
const XREChildData* aChildData)
#else
char* aArgv[])
#endif
{
NS_ENSURE_ARG_MIN(aArgc, 2);
NS_ENSURE_ARG_POINTER(aArgv);
NS_ENSURE_ARG_POINTER(aArgv[0]);
#ifdef MOZ_GMP
MOZ_ASSERT(aChildData);
// On non-Fennec Gecko, the GMPLoader code resides in plugin-container,
// and we must forward it through to the GMP code here.
GMPProcessChild::SetGMPLoader(aChildData->gmpLoader.get());
#endif
#if defined(XP_WIN)
// From the --attach-console support in nsNativeAppSupportWin.cpp, but
@ -461,9 +471,11 @@ XRE_InitChildProcess(int aArgc,
// Content processes need the XPCOM/chromium frankenventloop
uiLoopType = MessageLoop::TYPE_MOZILLA_CHILD;
break;
#ifdef MOZ_GMP
case GeckoProcessType_GMPlugin:
uiLoopType = MessageLoop::TYPE_DEFAULT;
break;
#endif
default:
uiLoopType = MessageLoop::TYPE_UI;
break;
@ -525,9 +537,11 @@ XRE_InitChildProcess(int aArgc,
#endif
break;
#ifdef MOZ_GMP
case GeckoProcessType_GMPlugin:
process = new gmp::GMPProcessChild(parentPID);
break;
#endif
case GeckoProcessType_GPU:
process = new gfx::GPUProcessImpl(parentPID);