Bug 1883706: part 3) Implement `createHTML`, `createScript` and `createScriptURL...
[gecko.git] / ipc / glue / UtilityProcessImpl.h
blob9b42cd5f74305147081b3c31890456734a930568
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_ipc_glue_UtilityProcessImpl_h__
7 #define _include_ipc_glue_UtilityProcessImpl_h__
8 #include "mozilla/ipc/ProcessChild.h"
10 #if defined(XP_WIN)
11 # include "mozilla/mscom/ProcessRuntime.h"
12 #endif
14 #include "mozilla/ipc/UtilityProcessChild.h"
16 namespace mozilla::ipc {
18 // This class owns the subprocess instance of a PUtilityProcess - which in this
19 // case, is a UtilityProcessParent. It is instantiated as a singleton in
20 // XRE_InitChildProcess.
21 class UtilityProcessImpl final : public ipc::ProcessChild {
22 public:
23 using ipc::ProcessChild::ProcessChild;
24 ~UtilityProcessImpl();
26 bool Init(int aArgc, char* aArgv[]) override;
27 void CleanUp() override;
29 #if defined(XP_WIN)
30 static void LoadLibraryOrCrash(LPCWSTR aLib);
31 #endif // defined(XP_WIN)
33 private:
34 RefPtr<UtilityProcessChild> mUtility = UtilityProcessChild::GetSingleton();
36 #if defined(XP_WIN)
37 mozilla::mscom::ProcessRuntime mCOMRuntime;
38 #endif
41 } // namespace mozilla::ipc
43 #endif // _include_ipc_glue_UtilityProcessImpl_h__