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: #ifndef mozilla_ipc_ProcessChild_h michael@0: #define mozilla_ipc_ProcessChild_h michael@0: michael@0: #include "base/message_loop.h" michael@0: #include "base/process.h" michael@0: michael@0: #include "chrome/common/child_process.h" michael@0: michael@0: // ProcessChild is the base class for all subprocesses of the main michael@0: // browser process. Its code runs on the thread that started in michael@0: // main(). michael@0: michael@0: namespace mozilla { michael@0: namespace ipc { michael@0: michael@0: class ProcessChild : public ChildProcess { michael@0: protected: michael@0: typedef base::ProcessHandle ProcessHandle; michael@0: michael@0: public: michael@0: ProcessChild(ProcessHandle parentHandle); michael@0: virtual ~ProcessChild(); michael@0: michael@0: virtual bool Init() = 0; michael@0: virtual void CleanUp() michael@0: { } michael@0: michael@0: static MessageLoop* message_loop() { michael@0: return gProcessChild->mUILoop; michael@0: } michael@0: michael@0: protected: michael@0: static ProcessChild* current() { michael@0: return gProcessChild; michael@0: } michael@0: michael@0: ProcessHandle ParentHandle() { michael@0: return mParentHandle; michael@0: } michael@0: michael@0: private: michael@0: static ProcessChild* gProcessChild; michael@0: michael@0: MessageLoop* mUILoop; michael@0: ProcessHandle mParentHandle; michael@0: michael@0: DISALLOW_EVIL_CONSTRUCTORS(ProcessChild); michael@0: }; michael@0: michael@0: } // namespace ipc michael@0: } // namespace mozilla michael@0: michael@0: michael@0: #endif // ifndef mozilla_ipc_ProcessChild_h