ContentProcess.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. #ifndef dom_tabs_ContentThread_h
  6. #define dom_tabs_ContentThread_h 1
  7. #include "mozilla/ipc/ProcessChild.h"
  8. #include "mozilla/ipc/ScopedXREEmbed.h"
  9. #include "ContentChild.h"
  10. #if defined(XP_WIN)
  11. #include "mozilla/mscom/MainThreadRuntime.h"
  12. #endif
  13. namespace mozilla {
  14. namespace dom {
  15. /**
  16. * ContentProcess is a singleton on the content process which represents
  17. * the main thread where tab instances live.
  18. */
  19. class ContentProcess : public mozilla::ipc::ProcessChild
  20. {
  21. typedef mozilla::ipc::ProcessChild ProcessChild;
  22. public:
  23. explicit ContentProcess(ProcessId aParentPid)
  24. : ProcessChild(aParentPid)
  25. { }
  26. ~ContentProcess()
  27. { }
  28. virtual bool Init() override;
  29. virtual void CleanUp() override;
  30. void SetAppDir(const nsACString& aPath);
  31. private:
  32. ContentChild mContent;
  33. mozilla::ipc::ScopedXREEmbed mXREEmbed;
  34. #if defined(XP_WIN)
  35. // This object initializes and configures COM.
  36. mozilla::mscom::MainThreadRuntime mCOMRuntime;
  37. #endif
  38. DISALLOW_EVIL_CONSTRUCTORS(ContentProcess);
  39. };
  40. } // namespace dom
  41. } // namespace mozilla
  42. #endif // ifndef dom_tabs_ContentThread_h