Bug 1869092 - Fix timeouts in browser_PanelMultiView.js. r=twisniewski,test-only
[gecko.git] / ipc / glue / IOThreadChild.h
blobd4e877e67c93e22ce1bb736c79a4126a773869fe
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/. */
7 #ifndef dom_plugins_IOThreadChild_h
8 #define dom_plugins_IOThreadChild_h
10 #include "chrome/common/child_thread.h"
11 #include "mozilla/ipc/Endpoint.h"
12 #include "mozilla/ipc/NodeController.h"
13 #include "mozilla/ipc/ProcessChild.h"
15 namespace mozilla {
16 namespace ipc {
17 //-----------------------------------------------------------------------------
19 // The IOThreadChild class represents a background thread where the
20 // IPC IO MessageLoop lives.
21 class IOThreadChild : public ChildThread {
22 public:
23 explicit IOThreadChild(base::ProcessId aParentPid)
24 : ChildThread(base::Thread::Options(MessageLoop::TYPE_IO,
25 /* stack size */ 0),
26 aParentPid) {}
28 ~IOThreadChild() = default;
30 static MessageLoop* message_loop() {
31 return IOThreadChild::current()->Thread::message_loop();
34 protected:
35 static IOThreadChild* current() {
36 return static_cast<IOThreadChild*>(ChildThread::current());
39 private:
40 DISALLOW_EVIL_CONSTRUCTORS(IOThreadChild);
43 } // namespace ipc
44 } // namespace mozilla
46 #endif // ifndef dom_plugins_IOThreadChild_h