michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * vim: sw=2 ts=8 et : michael@0: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsDebug.h" michael@0: michael@0: #include "mozilla/ipc/IOThreadChild.h" michael@0: #include "mozilla/ipc/ProcessChild.h" michael@0: michael@0: namespace mozilla { michael@0: namespace ipc { michael@0: michael@0: ProcessChild* ProcessChild::gProcessChild; michael@0: michael@0: ProcessChild::ProcessChild(ProcessHandle parentHandle) michael@0: : ChildProcess(new IOThreadChild()) michael@0: , mUILoop(MessageLoop::current()) michael@0: , mParentHandle(parentHandle) michael@0: { michael@0: NS_ABORT_IF_FALSE(mUILoop, "UILoop should be created by now"); michael@0: NS_ABORT_IF_FALSE(!gProcessChild, "should only be one ProcessChild"); michael@0: gProcessChild = this; michael@0: } michael@0: michael@0: ProcessChild::~ProcessChild() michael@0: { michael@0: gProcessChild = nullptr; michael@0: } michael@0: michael@0: } // namespace ipc michael@0: } // namespace mozilla