Bug 1890689 accumulate input in LargerReceiverBlockSizeThanDesiredBuffering GTest...
[gecko.git] / gfx / ipc / GPUProcessImpl.cpp
blob3ea86843e0f5df74a88c42d67e934ff85534764d
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "GPUProcessImpl.h"
7 #include "mozilla/ipc/IOThreadChild.h"
8 #include "nsXPCOM.h"
9 #include "mozilla/ipc/ProcessUtils.h"
10 #include "mozilla/GeckoArgs.h"
12 #if defined(XP_WIN) && defined(MOZ_SANDBOX)
13 # include "mozilla/sandboxTarget.h"
14 #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX)
15 # include "mozilla/SandboxSettings.h"
16 #endif
18 namespace mozilla {
19 namespace gfx {
21 using namespace ipc;
23 GPUProcessImpl::~GPUProcessImpl() = default;
25 bool GPUProcessImpl::Init(int aArgc, char* aArgv[]) {
26 #if defined(MOZ_SANDBOX) && defined(XP_WIN)
27 mozilla::SandboxTarget::Instance()->StartSandbox();
28 #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX)
29 StartOpenBSDSandbox(GeckoProcessType_GPU);
30 #endif
32 Maybe<const char*> parentBuildID =
33 geckoargs::sParentBuildID.Get(aArgc, aArgv);
34 if (parentBuildID.isNothing()) {
35 return false;
38 if (!ProcessChild::InitPrefs(aArgc, aArgv)) {
39 return false;
42 return mGPU->Init(TakeInitialEndpoint(), *parentBuildID);
45 void GPUProcessImpl::CleanUp() { NS_ShutdownXPCOM(nullptr); }
47 } // namespace gfx
48 } // namespace mozilla