ContentProcess.cpp 998 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. #include "mozilla/ipc/IOThreadChild.h"
  6. #include "ContentProcess.h"
  7. using mozilla::ipc::IOThreadChild;
  8. namespace mozilla {
  9. namespace dom {
  10. void
  11. ContentProcess::SetAppDir(const nsACString& aPath)
  12. {
  13. mXREEmbed.SetAppDir(aPath);
  14. }
  15. bool
  16. ContentProcess::Init()
  17. {
  18. mContent.Init(IOThreadChild::message_loop(),
  19. ParentPid(),
  20. IOThreadChild::channel());
  21. mXREEmbed.Start();
  22. mContent.InitXPCOM();
  23. mContent.InitGraphicsDeviceData();
  24. return true;
  25. }
  26. // Note: CleanUp() never gets called in non-debug builds because we exit early
  27. // in ContentChild::ActorDestroy().
  28. void
  29. ContentProcess::CleanUp()
  30. {
  31. mXREEmbed.Stop();
  32. }
  33. } // namespace dom
  34. } // namespace mozilla