tor-browser

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

ContentProcess.h (1453B)


      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 
      7 #ifndef dom_tabs_ContentThread_h
      8 #define dom_tabs_ContentThread_h 1
      9 
     10 #include "ContentChild.h"
     11 #include "mozilla/ipc/ProcessChild.h"
     12 #include "nsXREDirProvider.h"
     13 
     14 #if defined(XP_WIN)
     15 #  include "mozilla/mscom/ProcessRuntime.h"
     16 #endif
     17 
     18 namespace mozilla::dom {
     19 
     20 /**
     21 * ContentProcess is a singleton on the content process which represents
     22 * the main thread where tab instances live.
     23 */
     24 class ContentProcess : public mozilla::ipc::ProcessChild {
     25  using ProcessChild = mozilla::ipc::ProcessChild;
     26 
     27 public:
     28  ContentProcess(IPC::Channel::ChannelHandle aClientChannel,
     29                 ProcessId aParentPid, const nsID& aMessageChannelId);
     30  ~ContentProcess();
     31 
     32  virtual bool Init(int aArgc, char* aArgv[]) override;
     33  virtual void CleanUp() override;
     34 
     35 private:
     36  void InfallibleInit(int aArgc, char* aArgv[]);
     37 
     38  ContentChild mContent;
     39 #if defined(XP_WIN)
     40  // This object initializes and configures COM. This must happen prior to
     41  // constructing mXREEmbed.
     42  mozilla::mscom::ProcessRuntime mCOMRuntime;
     43 #endif
     44  nsXREDirProvider mDirProvider;
     45 };
     46 
     47 }  // namespace mozilla::dom
     48 
     49 #endif  // ifndef dom_tabs_ContentThread_h