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"
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"
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
);
32 Maybe
<const char*> parentBuildID
=
33 geckoargs::sParentBuildID
.Get(aArgc
, aArgv
);
34 if (parentBuildID
.isNothing()) {
38 if (!ProcessChild::InitPrefs(aArgc
, aArgv
)) {
42 return mGPU
->Init(TakeInitialEndpoint(), *parentBuildID
);
45 void GPUProcessImpl::CleanUp() { NS_ShutdownXPCOM(nullptr); }
48 } // namespace mozilla