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 #ifndef _include_gfx_ipc_GPUProcessImpl_h__ 7 #define _include_gfx_ipc_GPUProcessImpl_h__ 8 9 #include "mozilla/ipc/ProcessChild.h" 10 #include "GPUParent.h" 11 12 #if defined(XP_WIN) 13 #include "mozilla/mscom/MainThreadRuntime.h" 14 #endif 15 16 namespace mozilla { 17 namespace gfx { 18 19 // This class owns the subprocess instance of a PGPU - which in this case, 20 // is a GPUParent. It is instantiated as a singleton in XRE_InitChildProcess. 21 class GPUProcessImpl final : public ipc::ProcessChild { 22 public: 23 explicit GPUProcessImpl(ProcessId aParentPid); 24 ~GPUProcessImpl(); 25 26 bool Init(int aArgc, char* aArgv[]) override; 27 void CleanUp() override; 28 29 private: 30 DISALLOW_COPY_AND_ASSIGN(GPUProcessImpl); 31 32 GPUParent mGPU; 33 34 #if defined(XP_WIN) 35 // This object initializes and configures COM. 36 mozilla::mscom::MainThreadRuntime mCOMRuntime; 37 #endif 38 }; 39 40 } // namespace gfx 41 } // namespace mozilla 42 43 #endif // _include_gfx_ipc_GPUProcessImpl_h__ 44