tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

UtilityProcessImpl.h (1341B)


      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"
      9 
     10 #if defined(XP_WIN)
     11 #  include "mozilla/mscom/ProcessRuntime.h"
     12 #endif
     13 
     14 #include "mozilla/ipc/UtilityProcessChild.h"
     15 
     16 namespace mozilla::ipc {
     17 
     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();
     25 
     26  bool Init(int aArgc, char* aArgv[]) override;
     27  void CleanUp() override;
     28 
     29 #if defined(XP_WIN)
     30  static void LoadLibraryOrCrash(LPCWSTR aLib);
     31 #endif  // defined(XP_WIN)
     32 
     33 private:
     34  RefPtr<UtilityProcessChild> mUtility = UtilityProcessChild::GetSingleton();
     35 
     36 #if defined(XP_WIN)
     37  mozilla::mscom::ProcessRuntime mCOMRuntime;
     38 #endif
     39 };
     40 
     41 }  // namespace mozilla::ipc
     42 
     43 #endif  // _include_ipc_glue_UtilityProcessImpl_h__