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(OS_WIN) && defined(MOZ_SANDBOX)
13 # include "mozilla/sandboxTarget.h"
14 #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX)
15 # include "mozilla/SandboxSettings.h"
23 GPUProcessImpl::GPUProcessImpl(ProcessId aParentPid
)
24 : ProcessChild(aParentPid
) {}
26 GPUProcessImpl::~GPUProcessImpl() = default;
28 bool GPUProcessImpl::Init(int aArgc
, char* aArgv
[]) {
29 #if defined(MOZ_SANDBOX) && defined(OS_WIN)
30 mozilla::SandboxTarget::Instance()->StartSandbox();
31 #elif defined(__OpenBSD__) && defined(MOZ_SANDBOX)
32 StartOpenBSDSandbox(GeckoProcessType_GPU
);
35 Maybe
<const char*> parentBuildID
=
36 geckoargs::sParentBuildID
.Get(aArgc
, aArgv
);
37 if (parentBuildID
.isNothing()) {
41 if (!ProcessChild::InitPrefs(aArgc
, aArgv
)) {
45 return mGPU
.Init(ParentPid(), *parentBuildID
,
46 IOThreadChild::TakeInitialPort());
49 void GPUProcessImpl::CleanUp() { NS_ShutdownXPCOM(nullptr); }
52 } // namespace mozilla